freebsd-dev/sys/powerpc/aim
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
..
clock.c Split decr_init() into two, with the section that reads the timebase 2007-11-13 15:47:55 +00:00
copyinout.c Fix remaining compile error. 2006-10-18 19:56:20 +00:00
interrupt.c Revamp the interrupt handling in support of INTR_FILTER. This includes: 2007-08-11 19:25:32 +00:00
locore.S Copy SPRG0-3 registers at boot-time and restore when calling into 2005-10-30 21:29:59 +00:00
machdep.c Split decr_init() into two, with the section that reads the timebase 2007-11-13 15:47:55 +00:00
mmu_oea.c Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
nexus.c Revamp the interrupt handling in support of INTR_FILTER. This includes: 2007-08-11 19:25:32 +00:00
ofw_machdep.c Implement OF_decode_addr(). This makes uart(4) work as a serial 2006-12-13 06:11:22 +00:00
ofwmagic.S Instead of "OpenFirmware", "openfirmware", etc. use the official spelling 2004-08-16 15:45:27 +00:00
swtch.S Cut over to ULE on PowerPC 2007-10-23 00:52:25 +00:00
trap_subr.S Mark the return address of the call to ast() in the generic trap 2005-12-23 13:05:27 +00:00
trap.c A bunch more files that should probably print out a thread name 2007-11-14 06:51:33 +00:00
uio_machdep.c Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
uma_machdep.c It has been observed on the mailing lists that the different categories 2007-09-15 18:47:02 +00:00
vm_machdep.c o Rename cpu_thread_setup() to cpu_thread_alloc() to better 2007-11-14 20:21:54 +00:00