cvs commit: src/sys/vm vm_fault.c vm_map.c
Alan Cox
alc at FreeBSD.org
Tue May 22 04:46:01 UTC 2007
alc 2007-05-22 04:46:00 UTC
FreeBSD src repository
Modified files:
sys/vm vm_fault.c vm_map.c
Log:
Eliminate the reactivation of cached pages in vm_fault_prefault() and
vm_map_pmap_enter() unless the caller is madvise(MADV_WILLNEED). With
the exception of calls to vm_map_pmap_enter() from
madvise(MADV_WILLNEED), vm_fault_prefault() and vm_map_pmap_enter()
are both used to create speculative mappings. Thus, always
reactivating cached pages is a mistake. In principle, cached pages
should only be reactivated by an actual access. Otherwise, the
following misbehavior can occur. On a hard fault for a text page the
clustering algorithm fetches not only the required page but also
several of the adjacent pages. Now, suppose that one or more of the
adjacent pages are never accessed. Ultimately, these unused pages
become cached pages through the efforts of the page daemon. However,
the next activation of the executable reactivates and maps these
unused pages. Consequently, they are never replaced. In effect, they
become pinned in memory.
Revision Changes Path
1.228 +3 -3 src/sys/vm/vm_fault.c
1.384 +13 -5 src/sys/vm/vm_map.c
More information about the cvs-src
mailing list