lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 8 Sep 2010 12:16:28 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [RFC] lockdep warning in gen_kill_estimator

On Wed, 08 Sep 2010 20:40:34 +0200
Eric Dumazet <eric.dumazet@...il.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@...tta.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);



-- 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ