diff options
author | alc <alc@FreeBSD.org> | 2002-11-25 22:00:31 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-11-25 22:00:31 +0000 |
commit | 4021cd01fc331ad79922c3656b98af25412ff258 (patch) | |
tree | be3bd53283b4d8efdd0e82da33b556f836a7b237 | |
parent | c20cb5537b9b688691591f908c662dc156433398 (diff) | |
download | FreeBSD-src-4021cd01fc331ad79922c3656b98af25412ff258.zip FreeBSD-src-4021cd01fc331ad79922c3656b98af25412ff258.tar.gz |
Acquire and release the page queues lock around calls to pmap_protect()
because it updates flags within the vm page.
Approved by: re (blanket)
-rw-r--r-- | sys/vm/vm_map.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8d15263..84e12c6 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1284,12 +1284,14 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, */ if (current->protection != old_prot) { mtx_lock(&Giant); + vm_page_lock_queues(); #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, current->end, current->protection & MASK(current)); #undef MASK + vm_page_unlock_queues(); mtx_unlock(&Giant); } vm_map_simplify_entry(map, current); @@ -2197,10 +2199,12 @@ vm_map_copy_entry( * write-protected. */ if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + vm_page_lock_queues(); pmap_protect(src_map->pmap, src_entry->start, src_entry->end, src_entry->protection & ~VM_PROT_WRITE); + vm_page_unlock_queues(); } /* |