freebsd-skq/sys/powerpc/include
Alan Cox 7bfda801a8 Change the management of cached pages (PQ_CACHE) in two fundamental
ways:

(1) Cached pages are no longer kept in the object's resident page
splay tree and memq.  Instead, they are kept in a separate per-object
splay tree of cached pages.  However, access to this new per-object
splay tree is synchronized by the _free_ page queues lock, not to be
confused with the heavily contended page queues lock.  Consequently, a
cached page can be reclaimed by vm_page_alloc(9) without acquiring the
object's lock or the page queues lock.

This solves a problem independently reported by tegge@ and Isilon.
Specifically, they observed the page daemon consuming a great deal of
CPU time because of pages bouncing back and forth between the cache
queue (PQ_CACHE) and the inactive queue (PQ_INACTIVE).  The source of
this problem turned out to be a deadlock avoidance strategy employed
when selecting a cached page to reclaim in vm_page_select_cache().
However, the root cause was really that reclaiming a cached page
required the acquisition of an object lock while the page queues lock
was already held.  Thus, this change addresses the problem at its
root, by eliminating the need to acquire the object's lock.

Moreover, keeping cached pages in the object's primary splay tree and
memq was, in effect, optimizing for the uncommon case.  Cached pages
are reclaimed far, far more often than they are reactivated.  Instead,
this change makes reclamation cheaper, especially in terms of
synchronization overhead, and reactivation more expensive, because
reactivated pages will have to be reentered into the object's primary
splay tree and memq.

(2) Cached pages are now stored alongside free pages in the physical
memory allocator's buddy queues, increasing the likelihood that large
allocations of contiguous physical memory (i.e., superpages) will
succeed.

Finally, as a result of this change long-standing restrictions on when
and where a cached page can be reclaimed and returned by
vm_page_alloc(9) are eliminated.  Specifically, calls to
vm_page_alloc(9) specifying VM_ALLOC_INTERRUPT can now reclaim and
return a formerly cached page.  Consequently, a call to malloc(9)
specifying M_NOWAIT is less likely to fail.

Discussed with: many over the course of the summer, including jeff@,
   Justin Husted @ Isilon, peter@, tegge@
Tested by: an earlier version by kris@
Approved by: re (kensmith)
2007-09-25 06:25:06 +00:00
..
_bus.h
_inttypes.h
_limits.h
_stdint.h
_types.h
asm.h
atomic.h Cast the arguments to atomic_*_ptr() when mapping it to atomic_*_32() 2007-07-10 04:40:00 +00:00
bat.h
bootinfo.h
bus_dma.h
bus.h Implement bus_space_map(). 2006-12-13 03:25:31 +00:00
clock.h First part of a little cleanup in the calendar/timezone/RTC handling. 2006-10-02 12:59:59 +00:00
cpu.h Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
cpufunc.h
db_machdep.h
elf.h PR: 2006-10-04 21:37:10 +00:00
endian.h
exec.h
float.h
floatingpoint.h
fpu.h
frame.h Tweak how the MD code calls the fooclock() methods some. Instead of 2005-12-22 22:16:09 +00:00
gdb_machdep.h Add skeletal support for GDB. In particular gdb_cpu_getreg() needs 2006-08-24 21:52:11 +00:00
hid.h
ieee.h
ieeefp.h
in_cksum.h
intr_machdep.h Revamp the interrupt handling in support of INTR_FILTER. This includes: 2007-08-11 19:25:32 +00:00
intr.h
kdb.h Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
limits.h
md_var.h Revamp the interrupt handling in support of INTR_FILTER. This includes: 2007-08-11 19:25:32 +00:00
memdev.h
metadata.h
mmuvar.h Insert a layer of indirection to the pmap code, using a kobj for 2005-11-08 06:48:08 +00:00
mutex.h
nexusvar.h
ofw_machdep.h o Move the prototype of mem_valid() from ofw_machdep.h to md_var.h. 2006-07-26 17:12:54 +00:00
openpicreg.h
openpicvar.h Revamp the interrupt handling in support of INTR_FILTER. This includes: 2007-08-11 19:25:32 +00:00
param.h Drop _MACHINE_ARCH and _MACHINE defines (not to be confused with 2005-12-06 13:27:21 +00:00
pcb.h Forward declare struct trapframe. 2006-07-26 17:05:11 +00:00
pcpu.h Rework the PCPU_* (MD) interface: 2007-06-04 21:38:48 +00:00
pio.h
pmap.h Fix gdb issue where the i-cache was not being updated when a breakpoint 2006-12-05 04:01:52 +00:00
pmc_mdep.h
powerpc.h
proc.h
profile.h Add user-space profiling support. Kernel profiling still todo. 2005-12-29 04:07:36 +00:00
psl.h
pte.h Add definitions for 64-bit PTEs 2005-11-11 12:03:28 +00:00
ptrace.h
reg.h
reloc.h Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
resource.h
runq.h
sc_machdep.h
setjmp.h
sf_buf.h
sigframe.h
signal.h
smp.h
spr.h
sr.h
stdarg.h Use __builtin_va_start instead of __builtin_stdarg_start. GCC4 obsoletes 2006-09-21 01:37:02 +00:00
trap.h Add prototype for trap(). 2007-08-07 18:39:28 +00:00
ucontext.h
varargs.h
vmparam.h Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00