Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756936Ab1CRPZ7 (ORCPT ); Fri, 18 Mar 2011 11:25:59 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:41835 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756919Ab1CRPZx (ORCPT ); Fri, 18 Mar 2011 11:25:53 -0400 Date: Fri, 18 Mar 2011 11:24:52 -0400 From: Neil Horman To: Lai Jiangshan Cc: "Paul E. McKenney" , Ingo Molnar , Jens Axboe , Robert Love , "James E.J. Bottomley" , "David S. Miller" , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , Eric Dumazet , Stephen Hemminger , Tejun Heo , Jarek Poplawski , linux-kernel@vger.kernel.org, devel@open-fcoe.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 01/36] net,rcu: convert call_rcu(free_dm_hw_stat) to kfree_rcu() Message-ID: <20110318152452.GA12980@hmsreliant.think-freely.org> References: <4D82D071.5020703@cn.fujitsu.com> <4D82D3FF.2080303@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D82D3FF.2080303@cn.fujitsu.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.6 (--) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1830 Lines: 58 On Fri, Mar 18, 2011 at 11:39:43AM +0800, Lai Jiangshan wrote: > > > The rcu callback free_dm_hw_stat() just calls a kfree(), > so we use kfree_rcu() instead of the call_rcu(free_dm_hw_stat). > > Signed-off-by: Lai Jiangshan Acked-by: Neil Horman > --- > net/core/drop_monitor.c | 12 ++---------- > 1 files changed, 2 insertions(+), 10 deletions(-) > > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c > index 36e603c..32365e7 100644 > --- a/net/core/drop_monitor.c > +++ b/net/core/drop_monitor.c > @@ -207,14 +207,6 @@ static void trace_napi_poll_hit(void *ignore, struct napi_struct *napi) > rcu_read_unlock(); > } > > - > -static void free_dm_hw_stat(struct rcu_head *head) > -{ > - struct dm_hw_stat_delta *n; > - n = container_of(head, struct dm_hw_stat_delta, rcu); > - kfree(n); > -} > - > static int set_all_monitor_traces(int state) > { > int rc = 0; > @@ -245,7 +237,7 @@ static int set_all_monitor_traces(int state) > list_for_each_entry_safe(new_stat, temp, &hw_stats_list, list) { > if (new_stat->dev == NULL) { > list_del_rcu(&new_stat->list); > - call_rcu(&new_stat->rcu, free_dm_hw_stat); > + kfree_rcu(new_stat, rcu); > } > } > break; > @@ -314,7 +306,7 @@ static int dropmon_net_event(struct notifier_block *ev_block, > new_stat->dev = NULL; > if (trace_state == TRACE_OFF) { > list_del_rcu(&new_stat->list); > - call_rcu(&new_stat->rcu, free_dm_hw_stat); > + kfree_rcu(new_stat, rcu); > break; > } > } > -- > 1.7.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/