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 | |
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().
-rw-r--r-- | sys/vm/vm_contig.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 3 | ||||
-rw-r--r-- | sys/vm/vm_pageout.c | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 14c4dc2..53c2c13 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -108,7 +108,9 @@ vm_contig_launder(int queue) } else if (object->type == OBJT_SWAP || object->type == OBJT_DEFAULT) { m_tmp = m; + vm_page_lock_queues(); vm_pageout_flush(&m_tmp, 1, 0); + vm_page_unlock_queues(); return (TRUE); } } else if (m->busy == 0 && m->hold_count == 0) { diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 20c6d75..25c53ec 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -850,7 +850,7 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, return(0); } } - + vm_page_lock_queues(); maxf = 0; for(i = 1; i < vm_pageout_page_count; i++) { vm_page_t tp; @@ -934,6 +934,7 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, maxf = i - maxb - 1; } } + vm_page_unlock_queues(); return(maxf + 1); } 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); |