diff options
author | alc <alc@FreeBSD.org> | 2006-11-12 21:48:34 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-11-12 21:48:34 +0000 |
commit | 6093953d36a905170046a19eb1141c99b22fa802 (patch) | |
tree | c4a9c71fe86ec1dd8e45421082e59941e177807f /sys/vm | |
parent | 68445c77f7e732fbe9d5f4b930a9f2fcd0052b3f (diff) | |
download | FreeBSD-src-6093953d36a905170046a19eb1141c99b22fa802.zip FreeBSD-src-6093953d36a905170046a19eb1141c99b22fa802.tar.gz |
Make pmap_enter() responsible for setting PG_WRITEABLE instead
of its caller. (As a beneficial side-effect, a high-contention
acquisition of the page queues lock in vm_fault() is eliminated.)
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 9 | ||||
-rw-r--r-- | sys/vm/vm_kern.c | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index d62f3c7..e577199 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -841,9 +841,6 @@ readrest: } } if (prot & VM_PROT_WRITE) { - vm_page_lock_queues(); - vm_page_flag_set(fs.m, PG_WRITEABLE); - vm_page_unlock_queues(); vm_object_set_writeable_dirty(fs.object); /* @@ -1189,14 +1186,12 @@ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry) * Enter it in the pmap... */ pmap_enter(dst_map->pmap, vaddr, dst_m, prot, FALSE); - VM_OBJECT_LOCK(dst_object); - vm_page_lock_queues(); - if ((prot & VM_PROT_WRITE) != 0) - vm_page_flag_set(dst_m, PG_WRITEABLE); /* * Mark it no longer busy, and put it on the active list. */ + VM_OBJECT_LOCK(dst_object); + vm_page_lock_queues(); vm_page_activate(dst_m); vm_page_unlock_queues(); vm_page_wakeup(dst_m); diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index c91dc48..e3a8c12 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -402,7 +402,7 @@ retry: */ pmap_enter(kernel_pmap, addr + i, m, VM_PROT_ALL, 1); vm_page_lock_queues(); - vm_page_flag_set(m, PG_WRITEABLE | PG_REFERENCED); + vm_page_flag_set(m, PG_REFERENCED); vm_page_unlock_queues(); vm_page_wakeup(m); } |