fill out vmtotals: t_free, t_vm, t_avm, t_rm and t_arm. leaves shared of same, and t_pw.

This commit is contained in:
mrg 1998-02-08 22:23:33 +00:00
parent b000238f6e
commit 7ff12d37cc

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_meter.c,v 1.4 1998/02/07 12:45:53 mrg Exp $ */ /* $NetBSD: uvm_meter.c,v 1.5 1998/02/08 22:23:33 mrg Exp $ */
/* /*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE! * XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -209,19 +209,19 @@ uvm_total(totalp)
*/ */
#if 0 #if 0
/* /*
* XXXCDC: BOGUS! you can't walk a map entry chain without * XXXCDC: BOGUS! rethink this. in the mean time
* first locking the map. rethink this. in the mean time * don't do it.
* just don't do it.
*/ */
paging = 0; paging = 0;
vm_map_lock(map);
for (map = &p->p_vmspace->vm_map, entry = map->header.next; for (map = &p->p_vmspace->vm_map, entry = map->header.next;
entry != &map->header; entry = entry->next) { entry != &map->header; entry = entry->next) {
if (entry->is_a_map || entry->is_sub_map || if (entry->is_a_map || entry->is_sub_map ||
entry->object.vm_object == NULL) entry->object.uvm_obj == NULL)
continue; continue;
entry->object.vm_object->flags |= OBJ_ACTIVE; /* XXX how to do this with uvm */
paging |= vm_object_paging(entry->object.vm_object);
} }
vm_map_unlock(map);
if (paging) if (paging)
totalp->t_pw++; totalp->t_pw++;
#endif #endif
@ -229,27 +229,13 @@ uvm_total(totalp)
/* /*
* Calculate object memory usage statistics. * Calculate object memory usage statistics.
*/ */
#if 0 /* XXXCDC: rethink! rethink! */ totalp->t_free = uvmexp.free;
simple_lock(&vm_object_list_lock); totalp->t_vm = uvmexp.npages - uvmexp.free + uvmexp.swpginuse;
for (object = vm_object_list.tqh_first; totalp->t_avm = uvmexp.active + uvmexp.swpginuse; /* XXX */
object != NULL; totalp->t_rm = uvmexp.npages - uvmexp.free;
object = object->object_list.tqe_next) { totalp->t_arm = uvmexp.active;
totalp->t_vm += num_pages(object->size); totalp->t_vmshr = 0; /* XXX */
totalp->t_rm += object->resident_page_count; totalp->t_avmshr = 0; /* XXX */
if (object->flags & OBJ_ACTIVE) { totalp->t_rmshr = 0; /* XXX */
totalp->t_avm += num_pages(object->size); totalp->t_armshr = 0; /* XXX */
totalp->t_arm += object->resident_page_count;
}
if (object->ref_count > 1) {
/* shared object */
totalp->t_vmshr += num_pages(object->size);
totalp->t_rmshr += object->resident_page_count;
if (object->flags & OBJ_ACTIVE) {
totalp->t_avmshr += num_pages(object->size);
totalp->t_armshr += object->resident_page_count;
}
}
}
totalp->t_free = cnt.v_free_count;
#endif
} }