freebsd-dev/sys/i386
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
..
acpica This is a follow-up, cleaning-up commit about recent changes involving 2007-09-11 22:54:09 +00:00
bios Apply the same sort of locking done in 2007-11-14 05:43:55 +00:00
compile
conf Link wpi(4) into the build. 2007-11-08 22:09:37 +00:00
cpufreq Use bus_dma to get a page in the first 4 GB. Since the physical address 2007-06-17 07:18:23 +00:00
i386 Prevent the leakage of wired pages in the following circumstances: 2007-11-17 22:52:29 +00:00
ibcs2 Fix for the panic("vm_thread_new: kstack allocation failed") and 2007-11-05 11:36:16 +00:00
include Drastically simplify the i386 pcpu backend by merging parts of the 2007-11-13 23:00:24 +00:00
isa Split /dev/nvram driver out of isa/clock.c for i386 and amd64. I have not 2007-10-26 03:23:54 +00:00
linux Fix for the panic("vm_thread_new: kstack allocation failed") and 2007-11-05 11:36:16 +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
svr4 Use svr4_si_{addr,code,errno,signo,trap} in preference to si_{...}. 2005-10-19 14:59:54 +00:00
xbox - Define data of struct gfb_font a const as it's only used to supply font 2007-06-16 21:31:53 +00:00
Makefile Update entries for building tags. 2007-05-13 18:21:54 +00:00