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.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 24af2ec..3ff9e68 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -145,10 +145,9 @@ vmtotal(SYSCTL_HANDLER_ARGS)
/*
* Mark all objects as inactive.
*/
- mtx_lock(&vm_mtx);
+ GIANT_REQUIRED;
TAILQ_FOREACH(object, &vm_object_list, object_list)
vm_object_clear_flag(object, OBJ_ACTIVE);
- mtx_unlock(&vm_mtx);
/*
* Calculate process statistics.
*/
@@ -199,7 +198,6 @@ vmtotal(SYSCTL_HANDLER_ARGS)
* Note active objects.
*/
paging = 0;
- mtx_lock(&vm_mtx);
for (map = &p->p_vmspace->vm_map, entry = map->header.next;
entry != &map->header; entry = entry->next) {
if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) ||
@@ -208,7 +206,6 @@ vmtotal(SYSCTL_HANDLER_ARGS)
vm_object_set_flag(entry->object.vm_object, OBJ_ACTIVE);
paging |= entry->object.vm_object->paging_in_progress;
}
- mtx_unlock(&vm_mtx);
if (paging)
totalp->t_pw++;
}
@@ -216,7 +213,6 @@ vmtotal(SYSCTL_HANDLER_ARGS)
/*
* Calculate object memory usage statistics.
*/
- mtx_lock(&vm_mtx);
TAILQ_FOREACH(object, &vm_object_list, object_list) {
/*
* devices, like /dev/mem, will badly skew our totals
@@ -240,7 +236,6 @@ vmtotal(SYSCTL_HANDLER_ARGS)
}
}
totalp->t_free = cnt.v_free_count + cnt.v_cache_count;
- mtx_unlock(&vm_mtx);
return (sysctl_handle_opaque(oidp, totalp, sizeof total, req));
}
OpenPOWER on IntegriCloud