* [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu()
[not found] ` <1328125319-5205-1-git-send-email-paulmck@linux.vnet.ibm.com>
@ 2012-02-01 19:41 ` Paul E. McKenney
2012-02-01 19:49 ` David Miller
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 10/41] " Paul E. McKenney
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 11/41] mac80211: " Paul E. McKenney
2 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2012-02-01 19:41 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet, darren,
fweisbec, patches, Paul E. McKenney, Paul E. McKenney,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
From: "Paul E. McKenney" <paul.mckenney@linaro.org>
Because opt_kfree_rcu() just calls kfree(), all call_rcu() uses of it
may be converted to kfree_rcu(). This permits opt_kfree_rcu() to
be eliminated.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
---
net/ipv4/cipso_ipv4.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 86f3b88..c48adc5 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1857,11 +1857,6 @@ static int cipso_v4_genopt(unsigned char *buf, u32 buf_len,
return CIPSO_V4_HDR_LEN + ret_val;
}
-static void opt_kfree_rcu(struct rcu_head *head)
-{
- kfree(container_of(head, struct ip_options_rcu, rcu));
-}
-
/**
* cipso_v4_sock_setattr - Add a CIPSO option to a socket
* @sk: the socket
@@ -1938,7 +1933,7 @@ int cipso_v4_sock_setattr(struct sock *sk,
}
rcu_assign_pointer(sk_inet->inet_opt, opt);
if (old)
- call_rcu(&old->rcu, opt_kfree_rcu);
+ kfree_rcu(old, rcu);
return 0;
@@ -2005,7 +2000,7 @@ int cipso_v4_req_setattr(struct request_sock *req,
req_inet = inet_rsk(req);
opt = xchg(&req_inet->opt, opt);
if (opt)
- call_rcu(&opt->rcu, opt_kfree_rcu);
+ kfree_rcu(opt, rcu);
return 0;
@@ -2075,7 +2070,7 @@ static int cipso_v4_delopt(struct ip_options_rcu **opt_ptr)
* remove the entire option struct */
*opt_ptr = NULL;
hdr_delta = opt->opt.optlen;
- call_rcu(&opt->rcu, opt_kfree_rcu);
+ kfree_rcu(opt, rcu);
}
return hdr_delta;
--
1.7.8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()
[not found] ` <1328125319-5205-1-git-send-email-paulmck@linux.vnet.ibm.com>
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu() Paul E. McKenney
@ 2012-02-01 19:41 ` Paul E. McKenney
2012-02-01 19:50 ` David Miller
2012-02-02 0:24 ` Josh Triplett
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 11/41] mac80211: " Paul E. McKenney
2 siblings, 2 replies; 7+ messages in thread
From: Paul E. McKenney @ 2012-02-01 19:41 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet, darren,
fweisbec, patches, Paul E. McKenney, Paul E. McKenney,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
From: "Paul E. McKenney" <paul.mckenney@linaro.org>
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 <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH RFC tip/core/rcu 11/41] mac80211: Convert call_rcu() to kfree_rcu()
[not found] ` <1328125319-5205-1-git-send-email-paulmck@linux.vnet.ibm.com>
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu() Paul E. McKenney
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 10/41] " Paul E. McKenney
@ 2012-02-01 19:41 ` Paul E. McKenney
2 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2012-02-01 19:41 UTC (permalink / raw)
To: linux-kernel
Cc: mingo, laijs, dipankar, akpm, mathieu.desnoyers, josh, niv, tglx,
peterz, rostedt, Valdis.Kletnieks, dhowells, eric.dumazet, darren,
fweisbec, patches, Paul E. McKenney, Paul E. McKenney,
John W. Linville, Johannes Berg, David S. Miller, linux-wireless,
netdev
From: "Paul E. McKenney" <paul.mckenney@linaro.org>
The call_rcu() in mesh_gate_del() invokes mesh_gate_node_reclaim(),
which simply calls kfree(). So convert the call_rcu() to kfree_rcu(),
allowing mesh_gate_node_reclaim() to be eliminated.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
---
net/mac80211/mesh_pathtbl.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index edf167e..30420bc 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -413,12 +413,6 @@ struct mesh_path *mesh_path_lookup_by_idx(int idx, struct ieee80211_sub_if_data
return NULL;
}
-static void mesh_gate_node_reclaim(struct rcu_head *rp)
-{
- struct mpath_node *node = container_of(rp, struct mpath_node, rcu);
- kfree(node);
-}
-
/**
* mesh_path_add_gate - add the given mpath to a mesh gate to our path table
* @mpath: gate path to add to table
@@ -479,7 +473,7 @@ static int mesh_gate_del(struct mesh_table *tbl, struct mesh_path *mpath)
if (gate->mpath == mpath) {
spin_lock_bh(&tbl->gates_lock);
hlist_del_rcu(&gate->list);
- call_rcu(&gate->rcu, mesh_gate_node_reclaim);
+ kfree_rcu(gate, rcu);
spin_unlock_bh(&tbl->gates_lock);
mpath->sdata->u.mesh.num_gates--;
mpath->is_gate = false;
--
1.7.8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu()
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu() Paul E. McKenney
@ 2012-02-01 19:49 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2012-02-01 19:49 UTC (permalink / raw)
To: paulmck
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, patches, paul.mckenney, kuznet,
jmorris, yoshfuji, kaber, netdev
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Wed, 1 Feb 2012 11:41:27 -0800
> From: "Paul E. McKenney" <paul.mckenney@linaro.org>
>
> Because opt_kfree_rcu() just calls kfree(), all call_rcu() uses of it
> may be converted to kfree_rcu(). This permits opt_kfree_rcu() to
> be eliminated.
>
> Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 10/41] " Paul E. McKenney
@ 2012-02-01 19:50 ` David Miller
2012-02-02 0:24 ` Josh Triplett
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2012-02-01 19:50 UTC (permalink / raw)
To: paulmck
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
josh, niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, patches, paul.mckenney, kuznet,
jmorris, yoshfuji, kaber, netdev
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Wed, 1 Feb 2012 11:41:28 -0800
> From: "Paul E. McKenney" <paul.mckenney@linaro.org>
>
> 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 <paul.mckenney@linaro.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 10/41] " Paul E. McKenney
2012-02-01 19:50 ` David Miller
@ 2012-02-02 0:24 ` Josh Triplett
2012-02-02 15:56 ` Paul E. McKenney
1 sibling, 1 reply; 7+ messages in thread
From: Josh Triplett @ 2012-02-02 0:24 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, patches, Paul E. McKenney,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
On Wed, Feb 01, 2012 at 11:41:28AM -0800, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paul.mckenney@linaro.org>
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC tip/core/rcu 10/41] ipv4: Convert call_rcu() to kfree_rcu()
2012-02-02 0:24 ` Josh Triplett
@ 2012-02-02 15:56 ` Paul E. McKenney
0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2012-02-02 15:56 UTC (permalink / raw)
To: Josh Triplett
Cc: linux-kernel, mingo, laijs, dipankar, akpm, mathieu.desnoyers,
niv, tglx, peterz, rostedt, Valdis.Kletnieks, dhowells,
eric.dumazet, darren, fweisbec, patches, Paul E. McKenney,
David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
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:
> > From: "Paul E. McKenney" <paul.mckenney@linaro.org>
> >
> > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-02 15:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120201194131.GA10028@linux.vnet.ibm.com>
[not found] ` <1328125319-5205-1-git-send-email-paulmck@linux.vnet.ibm.com>
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 09/41] ipv4: Convert call_rcu() to kfree_rcu() Paul E. McKenney
2012-02-01 19:49 ` David Miller
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 10/41] " Paul E. McKenney
2012-02-01 19:50 ` David Miller
2012-02-02 0:24 ` Josh Triplett
2012-02-02 15:56 ` Paul E. McKenney
2012-02-01 19:41 ` [PATCH RFC tip/core/rcu 11/41] mac80211: " Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).