diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-01-16 13:11:07 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-01-16 13:11:07 +0000 |
commit | 5131c0036d7d2582fd928abfc656b6d78ed8ee77 (patch) | |
tree | 595e370ffbb6941147bfc4909165ee72a7d5d2e1 /sys/uvm/uvm_pglist.c | |
parent | 9b4a98039e4ac75a8c894e1d66b6d2b78096c3c9 (diff) |
add another uvm histroy for physpage alloc/free and propagate a debugging pgfree check into pglist; no functional change for normal kernels; make histories uncommon
Diffstat (limited to 'sys/uvm/uvm_pglist.c')
-rw-r--r-- | sys/uvm/uvm_pglist.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/uvm/uvm_pglist.c b/sys/uvm/uvm_pglist.c index 82eb440a133..42ad231fb38 100644 --- a/sys/uvm/uvm_pglist.c +++ b/sys/uvm/uvm_pglist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pglist.c,v 1.14 2002/10/07 18:35:52 mickey Exp $ */ +/* $OpenBSD: uvm_pglist.c,v 1.15 2006/01/16 13:11:06 mickey Exp $ */ /* $NetBSD: uvm_pglist.c,v 1.13 2001/02/18 21:19:08 chs Exp $ */ /*- @@ -98,6 +98,7 @@ uvm_pglistalloc(size, low, high, alignment, boundary, rlist, nsegs, waitok) #ifdef DEBUG vm_page_t tp; #endif + UVMHIST_FUNC("uvm_pglistalloc"); UVMHIST_CALLED(pghist); KASSERT((alignment & (alignment - 1)) == 0); KASSERT((boundary & (boundary - 1)) == 0); @@ -255,6 +256,7 @@ uvm_pglistfree(list) { vm_page_t m; int s; + UVMHIST_FUNC("uvm_pglistfree"); UVMHIST_CALLED(pghist); /* * Block all memory allocation and lock the free list. @@ -264,6 +266,16 @@ uvm_pglistfree(list) while ((m = TAILQ_FIRST(list)) != NULL) { KASSERT((m->pqflags & (PQ_ACTIVE|PQ_INACTIVE)) == 0); TAILQ_REMOVE(list, m, pageq); +#ifdef DEBUG + if (m->uobject == (void *)0xdeadbeef && + m->uanon == (void *)0xdeadbeef) { + panic("uvm_pagefree: freeing free page %p", m); + } + + m->uobject = (void *)0xdeadbeef; + m->offset = 0xdeadbeef; + m->uanon = (void *)0xdeadbeef; +#endif m->pqflags = PQ_FREE; TAILQ_INSERT_TAIL(&uvm.page_free[ uvm_page_lookup_freelist(m)].pgfl_queues[PGFL_UNKNOWN], |