summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-02-02 01:11:21 +0000
committeralc <alc@FreeBSD.org>2003-02-02 01:11:21 +0000
commit338e0caf91936dd317393e81241fa793943d52e1 (patch)
treee85dc35294696f093cf8feec0bf8ab5ade28e004 /sys/vm
parent244d4c08446bb60cb8937b8e43ec5010a5ef84d2 (diff)
downloadFreeBSD-src-338e0caf91936dd317393e81241fa793943d52e1.zip
FreeBSD-src-338e0caf91936dd317393e81241fa793943d52e1.tar.gz
- Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index bb92fdd..79cc7ed 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -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);
}
OpenPOWER on IntegriCloud