summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-02-01 21:18:16 +0000
committeralc <alc@FreeBSD.org>2003-02-01 21:18:16 +0000
commitcbb6b35209ec887be35ea7f2feeb1b2aa1f715b4 (patch)
treef31bcd63dc8d11e75dfce59cf467443274a8b977 /sys/vm
parent8ab3ae08b099a4c3c159719b5f6ad0c7c7adb9de (diff)
downloadFreeBSD-src-cbb6b35209ec887be35ea7f2feeb1b2aa1f715b4.zip
FreeBSD-src-cbb6b35209ec887be35ea7f2feeb1b2aa1f715b4.tar.gz
- Convert the tsleep()s in vm_wait() and vm_waitpfault() to msleep()s
with the page queue lock. - Assert that the page queue lock is held in vm_page_free_wakeup().
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 74ba2e7..356d252 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -896,15 +896,18 @@ vm_wait(void)
int s;
s = splvm();
+ vm_page_lock_queues();
if (curproc == pageproc) {
vm_pageout_pages_needed = 1;
- tsleep(&vm_pageout_pages_needed, PSWP, "VMWait", 0);
+ msleep(&vm_pageout_pages_needed, &vm_page_queue_mtx,
+ PDROP | PSWP, "VMWait", 0);
} else {
if (!vm_pages_needed) {
vm_pages_needed = 1;
wakeup(&vm_pages_needed);
}
- tsleep(&cnt.v_free_count, PVM, "vmwait", 0);
+ msleep(&cnt.v_free_count, &vm_page_queue_mtx, PDROP | PVM,
+ "vmwait", 0);
}
splx(s);
}
@@ -925,11 +928,13 @@ vm_waitpfault(void)
int s;
s = splvm();
+ vm_page_lock_queues();
if (!vm_pages_needed) {
vm_pages_needed = 1;
wakeup(&vm_pages_needed);
}
- tsleep(&cnt.v_free_count, PUSER, "pfault", 0);
+ msleep(&cnt.v_free_count, &vm_page_queue_mtx, PDROP | PUSER,
+ "pfault", 0);
splx(s);
}
@@ -979,6 +984,8 @@ vm_page_activate(vm_page_t m)
static __inline void
vm_page_free_wakeup(void)
{
+
+ mtx_assert(&vm_page_queue_mtx, MA_OWNED);
/*
* if pageout daemon needs pages, then tell it that there are
* some free.
OpenPOWER on IntegriCloud