freebsd-nq/sys/arm/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 Break out the definition of bus_space_{tag,handle}_t and a few other types 2005-04-18 21:45:34 +00:00
_inttypes.h
_limits.h Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and rename 2005-08-20 16:44:41 +00:00
_stdint.h
_types.h Switch to a 64bit time_t, while it's not a big problem to do so. 2006-05-15 00:17:27 +00:00
armreg.h XScale core 3 definitions. 2007-07-27 14:54:27 +00:00
asm.h Use __mcount() instead of _mcount() to reduce diffs with NetBSD. 2007-05-19 16:20:37 +00:00
asmacros.h Twist the RAS logic a bit to avoid branching. 2007-09-22 14:23:52 +00:00
atomic.h MFp4: Add missing atomic functions 2007-01-05 02:50:27 +00:00
blockio.h
bootconfig.h Remove __P 2007-03-21 03:28:16 +00:00
bus_dma.h - Add bounce pages for arm, largely based on the i386 implementation. 2007-01-17 00:53:05 +00:00
bus.h correct bus space unmap prototype 2006-11-19 23:46:50 +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 Clean out sysctl machdep.* related defines. 2006-05-11 17:29:25 +00:00
cpuconf.h Introduce CPU_XSCALE_CORE3, as XScale Core 3 is significally different than 2006-11-30 23:30:40 +00:00
cpufunc.h Add a new set of functions to handle L2 cache. Make them no-op for every 2007-07-27 14:39:41 +00:00
db_machdep.h Define BYTE_MSF if we're compiling a big endian kernel, so that DDB can 2006-07-27 11:41:37 +00:00
disassem.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
elf.h PR: 2006-10-04 21:37:10 +00:00
endian.h In __bswap16_var(), make sure the 16 upper bits are cleared; while 2007-09-09 11:58:38 +00:00
exec.h Use a common multi-inclusion protection, and add such a 2005-02-19 21:16:48 +00:00
fiq.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
float.h Bring in a version of float.h more correct for softfloat. 2005-03-20 00:34:24 +00:00
floatingpoint.h
fp.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
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 remote GDB bits for arm. 2006-07-14 00:50:51 +00:00
ieee.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
ieeefp.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
in_cksum.h MFp4: Forget the asm inlined version of in_cksum_hdr(). It doesn't work if 2006-03-09 23:33:59 +00:00
intr.h The iop34x has 128 interrupts. 2007-06-16 15:03:33 +00:00
katelib.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
kdb.h Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
limits.h netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
machdep.h Instead of using sysarch() to store-retrieve the tp, add a magic address, 2005-02-26 18:59:01 +00:00
md_var.h - Add bounce pages for arm, largely based on the i386 implementation. 2007-01-17 00:53:05 +00:00
memdev.h
metadata.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
mutex.h
param.h By popular demand, move __HAVE_ACPI and __PCI_REROUTE_INTERRUPT into 2006-01-09 06:05:57 +00:00
pcb.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
pcpu.h - PCPU_ADD is no longer spelled with LAZY_ in the middle. 2007-06-06 23:23:47 +00:00
pmap.h Properly handle supersections. 2007-07-27 14:45:04 +00:00
pmc_mdep.h MFP4: 2005-06-09 19:45:09 +00:00
proc.h Divorce critical sections from spinlocks. Critical sections as denoted by 2005-04-04 21:53:56 +00:00
profile.h Use __mcount() instead of _mcount() to reduce diffs with NetBSD. 2007-05-19 16:20:37 +00:00
psl.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
pte.h Fix the cache mode description. 2007-07-27 14:45:33 +00:00
ptrace.h
reg.h
reloc.h
resource.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
runq.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
setjmp.h
sf_buf.h Rewrite ARM_USE_SMALL_ALLOC so that instead of the current behavior, it maps 2006-08-08 20:59:38 +00:00
sigframe.h
signal.h Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and rename 2005-08-20 16:44:41 +00:00
smp.h
stdarg.h Use __builtin_va_start instead of __builtin_stdarg_start. GCC4 obsoletes 2006-09-21 01:37:02 +00:00
swi.h Start all license statements with /*- 2005-01-05 21:58:49 +00:00
sysarch.h Instead of using sysarch() to store-retrieve the tp, add a magic address, 2005-02-26 18:59:01 +00:00
trap.h Add support for ptrace() and gdb breakpoints. 2005-01-10 22:43:16 +00:00
ucontext.h
undefined.h Remove __P 2007-03-21 03:28:16 +00:00
utrap.h
vmparam.h Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00