freebsd-skq/sys/sparc64
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
..
central
compile
conf Use the correct expanded name for SCTP. 2007-09-26 20:05:07 +00:00
ebus
fhc o Revamp the sparc64 interrupt code in order to be able to interface 2007-09-06 19:16:30 +00:00
include Change the management of cached pages (PQ_CACHE) in two fundamental 2007-09-25 06:25:06 +00:00
isa - Make failure to route a ISA interrupt non fatal. Apparently the 2007-10-28 22:08:37 +00:00
pci Make the PCI code aware of PCI domains (aka PCI segments) so we can 2007-09-30 11:05:18 +00:00
sbus o Revamp the sparc64 interrupt code in order to be able to interface 2007-09-06 19:16:30 +00:00
sparc64 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00