Skip to content

Commit

Permalink
RDS: IB: add mr reused stats
Browse files Browse the repository at this point in the history
Add MR reuse statistics to RDS IB transport.

Signed-off-by: Santosh Shilimkar <[email protected]>
Signed-off-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SantoshShilimkar authored and davem330 committed Mar 2, 2016
1 parent 37ea401 commit db42753
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions net/rds/ib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
7 changes: 6 additions & 1 deletion net/rds/ib_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions net/rds/ib_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
Expand Down

0 comments on commit db42753

Please sign in to comment.