summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-07-15 18:00:43 +0000
committeralc <alc@FreeBSD.org>2004-07-15 18:00:43 +0000
commit123cfa6b6464882431662931da12282fdae27c31 (patch)
tree69cdf9b62bb15fd8fb4fcd13d7dc53217029e5ad /sys/vm/vm_map.c
parentc9b72f6bbfe07882de4c1ff97b23d8419bb01672 (diff)
downloadFreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.zip
FreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.tar.gz
Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove(). In general, they require the lock in order to modify a page's pv list or flags. In some cases, however, pmap_protect() can avoid acquiring the lock.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 55726f5..ba07796 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -1391,14 +1391,12 @@ 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);
@@ -2007,9 +2005,7 @@ vm_map_sync(
if (invalidate) {
mtx_lock(&Giant);
- vm_page_lock_queues();
pmap_remove(map->pmap, start, end);
- vm_page_unlock_queues();
mtx_unlock(&Giant);
}
/*
@@ -2182,9 +2178,7 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end)
if (!map->system_map)
mtx_lock(&Giant);
- vm_page_lock_queues();
pmap_remove(map->pmap, entry->start, entry->end);
- vm_page_unlock_queues();
if (!map->system_map)
mtx_unlock(&Giant);
@@ -2295,12 +2289,10 @@ 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();
}
/*
OpenPOWER on IntegriCloud