public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	satyam@infradead.org, flo@rfc822.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, michal.k.k.piotrowski@gmail.com,
	ipw3945-devel@lists.sourceforge.net, yi.zhu@intel.com,
	flamingice@sourmilk.net
Subject: Re: BUG: scheduling while atomic: ifconfig/0x00000002/4170
Date: Fri, 7 Sep 2007 07:25:38 -0700	[thread overview]
Message-ID: <20070907142538.GC8864@linux.vnet.ibm.com> (raw)
In-Reply-To: <1189171635.28781.134.camel@johannes.berg>

On Fri, Sep 07, 2007 at 03:27:15PM +0200, Johannes Berg wrote:
> On Thu, 2007-09-06 at 08:46 -0700, Paul E. McKenney wrote:
> 
> > Looks good to me from an RCU viewpoint.  I cannot claim familiarity with
> > this code.  I therefore especially like the indications of where RTNL
> > is held and not!!!
> 
> :)
> 
> > Some questions below based on a quick scan.  And a global question:
> > should the comments about RTNL being held be replaced by ASSERT_RTNL()?
> 
> I don't like ASSERT_RTNL() much because it actually tries to lock it.
> I'd be much happer if it was WARN_ON(!mutex_locked(&rtnl_mutex)) or
> something equivalent.

Ah!  It would indeed be nice to have a lower-overhead ASSERT_RTNL_LIGHT()
or whatever.

> In any case, I have an updated patch I'll be sending soon, and it
> requires a new list walking primitive I'll also send.

Look forward to seeing it!

> > > -	write_lock_bh(&local->sub_if_lock);
> > > +	/* we're under RTNL so all this is fine */
> > >  	if (unlikely(local->reg_state == IEEE80211_DEV_UNREGISTERED)) {
> > > -		write_unlock_bh(&local->sub_if_lock);
> > >  		__ieee80211_if_del(local, sdata);
> > >  		return -ENODEV;
> > >  	}
> > > -	list_add(&sdata->list, &local->sub_if_list);
> > > +	list_add_tail_rcu(&sdata->list, &local->interfaces);
> > 
> > The _rcu is required because this list isn't protected by RTNL?
> 
> Yes, not all walkers of the list are protected by the RTNL.

K.

> > > @@ -226,22 +225,22 @@ void ieee80211_if_reinit(struct net_devi
> > >  		/* Remove all virtual interfaces that use this BSS
> > >  		 * as their sdata->bss */
> > >  		struct ieee80211_sub_if_data *tsdata, *n;
> > > -		LIST_HEAD(tmp_list);
> > > 
> > > -		write_lock_bh(&local->sub_if_lock);
> > 
> > This code is also protected by RTNL?
> 
> Yes.

Comment?  (Or is it in the function header?)

> > >  	ASSERT_RTNL();
> > 
> > I -like- this!!!  ;-)
> 
> :)

							Thanx, Paul

  reply	other threads:[~2007-09-07 14:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-02 18:44 BUG: scheduling while atomic: ifconfig/0x00000002/4170 Florian Lohoff
2007-09-02 23:59 ` Michal Piotrowski
2007-09-06  5:02   ` Satyam Sharma
2007-09-06  8:20     ` Herbert Xu
2007-09-06  8:23     ` Herbert Xu
2007-09-06  8:41       ` Satyam Sharma
2007-09-06  8:38         ` Florian Lohoff
2007-09-06 12:09       ` Johannes Berg
2007-09-06 12:36         ` Herbert Xu
2007-09-06 12:44           ` Johannes Berg
2007-09-06 13:36           ` Johannes Berg
2007-09-06 15:46             ` Paul E. McKenney
2007-09-07 13:27               ` Johannes Berg
2007-09-07 14:25                 ` Paul E. McKenney [this message]
2007-09-07 14:30                   ` Johannes Berg
2007-09-07 14:35                   ` Johannes Berg
2007-09-07 14:38                   ` [RFC] mac80211: fix virtual interface locking Johannes Berg
2007-09-07 16:01                 ` BUG: scheduling while atomic: ifconfig/0x00000002/4170 Michael Buesch
2007-09-07 19:17                   ` Johannes Berg
2007-09-06 12:52         ` Satyam Sharma
2007-09-06 12:46           ` Johannes Berg
2007-09-06 15:19       ` Johannes Berg
2007-09-12 12:34         ` David Miller
2007-09-13  7:16           ` Johannes Berg

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=20070907142538.GC8864@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=flamingice@sourmilk.net \
    --cc=flo@rfc822.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=satyam@infradead.org \
    --cc=yi.zhu@intel.com \
    /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