- Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock.

This commit is contained in:
Alan Cox 2003-02-02 01:11:21 +00:00
parent b9e873d4a0
commit 8e1d8de578
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110218

View File

@ -1432,6 +1432,7 @@ vm_pageout()
*/
while (TRUE) {
s = splvm();
vm_page_lock_queues();
/*
* If we have enough free memory, wakeup waiters. Do
* not clear vm_pages_needed until we reach our target,
@ -1451,7 +1452,7 @@ vm_pageout()
*/
++pass;
if (pass > 1)
tsleep(&vm_pages_needed, PVM,
msleep(&vm_pages_needed, &vm_page_queue_mtx, PVM,
"psleep", hz/2);
} else {
/*
@ -1462,9 +1463,10 @@ vm_pageout()
pass = 1;
else
pass = 0;
error = tsleep(&vm_pages_needed, PVM,
error = msleep(&vm_pages_needed, &vm_page_queue_mtx, PVM,
"psleep", vm_pageout_stats_interval * hz);
if (error && !vm_pages_needed) {
vm_page_unlock_queues();
splx(s);
pass = 0;
vm_pageout_page_stats();
@ -1473,6 +1475,7 @@ vm_pageout()
}
if (vm_pages_needed)
cnt.v_pdwakeups++;
vm_page_unlock_queues();
splx(s);
vm_pageout_scan(pass);
}