summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2003-07-30 15:22:37 +0000
committerbmilekic <bmilekic@FreeBSD.org>2003-07-30 15:22:37 +0000
commit260d19ed7e960b64aba121e93fa68e81f1ffd9b5 (patch)
tree87166b804b17750eaa649b45d5a56c448a6f4e21
parent0d4bdece5959fd4db7d5e7acddb36a15dc963ea7 (diff)
downloadFreeBSD-src-260d19ed7e960b64aba121e93fa68e81f1ffd9b5.zip
FreeBSD-src-260d19ed7e960b64aba121e93fa68e81f1ffd9b5.tar.gz
When generating the zone stats make sure to handle the master zone
("UMA Zone") carefully, because it does not have pcpu caches allocated at all. In the UP case, we did not catch this because one pcpu cache is always allocated with the zone, but for the MP case, we were getting bogus stats for this zone. Tested by: Lukas Ertl <le@univie.ac.at>
-rw-r--r--sys/vm/uma_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 1a585a7..fd15954 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2119,6 +2119,13 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS)
cachefree += cache->uc_freebucket->ub_ptr + 1;
CPU_UNLOCK(cpu);
}
+ /*
+ * The "UMA Zones" zone (master zone) does not have pcpu
+ * caches allocated for it, so the above computation is entirely
+ * bogus. Re-set cachefree to 0 in that case.
+ */
+ if (z == zones)
+ cachefree = 0;
LIST_FOREACH(bucket, &z->uz_full_bucket, ub_link) {
cachefree += bucket->ub_ptr + 1;
}
OpenPOWER on IntegriCloud