summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lockf.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-03-19 06:19:01 +0000
committerjeff <jeff@FreeBSD.org>2008-03-19 06:19:01 +0000
commit46f09d5bc3f6480ce5db48b9d76f3e83299f588c (patch)
tree720fece23c8482c35e341e275a0f4068ee43126f /sys/kern/kern_lockf.c
parentf8600f40e7fcf241985d8a978c63889de0969bfb (diff)
downloadFreeBSD-src-46f09d5bc3f6480ce5db48b9d76f3e83299f588c.zip
FreeBSD-src-46f09d5bc3f6480ce5db48b9d76f3e83299f588c.tar.gz
- Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from
requiring the per-process spinlock to only requiring the process lock. - Reflect these changes in the proc.h documentation and consumers throughout the kernel. This is a substantial reduction in locking cost for these fields and was made possible by recent changes to threading support.
Diffstat (limited to 'sys/kern/kern_lockf.c')
-rw-r--r--sys/kern/kern_lockf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index 51fbc30..6cce5aa 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -283,7 +283,7 @@ lf_setlock(lock, vp, clean)
wproc = (struct proc *)block->lf_id;
restart:
nproc = NULL;
- PROC_SLOCK(wproc);
+ PROC_LOCK(wproc);
FOREACH_THREAD_IN_PROC(wproc, td) {
thread_lock(td);
while (td->td_wchan &&
@@ -296,8 +296,8 @@ restart:
break;
nproc = (struct proc *)waitblock->lf_id;
if (nproc == (struct proc *)lock->lf_id) {
- PROC_SUNLOCK(wproc);
thread_unlock(td);
+ PROC_UNLOCK(wproc);
lock->lf_next = *clean;
*clean = lock;
return (EDEADLK);
@@ -305,7 +305,7 @@ restart:
}
thread_unlock(td);
}
- PROC_SUNLOCK(wproc);
+ PROC_UNLOCK(wproc);
wproc = nproc;
if (wproc)
goto restart;
OpenPOWER on IntegriCloud