summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-03-10 19:59:07 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-12 05:32:06 -0700
commit58776c0800ab146b1dd9a8461a98ca719afff6ef (patch)
tree25a773f8a6fb0c73b638a79e1b481de227c08ad0
parent08cc17a5528d0194bdb835e05e3950d5516274c3 (diff)
iobuf: add a counter to keep track of request misses
requests can be denied if the size of the request is higher than the available sizes. Change-Id: Id1bf2a56de799ccb94f3791899f2e33f68cd1e2b Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 802047 Reviewed-on: http://review.gluster.com/2913 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--libglusterfs/src/iobuf.c3
-rw-r--r--libglusterfs/src/iobuf.h20
2 files changed, 11 insertions, 12 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c
index 93bc773..e1cf334 100644
--- a/libglusterfs/src/iobuf.c
+++ b/libglusterfs/src/iobuf.c
@@ -524,6 +524,7 @@ iobuf_get2 (struct iobuf_pool *iobuf_pool, size_t page_size)
gf_log ("iobuf", GF_LOG_ERROR, "page_size (%zu) of "
"iobufs in arena being requested is greater than max "
"available", page_size);
+ iobuf_pool->request_misses++;
return NULL;
}
@@ -967,6 +968,8 @@ iobuf_stats_dump (struct iobuf_pool *iobuf_pool)
iobuf_pool->arena_size);
gf_proc_dump_write("iobuf_pool.arena_cnt", "%d",
iobuf_pool->arena_cnt);
+ gf_proc_dump_write("iobuf_pool.request_misses", "%"PRId64,
+ iobuf_pool->request_misses);
for (j = 0; j < IOBUF_ARENA_MAX_INDEX; j++) {
list_for_each_entry (trav, &iobuf_pool->arenas[j], list) {
diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h
index d0f8682..46a54db 100644
--- a/libglusterfs/src/iobuf.h
+++ b/libglusterfs/src/iobuf.h
@@ -113,21 +113,17 @@ struct iobuf_pool {
int arena_cnt;
struct list_head arenas[GF_VARIABLE_IOBUF_COUNT];
- /* array of arenas. Each element of
- the array is a list of arenas
- holding iobufs of particular
- page_size
- */
+ /* array of arenas. Each element of the array is a list of arenas
+ holding iobufs of particular page_size */
+
struct list_head filled[GF_VARIABLE_IOBUF_COUNT];
- /*
- array of arenas without free iobufs
- */
+ /* array of arenas without free iobufs */
struct list_head purge[GF_VARIABLE_IOBUF_COUNT];
- /*
- array of of arenas which can be
- purged
- */
+ /* array of of arenas which can be purged */
+
+ uint64_t request_misses; /* mostly the requests for higher
+ value of iobufs */
};