summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-05-23 10:28:11 +0000
committeralfred <alfred@FreeBSD.org>2001-05-23 10:28:11 +0000
commit587340efa6952ac0891086616d3167544dcba882 (patch)
tree7ddaacaf6345c242c24bc4191510a47079bfbbd9 /sys/vm
parentba66967415c99b346103066694a58b55e7b75cc8 (diff)
downloadFreeBSD-src-587340efa6952ac0891086616d3167544dcba882.zip
FreeBSD-src-587340efa6952ac0891086616d3167544dcba882.tar.gz
aquire Giant when playing with the buffercache and doing IO.
use msleep against the vm mutex while waiting for a page IO to complete.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 3f9f758..911d5e6 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1175,9 +1175,12 @@ swap_pager_getpages(object, m, count, reqpage)
*
* NOTE: b_blkno is destroyed by the call to VOP_STRATEGY
*/
-
+ mtx_unlock(&vm_mtx);
+ mtx_lock(&Giant);
BUF_KERNPROC(bp);
BUF_STRATEGY(bp);
+ mtx_unlock(&Giant);
+ mtx_lock(&vm_mtx);
/*
* wait for the page we want to complete. PG_SWAPINPROG is always
@@ -1190,7 +1193,7 @@ swap_pager_getpages(object, m, count, reqpage)
while ((mreq->flags & PG_SWAPINPROG) != 0) {
vm_page_flag_set(mreq, PG_WANTED | PG_REFERENCED);
cnt.v_intrans++;
- if (tsleep(mreq, PSWP, "swread", hz*20)) {
+ if (msleep(mreq, &vm_mtx, PSWP, "swread", hz*20)) {
printf(
"swap_pager: indefinite wait buffer: device:"
" %s, blkno: %ld, size: %ld\n",
OpenPOWER on IntegriCloud