diff options
author | alc <alc@FreeBSD.org> | 2002-07-27 23:20:32 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-07-27 23:20:32 +0000 |
commit | d048dca979c1bebecefd36c13beb6bd29228dd53 (patch) | |
tree | 2be7447d17bab22996e719cdd2a90f87f82d95a6 /sys/vm/vm_pageout.c | |
parent | b12dee0079f63017c916948344386fa0e0ad5676 (diff) | |
download | FreeBSD-src-d048dca979c1bebecefd36c13beb6bd29228dd53.zip FreeBSD-src-d048dca979c1bebecefd36c13beb6bd29228dd53.tar.gz |
o Require that the page queues lock is held on entry to vm_pageout_clean()
and vm_pageout_flush().
o Acquire the page queues lock before calling vm_pageout_clean()
or vm_pageout_flush().
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 7b0510a..b9938c7 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -229,7 +229,7 @@ vm_pageout_clean(m) int ib, is, page_base; vm_pindex_t pindex = m->pindex; - GIANT_REQUIRED; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); object = m->object; @@ -368,7 +368,7 @@ vm_pageout_flush(mc, count, flags) int numpagedout = 0; int i; - GIANT_REQUIRED; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); /* * Initiate I/O. Bump the vm_page_t->busy counter and * mark the pages read-only. @@ -384,8 +384,8 @@ vm_pageout_flush(mc, count, flags) vm_page_io_start(mc[i]); vm_page_protect(mc[i], VM_PROT_READ); } - object = mc[0]->object; + vm_page_unlock_queues(); vm_object_pip_add(object, count); vm_pager_put_pages(object, mc, count, @@ -438,7 +438,6 @@ vm_pageout_flush(mc, count, flags) vm_page_protect(mt, VM_PROT_READ); } } - vm_page_unlock_queues(); return numpagedout; } @@ -938,6 +937,7 @@ rescan0: * the (future) cleaned page. Otherwise we could wind * up laundering or cleaning too many pages. */ + vm_page_lock_queues(); s = splvm(); TAILQ_INSERT_AFTER(&vm_page_queues[PQ_INACTIVE].pl, m, &marker, pageq); splx(s); @@ -949,6 +949,7 @@ rescan0: next = TAILQ_NEXT(&marker, pageq); TAILQ_REMOVE(&vm_page_queues[PQ_INACTIVE].pl, &marker, pageq); splx(s); + vm_page_unlock_queues(); if (vp) { vput(vp); vn_finished_write(mp); |