summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_meter.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_meter.c')
-rw-r--r--sys/vm/vm_meter.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index d4b51e7..4d70155 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -131,17 +131,21 @@ vmtotal(SYSCTL_HANDLER_ARGS)
FOREACH_PROC_IN_SYSTEM(p) {
if (p->p_flag & P_SYSTEM)
continue;
- mtx_lock_spin(&sched_lock);
+ PROC_SLOCK(p);
switch (p->p_state) {
case PRS_NEW:
- mtx_unlock_spin(&sched_lock);
+ PROC_SUNLOCK(p);
continue;
break;
default:
FOREACH_THREAD_IN_PROC(p, td) {
/* Need new statistics XXX */
+ thread_lock(td);
switch (td->td_state) {
case TDS_INHIBITED:
+ /*
+ * XXX stats no longer synchronized.
+ */
if (TD_ON_LOCK(td) ||
(td->td_inhibitors ==
TDI_SWAPPED)) {
@@ -162,13 +166,15 @@ vmtotal(SYSCTL_HANDLER_ARGS)
case TDS_RUNQ:
case TDS_RUNNING:
total.t_rq++;
+ thread_unlock(td);
continue;
default:
break;
}
+ thread_unlock(td);
}
}
- mtx_unlock_spin(&sched_lock);
+ PROC_SUNLOCK(p);
/*
* Note active objects.
*/
OpenPOWER on IntegriCloud