From 017344be59fbbd4cf6d29d3f5a6581b468dc29c9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 27 Sep 2011 18:01:29 +0530 Subject: libglusterfs/iobuf: have fixed number of arenas * so overall memory usage will be in limit. * the array is hard-coded, need to improve upon this. * need more benchmarking to tune the proper values to the array * fixed the issue of pruning of arenas. Change-Id: I38a8ffab37378c25d78f77a2d412b1b8935c67d3 BUG: 3474 Signed-off-by: Amar Tumballi Reviewed-on: http://review.gluster.com/543 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/iobuf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/iobuf.h') diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h index efceb2d05b9..d0f86828615 100644 --- a/libglusterfs/src/iobuf.h +++ b/libglusterfs/src/iobuf.h @@ -52,6 +52,10 @@ struct iobuf_arena; /* expandable and contractable pool of memory, internally broken into arenas */ struct iobuf_pool; +struct iobuf_init_config { + size_t pagesize; + int32_t num_pages; +}; struct iobuf { union { @@ -83,6 +87,7 @@ struct iobuf_arena { size_t arena_size; /* this is equal to (iobuf_pool->arena_size / page_size) * page_size */ + size_t page_count; struct iobuf_pool *iobuf_pool; @@ -126,7 +131,7 @@ struct iobuf_pool { }; -struct iobuf_pool *iobuf_pool_new (size_t arena_size, size_t page_size); +struct iobuf_pool *iobuf_pool_new (void); void iobuf_pool_destroy (struct iobuf_pool *iobuf_pool); struct iobuf *iobuf_get (struct iobuf_pool *iobuf_pool); void iobuf_unref (struct iobuf *iobuf); -- cgit