RDS: IB: add mr reused stats
authorsantosh.shilimkar@oracle.com <santosh.shilimkar@oracle.com>
Tue, 1 Mar 2016 23:20:51 +0000 (15:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Mar 2016 19:13:19 +0000 (14:13 -0500)
Add MR reuse statistics to RDS IB transport.

Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/ib.h
net/rds/ib_rdma.c
net/rds/ib_stats.c

index c88cb229db16e3bf56d0940a1e3678127561c5ed..62fe7d5330addaa9bcf64c694e19adde4bfe5ba1 100644 (file)
@@ -259,6 +259,8 @@ struct rds_ib_statistics {
        uint64_t        s_ib_rdma_mr_1m_pool_flush;
        uint64_t        s_ib_rdma_mr_1m_pool_wait;
        uint64_t        s_ib_rdma_mr_1m_pool_depleted;
+       uint64_t        s_ib_rdma_mr_8k_reused;
+       uint64_t        s_ib_rdma_mr_1m_reused;
        uint64_t        s_ib_atomic_cswp;
        uint64_t        s_ib_atomic_fadd;
 };
index 0e848433597f86ea1f24a97910b69de602cf850a..ec7ea32265c0d36caca585efb85591061fa4aff0 100644 (file)
@@ -188,8 +188,13 @@ struct rds_ib_mr *rds_ib_reuse_mr(struct rds_ib_mr_pool *pool)
        flag = this_cpu_ptr(&clean_list_grace);
        set_bit(CLEAN_LIST_BUSY_BIT, flag);
        ret = llist_del_first(&pool->clean_list);
-       if (ret)
+       if (ret) {
                ibmr = llist_entry(ret, struct rds_ib_mr, llnode);
+               if (pool->pool_type == RDS_IB_MR_8K_POOL)
+                       rds_ib_stats_inc(s_ib_rdma_mr_8k_reused);
+               else
+                       rds_ib_stats_inc(s_ib_rdma_mr_1m_reused);
+       }
 
        clear_bit(CLEAN_LIST_BUSY_BIT, flag);
        preempt_enable();
index d77e0447305630d721760542ced368f86a9e15f9..7e78dca1f252c671741443cdf660f38da6c575a0 100644 (file)
@@ -73,6 +73,8 @@ static const char *const rds_ib_stat_names[] = {
        "ib_rdma_mr_1m_pool_flush",
        "ib_rdma_mr_1m_pool_wait",
        "ib_rdma_mr_1m_pool_depleted",
+       "ib_rdma_mr_8k_reused",
+       "ib_rdma_mr_1m_reused",
        "ib_atomic_cswp",
        "ib_atomic_fadd",
 };