diff options
author | alc <alc@FreeBSD.org> | 2003-07-01 07:33:41 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-07-01 07:33:41 +0000 |
commit | 7db05daaf96ec9df87ea27e193f72f6157da39dd (patch) | |
tree | 2c259ebaf6b23bcd85ade4f364399eab9a3f3905 /sys | |
parent | decdc946efac72df268a984b7ad12aa3450c0c2c (diff) | |
download | FreeBSD-src-7db05daaf96ec9df87ea27e193f72f6157da39dd.zip FreeBSD-src-7db05daaf96ec9df87ea27e193f72f6157da39dd.tar.gz |
Modify vm_page_alloc() and vm_page_select_cache() to allow the page that
is returned by vm_page_select_cache() to belong to the object that is
already locked by the caller to vm_page_alloc().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_page.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 0df20b5..767fbbf 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -720,7 +720,8 @@ vm_page_select_cache(int color) m = vm_pageq_find(PQ_CACHE, color, FALSE); if (m && ((m->flags & (PG_BUSY|PG_UNMANAGED)) || m->busy || m->hold_count || m->wire_count || - !VM_OBJECT_TRYLOCK(m->object))) { + (!VM_OBJECT_TRYLOCK(m->object) && + !VM_OBJECT_LOCKED(m->object)))) { vm_page_deactivate(m); continue; } @@ -810,7 +811,8 @@ loop: pmap_remove_all(m); vm_page_free(m); vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(m_object); + if (m_object != object) + VM_OBJECT_UNLOCK(m_object); goto loop; } else { /* |