Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDS: IB: add few useful cache stasts

Tracks the ib receive cache total, incoming and frag allocations.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

+15
+7
net/rds/ib.h
··· 151 151 u64 i_ack_recv; /* last ACK received */ 152 152 struct rds_ib_refill_cache i_cache_incs; 153 153 struct rds_ib_refill_cache i_cache_frags; 154 + atomic_t i_cache_allocs; 154 155 155 156 /* sending acks */ 156 157 unsigned long i_ack_flags; ··· 255 254 uint64_t s_ib_rx_refill_from_cq; 256 255 uint64_t s_ib_rx_refill_from_thread; 257 256 uint64_t s_ib_rx_alloc_limit; 257 + uint64_t s_ib_rx_total_frags; 258 + uint64_t s_ib_rx_total_incs; 258 259 uint64_t s_ib_rx_credit_updates; 259 260 uint64_t s_ib_ack_sent; 260 261 uint64_t s_ib_ack_send_failure; ··· 279 276 uint64_t s_ib_rdma_mr_1m_reused; 280 277 uint64_t s_ib_atomic_cswp; 281 278 uint64_t s_ib_atomic_fadd; 279 + uint64_t s_ib_recv_added_to_cache; 280 + uint64_t s_ib_recv_removed_from_cache; 282 281 }; 283 282 284 283 extern struct workqueue_struct *rds_ib_wq; ··· 411 406 /* ib_stats.c */ 412 407 DECLARE_PER_CPU(struct rds_ib_statistics, rds_ib_stats); 413 408 #define rds_ib_stats_inc(member) rds_stats_inc_which(rds_ib_stats, member) 409 + #define rds_ib_stats_add(member, count) \ 410 + rds_stats_add_which(rds_ib_stats, member, count) 414 411 unsigned int rds_ib_stats_info_copy(struct rds_info_iterator *iter, 415 412 unsigned int avail); 416 413
+6
net/rds/ib_recv.c
··· 194 194 rdsdebug("frag %p page %p\n", frag, sg_page(&frag->f_sg)); 195 195 196 196 rds_ib_recv_cache_put(&frag->f_cache_entry, &ic->i_cache_frags); 197 + atomic_add(RDS_FRAG_SIZE / SZ_1K, &ic->i_cache_allocs); 198 + rds_ib_stats_add(s_ib_recv_added_to_cache, RDS_FRAG_SIZE); 197 199 } 198 200 199 201 /* Recycle inc after freeing attached frags */ ··· 263 261 atomic_dec(&rds_ib_allocation); 264 262 return NULL; 265 263 } 264 + rds_ib_stats_inc(s_ib_rx_total_incs); 266 265 } 267 266 INIT_LIST_HEAD(&ibinc->ii_frags); 268 267 rds_inc_init(&ibinc->ii_inc, ic->conn, ic->conn->c_faddr); ··· 281 278 cache_item = rds_ib_recv_cache_get(&ic->i_cache_frags); 282 279 if (cache_item) { 283 280 frag = container_of(cache_item, struct rds_page_frag, f_cache_entry); 281 + atomic_sub(RDS_FRAG_SIZE / SZ_1K, &ic->i_cache_allocs); 282 + rds_ib_stats_add(s_ib_recv_added_to_cache, RDS_FRAG_SIZE); 284 283 } else { 285 284 frag = kmem_cache_alloc(rds_ib_frag_slab, slab_mask); 286 285 if (!frag) ··· 295 290 kmem_cache_free(rds_ib_frag_slab, frag); 296 291 return NULL; 297 292 } 293 + rds_ib_stats_inc(s_ib_rx_total_frags); 298 294 } 299 295 300 296 INIT_LIST_HEAD(&frag->f_item);
+2
net/rds/ib_stats.c
··· 55 55 "ib_rx_refill_from_cq", 56 56 "ib_rx_refill_from_thread", 57 57 "ib_rx_alloc_limit", 58 + "ib_rx_total_frags", 59 + "ib_rx_total_incs", 58 60 "ib_rx_credit_updates", 59 61 "ib_ack_sent", 60 62 "ib_ack_send_failure",