diff options
author | alc <alc@FreeBSD.org> | 2009-06-21 00:21:33 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2009-06-21 00:21:33 +0000 |
commit | 7b05ffed76747ad78e9d871322b18ca60e6b8693 (patch) | |
tree | 74b0d998b0bb25128f0f355d5229959a3c7ac2f6 /sys/vm/vm_page.c | |
parent | da6735320825654d2417fed4a078082641fa4cdf (diff) | |
download | FreeBSD-src-7b05ffed76747ad78e9d871322b18ca60e6b8693.zip FreeBSD-src-7b05ffed76747ad78e9d871322b18ca60e6b8693.tar.gz |
Strive for greater consistency among the places that implement real,
fictious, and contiguous page allocation. Eliminate unnecessary
reinitialization of a page's fields.
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 370aea0..7148fdc 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1108,10 +1108,13 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) * At this point we had better have found a good page. */ - KASSERT( - m != NULL, - ("vm_page_alloc(): missing page on free queue") - ); + KASSERT(m != NULL, ("vm_page_alloc: missing page")); + KASSERT(m->queue == PQ_NONE, ("vm_page_alloc: page %p has unexpected queue %d", + m, m->queue)); + KASSERT(m->wire_count == 0, ("vm_page_alloc: page %p is wired", m)); + KASSERT(m->hold_count == 0, ("vm_page_alloc: page %p is held", m)); + KASSERT(m->busy == 0, ("vm_page_alloc: page %p is busy", m)); + KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); if ((m->flags & PG_CACHED) != 0) { KASSERT(m->valid != 0, ("vm_page_alloc: cached page %p is invalid", m)); @@ -1150,12 +1153,8 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) if (req & VM_ALLOC_WIRED) { atomic_add_int(&cnt.v_wire_count, 1); m->wire_count = 1; - } else - m->wire_count = 0; - m->hold_count = 0; + } m->act_count = 0; - m->busy = 0; - KASSERT(m->dirty == 0, ("vm_page_alloc: free/cache page %p was dirty", m)); mtx_unlock(&vm_page_queue_free_mtx); if ((req & VM_ALLOC_NOOBJ) == 0) |