Plug the accounting leak for the wired pages when msync(MS_INVALIDATE)

is performed on the vnode mapping which is wired in other address space.

While there, explicitely assert that the page is unwired and zero the
wire_count instead of substract. The condition is rechecked later in
vm_page_free(_toq) already.

Reported and tested by:	zont
Reviewed by:	alc (previous version)
MFC after:	1 week
This commit is contained in:
kib 2012-09-20 09:52:57 +00:00
parent 5d109d3a5f
commit 667e5e154a

View File

@ -1918,8 +1918,13 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
if ((options & OBJPR_NOTMAPPED) == 0) {
pmap_remove_all(p);
/* Account for removal of wired mappings. */
if (wirings != 0)
p->wire_count -= wirings;
if (wirings != 0) {
KASSERT(p->wire_count == wirings,
("inconsistent wire count %d %d %p",
p->wire_count, wirings, p));
p->wire_count = 0;
atomic_subtract_int(&cnt.v_wire_count, 1);
}
}
vm_page_free(p);
vm_page_unlock(p);