From: Santosh Shilimkar Date: Mon, 21 Mar 2016 10:49:30 +0000 (-0700) Subject: RDS: IB: use i_frag_sz for cache stat updates X-Git-Tag: v4.1.12-92~175^2~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f9d44a29e334866a858faf81a1132ef4176f7b04;p=users%2Fjedix%2Flinux-maple.git RDS: IB: use i_frag_sz for cache stat updates Updates the receive cache statistics based on ic->i_frag_sz Orabug: 21894138 Signed-off-by: Santosh Shilimkar --- diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index f3f634e88135e..aed1ecf701348 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c @@ -208,8 +208,8 @@ static void rds_ib_frag_free(struct rds_ib_connection *ic, rdsdebug("frag %p page %p\n", frag, sg_page(&frag->f_sg)); rds_ib_recv_cache_put(&frag->f_cache_entry, &ic->i_cache_frags); - atomic_add(PAGE_SIZE/1024, &ic->i_cache_allocs); - rds_ib_stats_add(s_ib_recv_added_to_cache, PAGE_SIZE); + atomic_add(ic->i_frag_sz/1024, &ic->i_cache_allocs); + rds_ib_stats_add(s_ib_recv_added_to_cache, ic->i_frag_sz); } /* Recycle inc after freeing attached frags */ @@ -287,8 +287,8 @@ static struct rds_page_frag *rds_ib_refill_one_frag(struct rds_ib_connection *ic cache_item = rds_ib_recv_cache_get(&ic->i_cache_frags); if (cache_item) { frag = container_of(cache_item, struct rds_page_frag, f_cache_entry); - atomic_sub(PAGE_SIZE/1024, &ic->i_cache_allocs); - rds_ib_stats_add(s_ib_recv_removed_from_cache, PAGE_SIZE); + atomic_sub(ic->i_frag_sz/1024, &ic->i_cache_allocs); + rds_ib_stats_add(s_ib_recv_removed_from_cache, ic->i_frag_sz); } else { frag = kmem_cache_alloc(rds_ib_frag_slab, slab_mask); if (!frag)