1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

aquire Giant when playing with the buffercache and doing IO.

use msleep against the vm mutex while waiting for a page IO to complete.
This commit is contained in:
Alfred Perlstein 2001-05-23 10:28:11 +00:00
parent 53240603ee
commit c5e62505ad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77036

View File

@ -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",