From 8e1d8de578b383b15bc5a4f89cfed9a4f6c481b2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 2 Feb 2003 01:11:21 +0000 Subject: [PATCH] - Convert vm_pageout()'s tsleep()s to msleep()s with the page queue lock. --- sys/vm/vm_pageout.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index bb92fdd6f5d1..79cc7ed239e4 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); }