diff options
author | jeff <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
commit | 46f09d5bc3f6480ce5db48b9d76f3e83299f588c (patch) | |
tree | 720fece23c8482c35e341e275a0f4068ee43126f /sys/kern/tty.c | |
parent | f8600f40e7fcf241985d8a978c63889de0969bfb (diff) | |
download | FreeBSD-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/tty.c')
-rw-r--r-- | sys/kern/tty.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 932f87a..076a35c 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -2581,7 +2581,7 @@ ttyinfo(struct tty *tp) if (proc_compare(pick, p)) pick = p; - PROC_SLOCK(pick); + PROC_LOCK(pick); picktd = NULL; td = FIRST_THREAD_IN_PROC(pick); FOREACH_THREAD_IN_PROC(pick, td) @@ -2615,7 +2615,7 @@ ttyinfo(struct tty *tp) rss = 0; else rss = pgtok(vmspace_resident_count(pick->p_vmspace)); - PROC_SUNLOCK(pick); + PROC_UNLOCK(pick); PROC_LOCK(pick); PGRP_UNLOCK(tp->t_pgrp); rufetchcalc(pick, &ru, &utime, &stime); @@ -2744,12 +2744,12 @@ proc_compare(struct proc *p1, struct proc *p2) * Fetch various stats about these processes. After we drop the * lock the information could be stale but the race is unimportant. */ - PROC_SLOCK(p1); + PROC_LOCK(p1); runa = proc_sum(p1, &esta); - PROC_SUNLOCK(p1); - PROC_SLOCK(p2); + PROC_UNLOCK(p1); + PROC_LOCK(p2); runb = proc_sum(p2, &estb); - PROC_SUNLOCK(p2); + PROC_UNLOCK(p2); /* * see if at least one of them is runnable |