summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-06-28 20:07:54 +0000
committeralc <alc@FreeBSD.org>2003-06-28 20:07:54 +0000
commitdf16822d6955771600be7a6c284af3cb96a1971c (patch)
tree759d8446e9478bb2836a909edcc61fad4eb7022d
parentabc3ed480d1ab26837d03ab2d84967f33cc7d421 (diff)
downloadFreeBSD-src-df16822d6955771600be7a6c284af3cb96a1971c.zip
FreeBSD-src-df16822d6955771600be7a6c284af3cb96a1971c.tar.gz
- Add vm object locking to vm_pageout_clean().
-rw-r--r--sys/vm/vm_pageout.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 5c4fa22..4cacef1 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -229,14 +229,12 @@ vm_pageout_clean(m)
{
vm_object_t object;
vm_page_t mc[2*vm_pageout_page_count];
- int pageout_count;
+ int numpagedout, pageout_count;
int ib, is, page_base;
vm_pindex_t pindex = m->pindex;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
- object = m->object;
-
/*
* It doesn't cost us anything to pageout OBJT_DEFAULT or OBJT_SWAP
* with the new swapper, but we could have serious problems paging
@@ -250,7 +248,8 @@ vm_pageout_clean(m)
* Don't mess with the page if it's busy, held, or special
*/
if ((m->hold_count != 0) ||
- ((m->busy != 0) || (m->flags & (PG_BUSY|PG_UNMANAGED)))) {
+ ((m->busy != 0) || (m->flags & (PG_BUSY|PG_UNMANAGED))) ||
+ !VM_OBJECT_TRYLOCK(m->object)) {
return 0;
}
@@ -279,6 +278,7 @@ vm_pageout_clean(m)
* first and attempt to align our cluster, then do a
* forward scan if room remains.
*/
+ object = m->object;
more:
while (ib && pageout_count < vm_pageout_page_count) {
vm_page_t p;
@@ -349,7 +349,9 @@ more:
/*
* we allow reads during pageouts...
*/
- return vm_pageout_flush(&mc[page_base], pageout_count, 0, FALSE);
+ numpagedout = vm_pageout_flush(&mc[page_base], pageout_count, 0, TRUE);
+ VM_OBJECT_UNLOCK(object);
+ return (numpagedout);
}
/*
OpenPOWER on IntegriCloud