From a28cc55e5b1977b4a8abb5f2a43255ad3e448076 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 29 Dec 2002 07:17:06 +0000 Subject: Reduce the number of times that we acquire and release the page queues lock by making vm_page_rename()'s caller, rather than vm_page_rename(), responsible for acquiring it. --- sys/vm/vm_fault.c | 2 -- sys/vm/vm_object.c | 4 ++-- sys/vm/vm_page.c | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 4d1499a9264b..79d462554621 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -704,7 +704,6 @@ readrest: vm_page_lock_queues(); pmap_remove_all(fs.first_m); vm_page_free(fs.first_m); - vm_page_unlock_queues(); fs.first_m = NULL; /* @@ -714,7 +713,6 @@ readrest: */ vm_page_rename(fs.m, fs.first_object, fs.first_pindex); fs.first_m = fs.m; - vm_page_lock_queues(); vm_page_busy(fs.first_m); vm_page_unlock_queues(); fs.m = NULL; diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index d9cd47fb2026..5ccf4a6baba8 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1245,10 +1245,8 @@ vm_object_split(vm_map_entry_t entry) goto retry; vm_page_busy(m); - vm_page_unlock_queues(); vm_page_rename(m, new_object, idx); /* page automatically made dirty by rename and cache handled */ - vm_page_lock_queues(); vm_page_busy(m); vm_page_unlock_queues(); } @@ -1455,7 +1453,9 @@ vm_object_backing_scan(vm_object_t object, int op) * If the page was mapped to a process, it can remain * mapped through the rename. */ + vm_page_lock_queues(); vm_page_rename(p, object, new_pindex); + vm_page_unlock_queues(); /* page automatically made dirty by rename */ } p = next; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index a1520e28b41d..71d56c580e63 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -682,13 +682,11 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex) int s; s = splvm(); - vm_page_lock_queues(); vm_page_remove(m); vm_page_insert(m, new_object, new_pindex); if (m->queue - m->pc == PQ_CACHE) vm_page_deactivate(m); vm_page_dirty(m); - vm_page_unlock_queues(); splx(s); } -- cgit v1.3