summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_meter.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/vm/vm_meter.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/vm/vm_meter.c')
-rw-r--r--sys/vm/vm_meter.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index d71eabf..c644631 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -130,13 +130,16 @@ vmtotal(SYSCTL_HANDLER_ARGS)
FOREACH_PROC_IN_SYSTEM(p) {
if (p->p_flag & P_SYSTEM)
continue;
+ PROC_LOCK(p);
PROC_SLOCK(p);
switch (p->p_state) {
case PRS_NEW:
PROC_SUNLOCK(p);
+ PROC_UNLOCK(p);
continue;
break;
default:
+ PROC_SUNLOCK(p);
FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
switch (td->td_state) {
@@ -164,7 +167,7 @@ vmtotal(SYSCTL_HANDLER_ARGS)
thread_unlock(td);
}
}
- PROC_SUNLOCK(p);
+ PROC_UNLOCK(p);
/*
* Note active objects.
*/
OpenPOWER on IntegriCloud