freebsd-nq/sys/i386
Alan Cox 51321f7c31 Significantly reduce the cost, i.e., run time, of calls to madvise(...,
MADV_DONTNEED) and madvise(..., MADV_FREE).  Specifically, introduce a new
pmap function, pmap_advise(), that operates on a range of virtual addresses
within the specified pmap, allowing for a more efficient implementation of
MADV_DONTNEED and MADV_FREE.  Previously, the implementation of
MADV_DONTNEED and MADV_FREE relied on per-page pmap operations, such as
pmap_clear_reference().  Intuitively, the problem with this implementation
is that the pmap-level locks are acquired and released and the page table
traversed repeatedly, once for each resident page in the range
that was specified to madvise(2).  A more subtle flaw with the previous
implementation is that pmap_clear_reference() would clear the reference bit
on all mappings to the specified page, not just the mapping in the range
specified to madvise(2).

Since our malloc(3) makes heavy use of madvise(2), this change can have a
measureable impact.  For example, the system time for completing a parallel
"buildworld" on a 6-core amd64 machine was reduced by about 1.5% to 2.0%.

Note: This change only contains pmap_advise() implementations for a subset
of our supported architectures.  I will commit implementations for the
remaining architectures after further testing.  For now, a stub function is
sufficient because of the advisory nature of pmap_advise().

Discussed with: jeff, jhb, kib
Tested by:      pho (i386), marcel (ia64)
Sponsored by:   EMC / Isilon Storage Division
2013-08-29 15:49:05 +00:00
..
acpica Consistently use round_page(x) rather than roundup(x, PAGE_SIZE). There is 2013-02-15 22:43:08 +00:00
bios This isn't functionally identical. In some cases a hint to disable 2012-10-22 13:06:09 +00:00
conf The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. 2013-08-21 22:43:29 +00:00
i386 Significantly reduce the cost, i.e., run time, of calls to madvise(..., 2013-08-29 15:49:05 +00:00
ibcs2 Replace kernel virtual address space allocation with vmem. This provides 2013-08-07 06:21:20 +00:00
include Reimplement atomic operations on PDEs and PTEs in pmap.h. This change 2013-08-21 22:40:29 +00:00
isa - Correct spelling in comments 2013-04-17 11:56:11 +00:00
linux Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.h 2013-01-29 18:41:30 +00:00
pci Replace kernel virtual address space allocation with vmem. This provides 2013-08-07 06:21:20 +00:00
svr4
xbox Move the legacy(4) driver to x86. 2012-03-30 19:10:14 +00:00
xen Significantly reduce the cost, i.e., run time, of calls to madvise(..., 2013-08-29 15:49:05 +00:00
Makefile Delete duplicate tags entry I introduced in -r223901. 2011-07-15 17:27:26 +00:00