summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/mem-pool.h
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-08-29 00:17:03 +0200
committerJeff Darcy <jeff@pl.atyp.us>2017-08-29 19:14:04 +0000
commitb3c068ccd9125ffdfb6fbb3d2728f16ff8dda2eb (patch)
tree26a8d50c4d470c9324e934c6e589d7fa2bb8c1fa /libglusterfs/src/mem-pool.h
parent3b5f4de6926780b34570731ad34992a4735dd410 (diff)
mem-pool: count allocations done per user-pool
Count the active allocations per 'struct mem_pool'. These are the objects that the calling component allocated and free'd in the memory pool for this specific type. Having this count in the statedump will make it easy to find memory leaks. Updates: #307 Change-Id: I797fabab86f104e49338c00e449a7d0b0d270004 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: https://review.gluster.org/18074 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'libglusterfs/src/mem-pool.h')
-rw-r--r--libglusterfs/src/mem-pool.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libglusterfs/src/mem-pool.h b/libglusterfs/src/mem-pool.h
index ecf2abe9245..ff5d183b16d 100644
--- a/libglusterfs/src/mem-pool.h
+++ b/libglusterfs/src/mem-pool.h
@@ -209,8 +209,9 @@ out:
struct mem_pool {
/* object size, without pooled_obj_hdr_t */
unsigned long sizeof_type;
- unsigned long count;
+ unsigned long count; /* requested pool size (unused) */
char *name;
+ gf_atomic_t active; /* current allocations */
struct list_head owner; /* glusterfs_ctx_t->mempool_list */
glusterfs_ctx_t *ctx; /* take ctx->lock when updating owner */