diff options
author | attilio <attilio@FreeBSD.org> | 2013-04-08 19:58:32 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-04-08 19:58:32 +0000 |
commit | d67371dab632a5e4198509966ecf2519692abdc4 (patch) | |
tree | 06443a0f20db662770032ad1130d2295811c82ce /sys/kern/sys_process.c | |
parent | 2a0fbb38ed223899ff5d9aaa8c88b3894a38ed5e (diff) | |
download | FreeBSD-src-d67371dab632a5e4198509966ecf2519692abdc4.zip FreeBSD-src-d67371dab632a5e4198509966ecf2519692abdc4.tar.gz |
Switch some "low-hanging fruit" to acquire read lock on vmobjects
rather than write locks.
Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 7dc43c4..5508dcf 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -382,7 +382,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) obj = entry->object.vm_object; if (obj != NULL) - VM_OBJECT_WLOCK(obj); + VM_OBJECT_RLOCK(obj); } while (0); vm_map_unlock_read(map); @@ -395,9 +395,9 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) lobj = obj; for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { if (tobj != obj) - VM_OBJECT_WLOCK(tobj); + VM_OBJECT_RLOCK(tobj); if (lobj != obj) - VM_OBJECT_WUNLOCK(lobj); + VM_OBJECT_RUNLOCK(lobj); lobj = tobj; pve->pve_offset += tobj->backing_object_offset; } @@ -405,8 +405,8 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) if (vp != NULL) vref(vp); if (lobj != obj) - VM_OBJECT_WUNLOCK(lobj); - VM_OBJECT_WUNLOCK(obj); + VM_OBJECT_RUNLOCK(lobj); + VM_OBJECT_RUNLOCK(obj); if (vp != NULL) { freepath = NULL; |