freebsd-dev/sys/sparc64/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
asi.h unbreak sparc64 loader build 2006-10-09 05:59:04 +00:00
asm.h
asmacros.h
atomic.h
bus_common.h o Revamp the sparc64 interrupt code in order to be able to interface 2007-09-06 19:16:30 +00:00
bus_dma.h
bus_private.h Rototill the sparc64 nexus(4) (actually this brings in the code the 2007-03-07 21:13:51 +00:00
bus.h - Rename UPA_BUS_SPACE to NEXUS_BUS_SPACE; besides an UPA bus, nexus(4) 2007-01-18 18:32:26 +00:00
cache.h Convert the remainder of the low hanging fruits regarding including 2007-01-19 11:15:34 +00:00
ccr.h
clock.h First part of a little cleanup in the calendar/timezone/RTC handling. 2006-10-02 12:59:59 +00:00
cpu.h
cpufunc.h
db_machdep.h
elf.h PR: 2006-10-04 21:37:10 +00:00
endian.h In the replacement text of the __bswapN_const() macros encapsulate the 2006-10-30 21:50:11 +00:00
exec.h
float.h
floatingpoint.h
fp.h
frame.h Convert the remainder of the low hanging fruits regarding including 2007-01-19 11:15:34 +00:00
fsr.h Convert the remainder of the low hanging fruits regarding including 2007-01-19 11:15:34 +00:00
gdb_machdep.h
idprom.h
ieee.h
ieeefp.h
in_cksum.h
instr.h
intr_machdep.h o Revamp the sparc64 interrupt code in order to be able to interface 2007-09-06 19:16:30 +00:00
iommureg.h - Divorce the IOTSBs, which so far where handled via a global list 2007-08-05 11:56:44 +00:00
iommuvar.h - Divorce the IOTSBs, which so far where handled via a global list 2007-08-05 11:56:44 +00:00
kdb.h Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
kerneldump.h
ktr.h
limits.h
lsu.h
md_var.h
memdev.h
metadata.h
mutex.h
ofw_bus.h
ofw_machdep.h
ofw_mem.h
ofw_nexus.h Rototill the sparc64 nexus(4) (actually this brings in the code the 2007-03-07 21:13:51 +00:00
param.h add new large page sizes for use by shared loader 2006-12-18 07:28:59 +00:00
pcb.h Convert the remainder of the low hanging fruits regarding including 2007-01-19 11:15:34 +00:00
pcpu.h Rework the PCPU_* (MD) interface: 2007-06-04 21:38:48 +00:00
pmap.h Add pmap_clear_write() to the interface between the virtual memory 2006-07-20 17:48:41 +00:00
pmc_mdep.h
proc.h
profile.h - Add bits for userland profiling. For sun4u this is compile-tested only. 2007-05-11 23:43:55 +00:00
pstate.h
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 Remove 3rd clause, renumber, ok per email 2007-01-12 07:26:21 +00:00
sf_buf.h
sigframe.h
signal.h
smp.h - Add support for sending IPIs with USIII and greater sun4u CPUs. 2007-06-16 23:26:00 +00:00
stdarg.h Use __builtin_va_start instead of __builtin_stdarg_start. GCC4 obsoletes 2006-09-21 01:37:02 +00:00
sysarch.h
tick.h
tlb.h
trap.h
tsb.h Convert the remainder of the low hanging fruits regarding including 2007-01-19 11:15:34 +00:00
tstate.h
tte.h
ucontext.h
upa.h
utrap.h
varargs.h
ver.h - Also identify USIIIi+, USIV and USIV+ CPUs. 2007-05-20 13:47:36 +00:00
vmparam.h Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
watch.h
wstate.h