summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2013-06-04 02:28:47 +0000
committeralc <alc@FreeBSD.org>2013-06-04 02:28:47 +0000
commit7aa1cb1ddb92843494e5c528fd6817ae74f977e4 (patch)
tree466bf73eb379a67916cd5b16667cde72da216d8a /sys/vm
parent9b1423fbd7854234abdee1d12241dd2bc432620f (diff)
downloadFreeBSD-src-7aa1cb1ddb92843494e5c528fd6817ae74f977e4.zip
FreeBSD-src-7aa1cb1ddb92843494e5c528fd6817ae74f977e4.tar.gz
Relax the object locking in vm_pageout_map_deactivate_pages() and
vm_pageout_object_deactivate_pages(). A read lock suffices. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 39343487..6d6e626 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -714,13 +714,13 @@ vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object,
vm_page_t p;
int actcount, remove_mode;
- VM_OBJECT_ASSERT_WLOCKED(first_object);
+ VM_OBJECT_ASSERT_LOCKED(first_object);
if ((first_object->flags & OBJ_FICTITIOUS) != 0)
return;
for (object = first_object;; object = backing_object) {
if (pmap_resident_count(pmap) <= desired)
goto unlock_return;
- VM_OBJECT_ASSERT_WLOCKED(object);
+ VM_OBJECT_ASSERT_LOCKED(object);
if ((object->flags & OBJ_UNMANAGED) != 0 ||
object->paging_in_progress != 0)
goto unlock_return;
@@ -776,13 +776,13 @@ vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object,
}
if ((backing_object = object->backing_object) == NULL)
goto unlock_return;
- VM_OBJECT_WLOCK(backing_object);
+ VM_OBJECT_RLOCK(backing_object);
if (object != first_object)
- VM_OBJECT_WUNLOCK(object);
+ VM_OBJECT_RUNLOCK(object);
}
unlock_return:
if (object != first_object)
- VM_OBJECT_WUNLOCK(object);
+ VM_OBJECT_RUNLOCK(object);
}
/*
@@ -812,15 +812,15 @@ vm_pageout_map_deactivate_pages(map, desired)
while (tmpe != &map->header) {
if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) {
obj = tmpe->object.vm_object;
- if (obj != NULL && VM_OBJECT_TRYWLOCK(obj)) {
+ if (obj != NULL && VM_OBJECT_TRYRLOCK(obj)) {
if (obj->shadow_count <= 1 &&
(bigobj == NULL ||
bigobj->resident_page_count < obj->resident_page_count)) {
if (bigobj != NULL)
- VM_OBJECT_WUNLOCK(bigobj);
+ VM_OBJECT_RUNLOCK(bigobj);
bigobj = obj;
} else
- VM_OBJECT_WUNLOCK(obj);
+ VM_OBJECT_RUNLOCK(obj);
}
}
if (tmpe->wired_count > 0)
@@ -830,7 +830,7 @@ vm_pageout_map_deactivate_pages(map, desired)
if (bigobj != NULL) {
vm_pageout_object_deactivate_pages(map->pmap, bigobj, desired);
- VM_OBJECT_WUNLOCK(bigobj);
+ VM_OBJECT_RUNLOCK(bigobj);
}
/*
* Next, hunt around for other pages to deactivate. We actually
@@ -843,9 +843,9 @@ vm_pageout_map_deactivate_pages(map, desired)
if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) {
obj = tmpe->object.vm_object;
if (obj != NULL) {
- VM_OBJECT_WLOCK(obj);
+ VM_OBJECT_RLOCK(obj);
vm_pageout_object_deactivate_pages(map->pmap, obj, desired);
- VM_OBJECT_WUNLOCK(obj);
+ VM_OBJECT_RUNLOCK(obj);
}
}
tmpe = tmpe->next;
OpenPOWER on IntegriCloud