diff options
author | Alan Cox <alc@FreeBSD.org> | 2002-08-04 07:07:34 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2002-08-04 07:07:34 +0000 |
commit | 7f0bf36a2e109bd071105a672536f1ccfd9db953 (patch) | |
tree | cd6bd7fff086d2a89ed0721bb3afd0125418352d /sys/vm | |
parent | 4453ada654e3a3eda00b3b506617d046d24da932 (diff) | |
download | src-7f0bf36a2e109bd071105a672536f1ccfd9db953.tar.gz src-7f0bf36a2e109bd071105a672536f1ccfd9db953.zip |
o Extend the scope of the page queues lock in contigmalloc1().
o Replace vm_page_sleep_busy() with vm_page_sleep_if_busy()
in vm_contig_launder().
Notes
Notes:
svn path=/head/; revision=101304
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_contig.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 53c2c131d3d8..3ed502117f87 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -94,30 +94,29 @@ vm_contig_launder(int queue) next = TAILQ_NEXT(m, pageq); KASSERT(m->queue == queue, ("vm_contig_launder: page %p's queue is not %d", m, queue)); - if (vm_page_sleep_busy(m, TRUE, "vpctw0")) + if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) { + vm_page_lock_queues(); return (TRUE); + } vm_page_test_dirty(m); if (m->dirty) { object = m->object; if (object->type == OBJT_VNODE) { + vm_page_unlock_queues(); vn_lock(object->handle, LK_EXCLUSIVE | LK_RETRY, curthread); vm_object_page_clean(object, 0, 0, OBJPC_SYNC); VOP_UNLOCK(object->handle, 0, curthread); + vm_page_lock_queues(); return (TRUE); } 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) { - vm_page_lock_queues(); + } else if (m->busy == 0 && m->hold_count == 0) vm_page_cache(m); - vm_page_unlock_queues(); - } } return (FALSE); } @@ -155,6 +154,7 @@ contigmalloc1( start = 0; for (pass = 0; pass <= 1; pass++) { s = splvm(); + vm_page_lock_queues(); again: /* * Find first page in array that is free, within range, aligned, and @@ -181,6 +181,7 @@ again1: goto again1; if (vm_contig_launder(PQ_ACTIVE)) goto again1; + vm_page_unlock_queues(); splx(s); continue; } @@ -199,7 +200,6 @@ again1: goto again; } } - vm_page_lock_queues(); for (i = start; i < (start + size / PAGE_SIZE); i++) { vm_page_t m = &pga[i]; |