mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de,
	peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com, darren@dvhart.com, patches@linaro.org,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Patrick McHardy <kaber@trash.net>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH tip/core/rcu 1/7] net,rcu: convert call_rcu(sk_filter_release_rcu) to kfree_rcu
Date: Mon,  2 May 2011 09:13:38 -0700	[thread overview]
Message-ID: <1304352824-6563-1-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110502161321.GA6537@linux.vnet.ibm.com>

The RCU callback sk_filter_release_rcu just calls kfree(), so we use
kfree_rcu() instead of call_rcu().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: David S. Miller <davem@davemloft.net>
---
 include/net/sock.h |    4 +---
 net/core/filter.c  |   12 ------------
 2 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 01810a3..60caa06 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1179,8 +1179,6 @@ extern void sk_common_release(struct sock *sk);
 /* Initialise core socket variables */
 extern void sock_init_data(struct socket *sock, struct sock *sk);
 
-extern void sk_filter_release_rcu(struct rcu_head *rcu);
-
 /**
  *	sk_filter_release - release a socket filter
  *	@fp: filter to remove
@@ -1191,7 +1189,7 @@ extern void sk_filter_release_rcu(struct rcu_head *rcu);
 static inline void sk_filter_release(struct sk_filter *fp)
 {
 	if (atomic_dec_and_test(&fp->refcnt))
-		call_rcu(&fp->rcu, sk_filter_release_rcu);
+		kfree_rcu(fp, rcu);
 }
 
 static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
diff --git a/net/core/filter.c b/net/core/filter.c
index afb8afb..7195ce0 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -631,18 +631,6 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
 EXPORT_SYMBOL(sk_chk_filter);
 
 /**
- * 	sk_filter_release_rcu - Release a socket filter by rcu_head
- *	@rcu: rcu_head that contains the sk_filter to free
- */
-void sk_filter_release_rcu(struct rcu_head *rcu)
-{
-	struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
-
-	kfree(fp);
-}
-EXPORT_SYMBOL(sk_filter_release_rcu);
-
-/**
  *	sk_attach_filter - attach a socket filter
  *	@fprog: the filter program
  *	@sk: the socket to use
-- 
1.7.3.2


  reply	other threads:[~2011-05-02 21:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 16:13 [PATCH tip/core/rcu 0/7] More uses of kfree_rcu Paul E. McKenney
2011-05-02 16:13 ` Paul E. McKenney [this message]
2011-05-02 21:41   ` [PATCH tip/core/rcu 1/7] net,rcu: convert call_rcu(sk_filter_release_rcu) to kfree_rcu David Miller
2011-05-02 22:06     ` Paul E. McKenney
2011-05-03  6:13       ` Ingo Molnar
2011-05-03  6:16         ` Ingo Molnar
2011-05-03 19:33           ` Paul E. McKenney
2011-05-02 16:13 ` [PATCH tip/core/rcu 2/7] sysctl,rcu: convert call_rcu(free_head) to kfree Paul E. McKenney
2011-05-02 16:13 ` [PATCH tip/core/rcu 3/7] batman,rcu: convert call_rcu(gw_node_free_rcu) to kfree_rcu Paul E. McKenney
2011-05-02 16:13 ` [PATCH tip/core/rcu 4/7] batman,rcu: convert call_rcu(neigh_node_free_rcu) to kfree() Paul E. McKenney
2011-05-02 16:13 ` [PATCH tip/core/rcu 5/7] batman,rcu: convert call_rcu(softif_neigh_free_rcu) to kfree_rcu Paul E. McKenney
2011-05-03  7:02   ` Sven Eckelmann
2011-05-02 16:13 ` [PATCH tip/core/rcu 6/7] net,rcu: convert call_rcu(prl_entry_destroy_rcu) to kfree Paul E. McKenney
2011-05-02 16:13 ` [PATCH tip/core/rcu 7/7] net,rcu: convert call_rcu(xt_rateest_free_rcu) to kfree_rcu() Paul E. McKenney
2011-05-03  0:13 ` [PATCH tip/core/rcu 0/7] More uses of kfree_rcu Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304352824-6563-1-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=kaber@trash.net \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®