From a3f6b0c4f231ccdb727227c9c35816b4823cef90 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 23 Feb 2012 12:53:19 +0530 Subject: mempool: add more counters to understand the usage scenarios properly current design of mempool is to fallback to standard calloc/free if all the buffers in pool are exhausted. Understanding more about those numbers will help us to tune mempool parameters properly over time. Change-Id: I2c94373186f7c6a486caff2611c2d9df2c37db3c Signed-off-by: Amar Tumballi BUG: 797730 Reviewed-on: http://review.gluster.com/2804 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Vijay Bellur --- libglusterfs/src/mem-pool.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libglusterfs/src/mem-pool.c') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 2662dc70a..0cfd8bd71 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -451,6 +451,10 @@ mem_get (struct mem_pool *mem_pool) * because it is too much work knowing that a better slab * allocator is coming RSN. */ + mem_pool->pool_misses++; + mem_pool->curr_stdalloc++; + if (mem_pool->max_stdalloc < mem_pool->curr_stdalloc) + mem_pool->max_stdalloc = mem_pool->curr_stdalloc; ptr = GF_CALLOC (1, mem_pool->padded_sizeof_type, gf_common_mt_mem_pool); gf_log_callingfn ("mem-pool", GF_LOG_DEBUG, "Mem pool is full. " @@ -553,6 +557,7 @@ mem_put (void *ptr) * not have enough info to distinguish between the two * situations. */ + pool->curr_stdalloc--; GF_FREE (list); break; default: -- cgit