freebsd-nq/sys
Mike Silbersack 7f3a40933b Fix a horribly suboptimal algorithm in the vm_daemon.
In order to determine what to page out, the vm_daemon checks
reference bits on all pages belonging to all processes.  Unfortunately,
the algorithm used reacted badly with shared pages; each shared page
would be checked once per process sharing it; this caused an O(N^2)
growth of tlb invalidations.  The algorithm has been changed so that
each page will be checked only 16 times.

Prior to this change, a fork/sleepbomb of 1300 processes could cause
the vm_daemon to take over 60 seconds to complete, effectively
freezing the system for that time period.  With this change
in place, the vm_daemon completes in less than a second.  Any system
with hundreds of processes sharing pages should benefit from this change.

Note that the vm_daemon is only run when the system is under extreme
memory pressure.  It is likely that many people with loaded systems saw
no symptoms of this problem until they reached the point where swapping
began.

Special thanks go to dillon, peter, and Chuck Cranor, who helped me
get up to speed with vm internals.

PR:		33542, 20393
Reviewed by:	dillon
MFC after:	1 week
2002-02-27 18:03:02 +00:00
..
alpha Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
amd64 Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
arm We need machine/{signal,ucontext}.h to build a cross GCC compiler. 2001-12-09 19:39:49 +00:00
boot - Fix indentation and return statements to conform to style(9). 2002-02-26 10:05:20 +00:00
cam GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
coda Fix LINT breakage by adding a missing include. 2002-02-23 22:55:47 +00:00
compat Use the updated getcredhostname() function. 2002-02-27 16:47:27 +00:00
conf Add gem and hme. 2002-02-27 17:46:04 +00:00
contrib Move some debugger-only symbols around; this patch didn't make it into 2002-02-24 07:51:46 +00:00
crypto off by one error in Aaron Gifford's code. KAME PR 393. 2002-02-26 16:58:58 +00:00
ddb ^U kills an entire input line in most applications, 2002-02-12 23:38:40 +00:00
dev Add a driver for the Sun GEM (Gigabit) and ERI (100 Mb/s) PCI ethernet 2002-02-27 17:41:06 +00:00
fs Fix LINT breakage by adding a missing include. 2002-02-23 22:55:47 +00:00
geom Reduce kernel stack usage of ccdinit() by MAXPATHLEN by using MALLOC(9). 2001-12-30 17:34:19 +00:00
gnu Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
i4b Remove a redundant decalaration of call_desc[] since it's now a 2002-02-27 08:33:08 +00:00
i386 Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
ia64 Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
isa revert last commit temporarily due to whining on the lists. 2002-02-26 20:33:41 +00:00
isofs/cd9660 Fix mounting root from a ISO9660 filesystem on a SCSI CDROM. 2001-11-27 03:55:43 +00:00
kern Fix a NULL deref panic in pipe_write, we can't blindly lock 2002-02-27 17:23:16 +00:00
libkern Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
modules turn on the ethertype filter module 2002-02-27 08:54:13 +00:00
net Fix warnings in the gif(4) driver so it compiles with -Werror. 2002-02-26 20:11:33 +00:00
netatalk Make `options NETATALK' compile after the -fno-common changes. 2002-01-16 11:26:50 +00:00
netatm Replace a few more lines of code orphaned by MFREE going away. 2002-02-07 22:08:32 +00:00
netgraph Send a NGM_PPPOE_ACNAME message to userland when a node is connected. 2002-02-20 15:51:11 +00:00
netinet Change the wording of the inline comments from the previous commit. 2002-02-27 13:52:06 +00:00
netinet6 Introduce a version field to `struct xucred' in place of one of the 2002-02-27 04:45:37 +00:00
netipx Pre-KSE/M3 commit. 2002-02-07 20:58:47 +00:00
netkey Lock struct pgrp, session and sigio. 2002-02-23 11:12:57 +00:00
netnatm Initialise the intrq_present fields at runtime, not link time. This allows 2002-01-08 10:34:03 +00:00
netncp Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
netns Initialise the intrq_present fields at runtime, not link time. This allows 2002-01-08 10:34:03 +00:00
netsmb Remove redundant checks for iovcnt > 1. This should be handled properly 2002-02-21 16:18:39 +00:00
nfs When the old nfsm_adv() macro was moved to nfsm_adv_xx(), a '>=' 2001-12-31 06:56:31 +00:00
nfsclient Fix a long line touched in previous commit (but not caused by previous 2002-02-07 23:03:41 +00:00
nfsserver The vnode was not being vput()'d in the EEXIST mknod case on the nfs 2002-01-14 19:14:08 +00:00
pc98 Disksort will not "munge" requests, BIO_ORDERED or not, so remove 2002-02-22 09:14:06 +00:00
pccard Add some code which is compatible for NEWCARD. It makes manufacturer 2002-02-20 14:42:36 +00:00
pci Fix warning; amdsmb_abort() is not used. 2002-02-26 01:04:58 +00:00
posix4 In a threaded world, differnt priorirites become properties of 2002-02-11 20:37:54 +00:00
powerpc Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
rpc
security/lomac Introduce a version field to `struct xucred' in place of one of the 2002-02-27 04:45:37 +00:00
sparc64 Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
svr4
sys Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
tools Throw the $FreeBSD$s back in, properly escaping them. 2002-01-04 05:27:47 +00:00
ufs Replace bowrite() with BUF_WRITE in ufs. 2002-02-22 09:03:00 +00:00
vm Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
Makefile