freebsd-dev/sys/i386
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
..
acpica Fix typo in function name. 2002-01-10 03:26:46 +00:00
apm Some fix for the recent apm module changes. 2001-11-01 16:34:07 +00:00
bios Some fix for the recent apm module changes. 2001-11-01 16:34:07 +00:00
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf Correct path to pucdata.c 2002-02-18 15:46:10 +00:00
i386 Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
ibcs2 Use the updated getcredhostname() function. 2002-02-27 16:55:30 +00:00
include Add the following functions/macros to support byte order conversions and 2002-02-27 17:16:18 +00:00
isa Back out all the pmap related stuff I've touched over the last few days. 2002-02-27 09:51:33 +00:00
linux Pre-KSE/M3 commit. 2002-02-07 20:58:47 +00:00
pci The Libretto L series has no $PIR table, but does have a _PIR table. 2002-01-20 03:28:29 +00:00
svr4 Clear the single-step flag for signal handlers. This fixes bogus trace 2002-01-10 11:49:55 +00:00
Makefile Update pathnames for creation of tags file. 2001-12-05 01:23:21 +00:00