Relax the vm object locking in mac_proc_vm_revoke_recurse(). A read lock

suffices in one place.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Alan Cox 2013-06-04 17:23:09 +00:00
parent 291a501e40
commit a42159f0ee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251391

View File

@ -284,14 +284,14 @@ mac_proc_vm_revoke_recurse(struct thread *td, struct ucred *cred,
object = vme->object.vm_object;
if (object == NULL)
continue;
VM_OBJECT_WLOCK(object);
VM_OBJECT_RLOCK(object);
while ((backing_object = object->backing_object) != NULL) {
VM_OBJECT_WLOCK(backing_object);
VM_OBJECT_RLOCK(backing_object);
offset += object->backing_object_offset;
VM_OBJECT_WUNLOCK(object);
VM_OBJECT_RUNLOCK(object);
object = backing_object;
}
VM_OBJECT_WUNLOCK(object);
VM_OBJECT_RUNLOCK(object);
/*
* At the moment, vm_maps and objects aren't considered by
* the MAC system, so only things with backing by a normal