From patchwork Wed Jun 24 10:06:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 29108 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 0D50FB708B for ; Wed, 24 Jun 2009 20:06:20 +1000 (EST) Received: by ozlabs.org (Postfix) id 017D4DDD1B; Wed, 24 Jun 2009 20:06:20 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 6943BDDD0C for ; Wed, 24 Jun 2009 20:06:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754248AbZFXKGH (ORCPT ); Wed, 24 Jun 2009 06:06:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752888AbZFXKGG (ORCPT ); Wed, 24 Jun 2009 06:06:06 -0400 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:55898 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbZFXKGE (ORCPT ); Wed, 24 Jun 2009 06:06:04 -0400 Received: from comxexch02.comx.local (unknown [172.31.1.117]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id 925F116381C; Wed, 24 Jun 2009 12:06:05 +0200 (CEST) Received: from hawk.comx.local ([172.31.4.93]) by comxexch02.comx.local with Microsoft SMTPSVC(6.0.3790.3959); Wed, 24 Jun 2009 12:06:05 +0200 Subject: Re: [PATCH 03/10] mac80211: Use rcu_barrier() on unload. From: Jesper Dangaard Brouer To: Johannes Berg Cc: "David S. Miller" , "Paul E. McKenney" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dougthompson@xmission.com, bluesmoke-devel@lists.sourceforge.net, axboe@kernel.dk, Patrick McHardy , christine.caulfield@googlemail.com, Trond.Myklebust@netapp.com, linux-wireless@vger.kernel.org, yoshfuji@linux-ipv6.org, shemminger@linux-foundation.org, linux-nfs@vger.kernel.org, bfields@fieldses.org, neilb@suse.de, linux-ext4@vger.kernel.org, tytso@mit.edu, adilger@sun.com, netfilter-devel@vger.kernel.org In-Reply-To: <1245770155.21314.38.camel@johannes.local> References: <20090623150330.22490.87327.stgit@localhost> <20090623150409.22490.99106.stgit@localhost> <1245770155.21314.38.camel@johannes.local> Organization: ComX Networks A/S Date: Wed, 24 Jun 2009 12:06:05 +0200 Message-Id: <1245837965.6695.45.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-OriginalArrivalTime: 24 Jun 2009 10:06:05.0688 (UTC) FILETIME=[632B5F80:01C9F4B3] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 2009-06-23 at 17:15 +0200, Johannes Berg wrote: > On Tue, 2009-06-23 at 17:04 +0200, Jesper Dangaard Brouer wrote: > > The mac80211 module uses rcu_call() thus it should use rcu_barrier() > > on module unload. > > > > I'm having a hardtime verifying that no more call_rcu() callbacks can > > be schedules in the module unload path. Could a maintainer please > > look into this? > > > > Signed-off-by: Jesper Dangaard Brouer > > --- > > > > net/mac80211/main.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/net/mac80211/main.c b/net/mac80211/main.c > > index 092a017..e9f70ce 100644 > > --- a/net/mac80211/main.c > > +++ b/net/mac80211/main.c > > @@ -1100,6 +1100,8 @@ static void __exit ieee80211_exit(void) > > ieee80211s_stop(); > > > > ieee80211_debugfs_netdev_exit(); > > + > > + rcu_barrier(); /* Wait for completion of call_rcu()'s */ > > } > > I don't think this is correct at all -- note that call_rcu() is done in > some of the mesh code, so I would think you need to do this in > ieee80211_stop() since the call_rcu() code requires the interface to > still be around. And when it's stopped everything should be idle. Should it then not be in mesh.c ieee80211_stop_mesh(). We can replace the synchronize_rcu() in this function with a rcu_barrier(). > I can fix it later, but I'm deep in some other stuff right now. Yes, I noticed you seem quite active :-) I can also do a repost... what about the patch below? Acked-by: Johannes Berg Acked-by: Johannes Berg diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index fc712e6..11cf45b 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -494,7 +494,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) * should it be using the interface and enqueuing * frames at this very time on another CPU. */ - synchronize_rcu(); + rcu_barrier(); /* Wait for RX path and call_rcu()'s */ skb_queue_purge(&sdata->u.mesh.skb_queue); }