freebsd-dev/sys/powerpc/aim
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
..
clock.c - Correct the type of the argument to delay() so as to not conflict with 2001-10-15 12:23:10 +00:00
locore.S Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00
machdep.c Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00
mmu_oea.c Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
ofw_machdep.c Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00
ofwmagic.S Bring in NetBSD code used in the PowerPC port. 2001-06-10 02:39:37 +00:00
swtch.S Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00
trap.c Add some DIAGNOSTIC code. 2002-02-22 23:58:22 +00:00
vm_machdep.c Complete rework of the PowerPC pmap and a number of other bits in the early 2002-02-14 01:39:11 +00:00