diff options
author | alc <alc@FreeBSD.org> | 2002-07-16 19:39:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-07-16 19:39:40 +0000 |
commit | fe71e4fa203fd8c94989894d621d46100b917194 (patch) | |
tree | 2ddf00ce3db71216c5ccba960959ce18e5bb3e6e /sys/vm | |
parent | 0dbee33a270f3f873ba656d3ddf54d56aa494436 (diff) | |
download | FreeBSD-src-fe71e4fa203fd8c94989894d621d46100b917194.zip FreeBSD-src-fe71e4fa203fd8c94989894d621d46100b917194.tar.gz |
o Use vm_pageq_remove_nowakeup() and vm_pageq_enqueue() in
vm_page_zero_idle() instead of partially duplicated implementations.
In particular, this change guarantees that the number of free pages
in the free queue(s) matches the global free page count when Giant
is released.
Submitted by: peter (via his p4 "pmap" branch)
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_zeroidle.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index fbf5fe4..d852b9b 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -79,19 +79,14 @@ vm_page_zero_idle(void) zero_state = 0; m = vm_pageq_find(PQ_FREE, free_rover, FALSE); if (m != NULL && (m->flags & PG_ZERO) == 0) { - vm_page_queues[m->queue].lcnt--; - TAILQ_REMOVE(&vm_page_queues[m->queue].pl, m, pageq); - m->queue = PQ_NONE; + vm_pageq_remove_nowakeup(m); mtx_unlock_spin(&vm_page_queue_free_mtx); mtx_unlock(&Giant); pmap_zero_page_idle(m); mtx_lock(&Giant); mtx_lock_spin(&vm_page_queue_free_mtx); vm_page_flag_set(m, PG_ZERO); - m->queue = PQ_FREE + m->pc; - vm_page_queues[m->queue].lcnt++; - TAILQ_INSERT_TAIL(&vm_page_queues[m->queue].pl, m, - pageq); + vm_pageq_enqueue(PQ_FREE + m->pc, m); ++vm_page_zero_count; ++cnt_prezero; if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count)) |