]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS: make use of kfree_rcu() and avoid the call_rcu() chain
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 8 Oct 2015 23:26:32 +0000 (16:26 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Tue, 13 Oct 2015 17:08:23 +0000 (10:08 -0700)
call_rcu() chains are expensive and its use in rds_ib_remove_ipaddr()
is just to kfree() the rds_ib_ipaddr. Chains make use of  high-latency
rcu_barrier() in modules which can be avoided.

Makes use of kfree_rcu() which is exactly meant for such use

Orabug: 22010933

Acked-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Acked-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
net/rds/ib_rdma.c

index 751fe3d9ebf022815f977d9974d3c9ead3885a4a..105a4e8a629df4c5a00d8f1e3db338d456612552 100644 (file)
@@ -136,12 +136,6 @@ static int rds_ib_add_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr)
        return 0;
 }
 
-static void ipaddr_free_cb(struct rcu_head *rp)
-{
-       struct rds_ib_ipaddr *ipaddr = container_of(rp, struct rds_ib_ipaddr, rcu_head);
-       kfree(ipaddr);
-}
-
 static void rds_ib_remove_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr)
 {
        struct rds_ib_ipaddr *i_ipaddr;
@@ -159,7 +153,7 @@ static void rds_ib_remove_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr)
        spin_unlock_irq(&rds_ibdev->spinlock);
 
        if (to_free)
-               call_rcu(&to_free->rcu_head, ipaddr_free_cb);
+               kfree_rcu(to_free, rcu_head);
 }
 
 int rds_ib_update_ipaddr(struct rds_ib_device *rds_ibdev, __be32 ipaddr)