Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbcCAXYJ (ORCPT ); Tue, 1 Mar 2016 18:24:09 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:29606 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbcCAXVU (ORCPT ); Tue, 1 Mar 2016 18:21:20 -0500 From: Santosh Shilimkar To: netdev@vger.kernel.org, davem@davemloft.net Cc: linux-kernel@vger.kernel.org, Santosh Shilimkar Subject: [net-next][PATCH v3 10/13] RDS: IB: add mr reused stats Date: Tue, 1 Mar 2016 15:20:51 -0800 Message-Id: <1456874454-10355-11-git-send-email-santosh.shilimkar@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456874454-10355-1-git-send-email-santosh.shilimkar@oracle.com> References: <1456874454-10355-1-git-send-email-santosh.shilimkar@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1737 Lines: 57 Add MR reuse statistics to RDS IB transport. Signed-off-by: Santosh Shilimkar Signed-off-by: Santosh Shilimkar --- net/rds/ib.h | 2 ++ net/rds/ib_rdma.c | 7 ++++++- net/rds/ib_stats.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/net/rds/ib.h b/net/rds/ib.h index c88cb22..62fe7d5 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -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; }; diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 0e84843..ec7ea32 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -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(); diff --git a/net/rds/ib_stats.c b/net/rds/ib_stats.c index d77e044..7e78dca 100644 --- a/net/rds/ib_stats.c +++ b/net/rds/ib_stats.c @@ -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", }; -- 1.9.1