freebsd-skq/sys/vm
Alan Cox 59677d3c0e Prevent the leakage of wired pages in the following circumstances:
First, a file is mmap(2)ed and then mlock(2)ed.  Later, it is truncated.
Under "normal" circumstances, i.e., when the file is not mlock(2)ed, the
pages beyond the EOF are unmapped and freed.  However, when the file is
mlock(2)ed, the pages beyond the EOF are unmapped but not freed because
they have a non-zero wire count.  This can be a mistake.  Specifically,
it is a mistake if the sole reason why the pages are wired is because of
wired, managed mappings.  Previously, unmapping the pages destroys these
wired, managed mappings, but does not reduce the pages' wire count.
Consequently, when the file is unmapped, the pages are not unwired
because the wired mapping has been destroyed.  Moreover, when the vm
object is finally destroyed, the pages are leaked because they are still
wired.  The fix is to reduce the pages' wired count by the number of
wired, managed mappings destroyed.  To do this, I introduce a new pmap
function pmap_page_wired_mappings() that returns the number of managed
mappings to the given physical page that are wired, and I use this
function in vm_object_page_remove().

Reviewed by: tegge
MFC after: 6 weeks
2007-11-17 22:52:29 +00:00
..
default_pager.c
device_pager.c Remove comment that is no longer quite true. 2007-08-18 16:41:31 +00:00
memguard.c Improve memguard a bit: 2005-12-30 11:45:07 +00:00
memguard.h Improve memguard a bit: 2005-12-30 11:45:07 +00:00
phys_pager.c Correct a copy and paste'o in phys_pager.c, we are talking about phys here 2007-10-30 14:48:13 +00:00
pmap.h Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
redzone.c Add buffer corruption protection (RedZone) for kernel's malloc(9). 2006-01-31 11:09:21 +00:00
redzone.h Add buffer corruption protection (RedZone) for kernel's malloc(9). 2006-01-31 11:09:21 +00:00
swap_pager.c o Fix panic message: it's swap_pager_putpages() not swap_pager_getpages(). 2007-11-02 20:48:10 +00:00
swap_pager.h - Move 'struct swdevt' back into swap_pager.h and expose it to userland. 2007-02-07 17:43:11 +00:00
uma_core.c Allow recursion on the 'zones' internal UMA zone. 2007-10-11 20:11:27 +00:00
uma_dbg.c Improve canonicalization of copyrights. Order copyrights by order of 2005-07-16 09:51:52 +00:00
uma_dbg.h Improve canonicalization of copyrights. Order copyrights by order of 2005-07-16 09:51:52 +00:00
uma_int.h Update stale comment on protecting UMA per-CPU caches: we now use 2007-05-09 22:53:34 +00:00
uma.h Add uma_set_align() interface, which will be called at most once during 2007-02-11 20:13:52 +00:00
vm_contig.c Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_extern.h Fix for the panic("vm_thread_new: kstack allocation failed") and 2007-11-05 11:36:16 +00:00
vm_fault.c Do not dereference NULL pointer. 2007-10-08 20:09:53 +00:00
vm_glue.c Fix for the panic("vm_thread_new: kstack allocation failed") and 2007-11-05 11:36:16 +00:00
vm_init.c Add the vm.exec_map_entries tunable and read-only sysctl, which controls 2005-04-25 19:22:05 +00:00
vm_kern.c Change unused 'user_wait' argument to 'timo' argument, which will be 2007-11-07 21:56:58 +00:00
vm_kern.h The clean_map has been made local to vm_init.c long ago. 2006-11-20 16:23:34 +00:00
vm_map.c Change unused 'user_wait' argument to 'timo' argument, which will be 2007-11-07 21:56:58 +00:00
vm_map.h Change unused 'user_wait' argument to 'timo' argument, which will be 2007-11-07 21:56:58 +00:00
vm_meter.c Add a counter for the total number of pages cached and support for 2007-07-27 20:01:22 +00:00
vm_mmap.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
vm_object.c Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
vm_object.h Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_page.c The intent of the freeing the (zeroed) page in vm_page_cache() for 2007-11-05 10:25:12 +00:00
vm_page.h Correct an error of omission in the reimplementation of the page 2007-09-27 04:21:59 +00:00
vm_pageout.c Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_pageout.h
vm_pageq.c Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_pager.c Consider a scenario in which one processor, call it Pt, is performing 2007-08-05 21:04:32 +00:00
vm_pager.h Update some comments to reflect the change from spl-based to lock-based 2005-05-18 22:08:52 +00:00
vm_param.h Fix CTL_VM_NAMES. 2007-10-16 11:32:57 +00:00
vm_phys.c Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_phys.h Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
vm_unix.c
vm_zeroidle.c Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
vm.h Retire debug.mpsafevm. None of the architectures supported in CVS require 2006-07-21 23:22:49 +00:00
vnode_pager.c Correct an error of omission in the reimplementation of the page 2007-10-22 06:23:46 +00:00
vnode_pager.h