diff options
author | kib <kib@FreeBSD.org> | 2012-09-20 09:52:57 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-09-20 09:52:57 +0000 |
commit | 667e5e154a42142e56f1a735aac66254452a0fcc (patch) | |
tree | 27b92b534345cc1a1f3d25de5762a1a34282e56f /sys/vm/vm_object.c | |
parent | 5d109d3a5f131ec5f6f862413b3b4afce3ab8d3a (diff) | |
download | FreeBSD-src-667e5e154a42142e56f1a735aac66254452a0fcc.zip FreeBSD-src-667e5e154a42142e56f1a735aac66254452a0fcc.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 7ff561d..8157649 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1918,8 +1918,13 @@ again: 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); |