summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2013-12-29 04:54:52 +0000
committeralc <alc@FreeBSD.org>2013-12-29 04:54:52 +0000
commit4e0447c7bbe15b914ab6eeab2962a7414bb11ced (patch)
tree33ad53b66601d050762329ca9ae936fc342aa081 /sys/vm
parent6ab680bb65a144b9f95b93ecb6acc9e1ae617204 (diff)
downloadFreeBSD-src-4e0447c7bbe15b914ab6eeab2962a7414bb11ced.zip
FreeBSD-src-4e0447c7bbe15b914ab6eeab2962a7414bb11ced.tar.gz
Add "popmap" assertions: The page being freed isn't already free, and the
page being allocated isn't already allocated. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_reserv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index 8b3c2ae..663390e 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -241,6 +241,9 @@ vm_reserv_depopulate(vm_reserv_t rv, int index)
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
KASSERT(rv->object != NULL,
("vm_reserv_depopulate: reserv %p is free", rv));
+ KASSERT(isset(rv->popmap, index),
+ ("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv,
+ index));
KASSERT(rv->popcnt > 0,
("vm_reserv_depopulate: reserv %p's popcnt is corrupted", rv));
if (rv->inpartpopq) {
@@ -294,6 +297,9 @@ vm_reserv_populate(vm_reserv_t rv, int index)
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
KASSERT(rv->object != NULL,
("vm_reserv_populate: reserv %p is free", rv));
+ KASSERT(isclr(rv->popmap, index),
+ ("vm_reserv_populate: reserv %p's popmap[%d] is set", rv,
+ index));
KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES,
("vm_reserv_populate: reserv %p is already full", rv));
if (rv->inpartpopq) {
OpenPOWER on IntegriCloud