summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-25 00:47:32 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-25 00:47:32 +0000
commit1d80a8864a1d70a05dfec703cae6be7028dcb5be (patch)
treec12814826a813ff0fbf927c82cc67afe71f14553
parent971448c5bb1546e138ace8f824ee6f347601cd3b (diff)
downloadFreeBSD-src-1d80a8864a1d70a05dfec703cae6be7028dcb5be.zip
FreeBSD-src-1d80a8864a1d70a05dfec703cae6be7028dcb5be.tar.gz
Rename UMA_MAX_NAME to UTH_MAX_NAME, since it's a maximum in the
monitoring API, which might or might not be the same as the internal maximum (currently none). Export flag information on UMA zones -- in particular, whether or not this is a secondary zone, and so the keg free count should be considered in that light. MFC after: 1 day
-rw-r--r--sys/vm/uma.h8
-rw-r--r--sys/vm/uma_core.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h
index ab7a613..52bbe2c 100644
--- a/sys/vm/uma.h
+++ b/sys/vm/uma.h
@@ -522,12 +522,13 @@ struct uma_stream_header {
u_int32_t _ush_pad; /* Pad/reserved field. */
};
-#define UMA_MAX_NAME 32
+#define UTH_MAX_NAME 32
+#define UTH_ZONE_SECONDARY 0x00000001
struct uma_type_header {
/*
* Static per-zone data, some extracted from the supporting keg.
*/
- char uth_name[UMA_MAX_NAME];
+ char uth_name[UTH_MAX_NAME];
u_int32_t uth_align; /* Keg: alignment. */
u_int32_t uth_size; /* Keg: requested size of item. */
u_int32_t uth_rsize; /* Keg: real size of item. */
@@ -541,12 +542,11 @@ struct uma_type_header {
u_int32_t uth_keg_free; /* Keg: items free. */
u_int32_t uth_zone_free; /* Zone: items free. */
u_int32_t uth_bucketsize; /* Zone: desired bucket size. */
- u_int32_t _uth_reserved0; /* Reserved. */
+ u_int32_t uth_zone_flags; /* Zone: flags. */
u_int64_t uth_allocs; /* Zone: number of allocations. */
u_int64_t uth_frees; /* Zone: number of frees. */
u_int64_t uth_fails; /* Zone: number of alloc failures. */
u_int64_t _uth_reserved1[3]; /* Reserved. */
-
};
struct uma_percpu_stat {
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 2ae8dc7..50541d0 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2980,7 +2980,7 @@ restart:
LIST_FOREACH(z, &kz->uk_zones, uz_link) {
bzero(&uth, sizeof(uth));
ZONE_LOCK(z);
- strlcpy(uth.uth_name, z->uz_name, UMA_MAX_NAME);
+ strlcpy(uth.uth_name, z->uz_name, UTH_MAX_NAME);
uth.uth_align = kz->uk_align;
uth.uth_pages = kz->uk_pages;
uth.uth_keg_free = kz->uk_free;
@@ -2993,6 +2993,15 @@ restart:
else
uth.uth_limit = kz->uk_maxpages *
kz->uk_ipers;
+
+ /*
+ * A zone is secondary is it is not the first entry
+ * on the keg's zone list.
+ */
+ if ((kz->uk_flags & UMA_ZONE_SECONDARY) &&
+ (LIST_FIRST(&kz->uk_zones) != z))
+ uth.uth_zone_flags = UTH_ZONE_SECONDARY;
+
LIST_FOREACH(bucket, &z->uz_full_bucket, ub_link)
uth.uth_zone_free += bucket->ub_cnt;
uth.uth_allocs = z->uz_allocs;
OpenPOWER on IntegriCloud