diff options
-rw-r--r-- | sys/kern/kern_mbuf.c | 10 | ||||
-rw-r--r-- | sys/kern/uipc_mbuf2.c | 3 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 10 |
3 files changed, 18 insertions, 5 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index b6b75c1..1ea6274 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -135,13 +135,15 @@ mbuf_init(void *dummy) /* * Configure UMA zones for Mbufs, Clusters, and Packets. */ - zone_mbuf = uma_zcreate("Mbuf", MSIZE, mb_ctor_mbuf, mb_dtor_mbuf, + zone_mbuf = uma_zcreate(MBUF_MEM_NAME, MSIZE, mb_ctor_mbuf, + mb_dtor_mbuf, #ifdef INVARIANTS trash_init, trash_fini, MSIZE - 1, UMA_ZONE_MAXBUCKET); #else NULL, NULL, MSIZE - 1, UMA_ZONE_MAXBUCKET); #endif - zone_clust = uma_zcreate("MbufClust", MCLBYTES, mb_ctor_clust, + zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, + mb_ctor_clust, #ifdef INVARIANTS mb_dtor_clust, trash_init, trash_fini, UMA_ALIGN_PTR, UMA_ZONE_REFCNT); #else @@ -149,8 +151,8 @@ mbuf_init(void *dummy) #endif if (nmbclusters > 0) uma_zone_set_max(zone_clust, nmbclusters); - zone_pack = uma_zsecond_create("Packet", mb_ctor_pack, mb_dtor_pack, - mb_init_pack, mb_fini_pack, zone_mbuf); + zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, + mb_dtor_pack, mb_init_pack, mb_fini_pack, zone_mbuf); /* uma_prealloc() goes here */ diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 81b2260..109b3a6 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -76,7 +76,8 @@ __FBSDID("$FreeBSD$"); #include <sys/mbuf.h> #include <sys/mutex.h> -static MALLOC_DEFINE(M_PACKET_TAGS, "mbuf tags", "packet-attached information"); +static MALLOC_DEFINE(M_PACKET_TAGS, MBUF_TAG_MEM_NAME, + "packet-attached information"); /* can't call it m_dup(), as freebsd[34] uses m_dup() with different arg */ static struct mbuf *m_dup1(struct mbuf *, int, int, int); diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index c514e0f..9fb385c 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -287,6 +287,16 @@ struct mbstat { #define M_TRYWAIT M_WAITOK #define M_WAIT M_WAITOK +/* + * String names of mbuf-related UMA(9) and malloc(9) types. Exposed to + * !_KERNEL so that monitoring tools can look up the zones with + * libmemstat(3). + */ +#define MBUF_MEM_NAME "mbuf" +#define MBUF_CLUSTER_MEM_NAME "mbuf_cluster" +#define MBUF_PACKET_MEM_NAME "mbuf_packet" +#define MBUF_TAG_MEM_NAME "mbuf_tag" + #ifdef _KERNEL /*- * mbuf external reference count management macros. |