All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [RFC] lockdep warning in gen_kill_estimator
Date: Wed, 8 Sep 2010 12:16:28 -0700	[thread overview]
Message-ID: <20100908121628.0eee5294@nehalam> (raw)
In-Reply-To: <1283971234.2428.4.camel@edumazet-laptop>

On Wed, 08 Sep 2010 20:40:34 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le mercredi 08 septembre 2010 à 11:27 -0700, Stephen Hemminger a écrit :
> > Saw big lockdep SOFTIRQ-unsafe lock warning in gen_kill_estimator when doing.
> > 
> >   tc qdisc del dev dummy0 root
> > 
> 
> > 
> > --- a/net/core/gen_estimator.c	2010-09-08 11:16:10.184368926 -0700
> > +++ b/net/core/gen_estimator.c	2010-09-08 11:16:24.694194050 -0700
> > @@ -270,18 +270,18 @@ void gen_kill_estimator(struct gnet_stat
> >  {
> >  	struct gen_estimator *e;
> >  
> > -	spin_lock(&est_tree_lock);
> > +	spin_lock_bh(&est_tree_lock);
> >  	while ((e = gen_find_node(bstats, rate_est))) {
> >  		rb_erase(&e->node, &est_root);
> >  
> > -		write_lock_bh(&est_lock);
> > +		write_lock(&est_lock);
> >  		e->bstats = NULL;
> > -		write_unlock_bh(&est_lock);
> > +		write_unlock(&est_lock);
> >  
> >  		list_del_rcu(&e->list);
> >  		call_rcu(&e->e_rcu, __gen_kill_estimator);
> >  	}
> > -	spin_unlock(&est_tree_lock);
> > +	spin_unlock_bh(&est_tree_lock);
> >  }
> >  EXPORT_SYMBOL(gen_kill_estimator);
> >  
> 
> Hmm... I think commit 0b5d404e349c0236
> already takes care of this ?
> 
> Already in Linus tree 
> 
> 
Ok.

But that commit adds unnecessary bh_disable
-------
Subject: [PATCH] pkt_sched: remov unnecessary bh_disable

Now that est_tree_lock is acquired with BH protection, the other
call is unnecessary.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/net/core/gen_estimator.c	2010-09-08 12:13:55.182851300 -0700
+++ b/net/core/gen_estimator.c	2010-09-08 12:14:07.401063663 -0700
@@ -274,9 +274,9 @@ void gen_kill_estimator(struct gnet_stat
 	while ((e = gen_find_node(bstats, rate_est))) {
 		rb_erase(&e->node, &est_root);
 
-		write_lock_bh(&est_lock);
+		write_lock(&est_lock);
 		e->bstats = NULL;
-		write_unlock_bh(&est_lock);
+		write_unlock(&est_lock);
 
 		list_del_rcu(&e->list);
 		call_rcu(&e->e_rcu, __gen_kill_estimator);



-- 

  reply	other threads:[~2010-09-08 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-08 18:27 [RFC] lockdep warning in gen_kill_estimator Stephen Hemminger
2010-09-08 18:40 ` Eric Dumazet
2010-09-08 19:16   ` Stephen Hemminger [this message]
2010-09-08 19:23     ` Eric Dumazet
2010-09-08 20:02       ` David Miller

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=20100908121628.0eee5294@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.