[PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE5304d

4 messages, 3 authors, 2012-02-02 · open the first message on its own page

[PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()

From: Paul E. McKenney <hidden>
Date: 2012-02-01 19:54:38

From: "Paul E. McKenney" <redacted>

The call_rcu() in do_ip_setsockopt() invokes opt_kfree_rcu(), which just
calls kfree().  So convert the call_rcu() to kfree_rcu(), which allows
opt_kfree_rcu() to be eliminated.

Signed-off-by: Paul E. McKenney <redacted>
Signed-off-by: Paul E. McKenney <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <redacted>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <redacted>
Cc: Patrick McHardy <redacted>
Cc: netdev@vger.kernel.org
---
 net/ipv4/ip_sockglue.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 8aa87c1..5343d9a 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -445,11 +445,6 @@ out:
 }
 
 
-static void opt_kfree_rcu(struct rcu_head *head)
-{
-	kfree(container_of(head, struct ip_options_rcu, rcu));
-}
-
 /*
  *	Socket option code for IP. This is the end of the line after any
  *	TCP,UDP etc options on an IP socket.
@@ -525,7 +520,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
 		}
 		rcu_assign_pointer(inet->inet_opt, opt);
 		if (old)
-			call_rcu(&old->rcu, opt_kfree_rcu);
+			kfree_rcu(old, rcu);
 		break;
 	}
 	case IP_PKTINFO:
-- 
1.7.8

Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()

From: David Miller <davem@davemloft.net>
Date: 2012-02-01 19:55:55

From: "Paul E. McKenney" <redacted>
Date: Wed,  1 Feb 2012 11:41:28 -0800
From: "Paul E. McKenney" <redacted>

The call_rcu() in do_ip_setsockopt() invokes opt_kfree_rcu(), which just
calls kfree().  So convert the call_rcu() to kfree_rcu(), which allows
opt_kfree_rcu() to be eliminated.

Signed-off-by: Paul E. McKenney <redacted>
Signed-off-by: Paul E. McKenney <redacted>
Acked-by: David S. Miller <davem@davemloft.net>

Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()

From: Josh Triplett <josh@joshtriplett.org>
Date: 2012-02-02 00:24:27

On Wed, Feb 01, 2012 at 11:41:28AM -0800, Paul E. McKenney wrote:
From: "Paul E. McKenney" <redacted>

The call_rcu() in do_ip_setsockopt() invokes opt_kfree_rcu(), which just
calls kfree().  So convert the call_rcu() to kfree_rcu(), which allows
opt_kfree_rcu() to be eliminated.
This and patch 9/41 have exactly the same subject line.  Consider
adding the name of the function you replaced to each one, to
disambiguate them.

- Josh Triplett

Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()

From: Paul E. McKenney <hidden>
Date: 2012-02-02 15:56:46

On Wed, Feb 01, 2012 at 04:24:03PM -0800, Josh Triplett wrote:
On Wed, Feb 01, 2012 at 11:41:28AM -0800, Paul E. McKenney wrote:
quoted
From: "Paul E. McKenney" <redacted>

The call_rcu() in do_ip_setsockopt() invokes opt_kfree_rcu(), which just
calls kfree().  So convert the call_rcu() to kfree_rcu(), which allows
opt_kfree_rcu() to be eliminated.
This and patch 9/41 have exactly the same subject line.  Consider
adding the name of the function you replaced to each one, to
disambiguate them.
Good point, will also add function names to the other three kfree_rcu()
patches.

							Thanx, Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help