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)
This commit is contained in:
parent
dde0429505
commit
072e9cbb50
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user