netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] garp: use kfree_rcu()
@ 2011-05-21  4:31 Eric Dumazet
  2011-05-21  6:06 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-05-21  4:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Use kfree_rcu() instead of call_rcu(), remove garp_cleanup_module()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/802/garp.c |   20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/net/802/garp.c b/net/802/garp.c
index f8300a8..1610295 100644
--- a/net/802/garp.c
+++ b/net/802/garp.c
@@ -544,11 +544,6 @@ static int garp_init_port(struct net_device *dev)
 	return 0;
 }
 
-static void garp_kfree_rcu(struct rcu_head *head)
-{
-	kfree(container_of(head, struct garp_port, rcu));
-}
-
 static void garp_release_port(struct net_device *dev)
 {
 	struct garp_port *port = rtnl_dereference(dev->garp_port);
@@ -559,7 +554,7 @@ static void garp_release_port(struct net_device *dev)
 			return;
 	}
 	rcu_assign_pointer(dev->garp_port, NULL);
-	call_rcu(&port->rcu, garp_kfree_rcu);
+	kfree_rcu(port, rcu);
 }
 
 int garp_init_applicant(struct net_device *dev, struct garp_application *appl)
@@ -603,11 +598,6 @@ err1:
 }
 EXPORT_SYMBOL_GPL(garp_init_applicant);
 
-static void garp_app_kfree_rcu(struct rcu_head *head)
-{
-	kfree(container_of(head, struct garp_applicant, rcu));
-}
-
 void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl)
 {
 	struct garp_port *port = rtnl_dereference(dev->garp_port);
@@ -625,7 +615,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl
 	garp_queue_xmit(app);
 
 	dev_mc_del(dev, appl->proto.group_address);
-	call_rcu(&app->rcu, garp_app_kfree_rcu);
+	kfree_rcu(app, rcu);
 	garp_release_port(dev);
 }
 EXPORT_SYMBOL_GPL(garp_uninit_applicant);
@@ -643,9 +633,3 @@ void garp_unregister_application(struct garp_application *appl)
 	stp_proto_unregister(&appl->proto);
 }
 EXPORT_SYMBOL_GPL(garp_unregister_application);
-
-static void __exit garp_cleanup_module(void)
-{
-	rcu_barrier(); /* Wait for completion of call_rcu()'s */
-}
-module_exit(garp_cleanup_module);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] garp: use kfree_rcu()
  2011-05-21  4:31 [PATCH] garp: use kfree_rcu() Eric Dumazet
@ 2011-05-21  6:06 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-05-21  6:06 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 21 May 2011 06:31:30 +0200

> Use kfree_rcu() instead of call_rcu(), remove garp_cleanup_module()
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-21  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-21  4:31 [PATCH] garp: use kfree_rcu() Eric Dumazet
2011-05-21  6:06 ` David Miller

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).