1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Minimize the scope of the page queues lock in vm_fault().

This commit is contained in:
Alan Cox 2010-05-08 21:35:51 +00:00
parent 3c4a24406b
commit 34e7251f10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207798
2 changed files with 3 additions and 5 deletions

View File

@ -306,7 +306,6 @@ RetryFault:;
* which is not what we want.
*/
vm_page_lock(fs.m);
vm_page_lock_queues();
if ((fs.m->cow) &&
(fault_type & VM_PROT_WRITE) &&
(fs.object == fs.first_object)) {
@ -337,6 +336,7 @@ RetryFault:;
* sleeping so that the page daemon is less
* likely to reclaim it.
*/
vm_page_lock_queues();
vm_page_flag_set(fs.m, PG_REFERENCED);
vm_page_unlock_queues();
vm_page_unlock(fs.m);
@ -363,6 +363,7 @@ RetryFault:;
vm_object_deallocate(fs.first_object);
goto RetryFault;
}
vm_page_lock_queues();
vm_pageq_remove(fs.m);
vm_page_unlock_queues();
vm_page_unlock(fs.m);

View File

@ -2233,6 +2233,7 @@ vm_page_cowfault(vm_page_t m)
vm_object_t object;
vm_pindex_t pindex;
mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED);
vm_page_lock_assert(m, MA_OWNED);
object = m->object;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
@ -2243,7 +2244,6 @@ vm_page_cowfault(vm_page_t m)
retry_alloc:
pmap_remove_all(m);
vm_page_unlock_queues();
vm_page_remove(m);
mnew = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY);
if (mnew == NULL) {
@ -2254,7 +2254,6 @@ vm_page_cowfault(vm_page_t m)
VM_OBJECT_LOCK(object);
if (m == vm_page_lookup(object, pindex)) {
vm_page_lock(m);
vm_page_lock_queues();
goto retry_alloc;
} else {
/*
@ -2272,9 +2271,7 @@ vm_page_cowfault(vm_page_t m)
*/
vm_page_unlock(m);
vm_page_lock(mnew);
vm_page_lock_queues();
vm_page_free(mnew);
vm_page_unlock_queues();
vm_page_unlock(mnew);
vm_page_insert(m, object, pindex);
} else { /* clear COW & copy page */