freebsd-nq/sys/sparc64/sparc64
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
..
autoconf.c Add partial support for NFS_ROOT for sparc64 (only supported in in 2001-12-21 21:27:01 +00:00
bus_machdep.c Make use of the ranged tlb demap operations where ever possible. Use 2002-02-23 22:18:15 +00:00
cache.c Use stxa_sync() when accessing the diagnostic registers to invalidate 2002-02-13 16:20:38 +00:00
clock.c Implement DELAY() using the %tick register. 2001-10-12 15:51:19 +00:00
counter.c Add support for the counter-timer which is included in the Sun U2S and 2002-02-13 16:16:36 +00:00
db_disasm.c Print the correct v9 opcodes. 2001-12-29 08:52:50 +00:00
db_hwwatch.c Use stxa_sync() when accessing the LSU control register to avoid undefined 2002-02-13 16:25:33 +00:00
db_interface.c Make cont in ddb work. 2001-12-29 08:37:35 +00:00
db_trace.c Pre-KSE/M3 commit. 2002-02-07 20:58:47 +00:00
elf_machdep.c Implement elf_reloc. This makes klds work. 2001-10-27 07:09:40 +00:00
emul.c Make these compile. 2001-12-29 09:55:37 +00:00
exception.s Apparently gcc3.1 is now using deprcated v8 instructions in v9 code 2002-02-26 17:09:24 +00:00
exception.S Apparently gcc3.1 is now using deprcated v8 instructions in v9 code 2002-02-26 17:09:24 +00:00
fp.c Make these compile. 2001-12-29 09:55:37 +00:00
genassym.c Parameterize the number of pages to allocate for the per-cpu area on 2002-02-27 06:08:13 +00:00
identcpu.c Make cpu_identify take the value of the ver register and cpuid as arguments 2002-02-27 06:05:50 +00:00
in_cksum.c Add optimized implementations of in_cksum_skip() and related functions 2001-11-06 20:05:01 +00:00
intr_machdep.c Avoid crashing in early boot when WITNESS is enabled by moving the 2002-02-13 16:36:44 +00:00
iommu.c Merge r1.42 of iommu.c and r1.9 of iommuvar.h from NetBSD (this adds 2002-02-13 15:59:17 +00:00
locore.s Parameterize the number of pages to allocate for the per-cpu area on 2002-02-27 06:08:13 +00:00
locore.S Parameterize the number of pages to allocate for the per-cpu area on 2002-02-27 06:08:13 +00:00
machdep.c Parameterize the number of pages to allocate for the per-cpu area on 2002-02-27 06:08:13 +00:00
mp_exception.s Add initial smp support. This gets as far as allowing the secondary 2002-01-08 05:50:26 +00:00
mp_exception.S Add initial smp support. This gets as far as allowing the secondary 2002-01-08 05:50:26 +00:00
mp_locore.s Add initial smp support. This gets as far as allowing the secondary 2002-01-08 05:50:26 +00:00
mp_locore.S Add initial smp support. This gets as far as allowing the secondary 2002-01-08 05:50:26 +00:00
mp_machdep.c Convert p->p_runtime and PCPU(switchtime) to bintime format. 2002-02-22 13:32:01 +00:00
nexus.c Add the counter-timer node to the exclusion list, as it is handled 2002-02-13 16:28:40 +00:00
ofw_bus.c Add some OpenFirmware bus support code and definitions. 2001-11-09 20:10:55 +00:00
ofw_machdep.c Fix a bug that was indroduced while moving this code around (use the 2001-12-21 21:31:44 +00:00
pmap.c Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
pv.c Fix a horribly suboptimal algorithm in the vm_daemon. 2002-02-27 18:03:02 +00:00
rwindow.c Add a macro for shift of an integer (1 << shift == sizeof). Move the pointer 2002-02-27 00:21:04 +00:00
sparcbus_if.m Add a file forgotten in the previous commit (a kobj interface that 2001-11-09 20:43:44 +00:00
support.s Use PCB_REG instead of loading the pcb from curthread. This fixes a bug 2002-02-23 20:54:01 +00:00
support.S Use PCB_REG instead of loading the pcb from curthread. This fixes a bug 2002-02-23 20:54:01 +00:00
swtch.s Use pcpu.pc_cpumask instead of computing 1 << cpuid. 2002-02-27 00:27:05 +00:00
swtch.S Use pcpu.pc_cpumask instead of computing 1 << cpuid. 2002-02-27 00:27:05 +00:00
sys_machdep.c Implement user trap delivery as specified by the sparc abi. This provides 2002-01-01 20:56:28 +00:00
tick.c - Add a file for machine dependant loader metdata types. Include this in 2001-12-23 07:02:23 +00:00
trap.c Convert pmap.pm_context to an array of contexts indexed by cpuid. This 2002-02-26 06:57:30 +00:00
tsb.c Convert pmap.pm_context to an array of contexts indexed by cpuid. This 2002-02-26 06:57:30 +00:00
upa.c
vm_machdep.c Minor cleanup. 2002-02-27 00:31:31 +00:00