From patchwork Wed Sep 8 19:16:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 64198 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2AB37B6EFE for ; Thu, 9 Sep 2010 05:16:36 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192Ab0IHTQc (ORCPT ); Wed, 8 Sep 2010 15:16:32 -0400 Received: from mail.vyatta.com ([76.74.103.46]:40187 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752549Ab0IHTQb convert rfc822-to-8bit (ORCPT ); Wed, 8 Sep 2010 15:16:31 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 52D151828F04; Wed, 8 Sep 2010 12:10:54 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vGp5Vo1msvSO; Wed, 8 Sep 2010 12:10:53 -0700 (PDT) Received: from nehalam (pool-74-107-135-205.ptldor.fios.verizon.net [74.107.135.205]) by mail.vyatta.com (Postfix) with ESMTPSA id 81EA11828EF1; Wed, 8 Sep 2010 12:10:53 -0700 (PDT) Date: Wed, 8 Sep 2010 12:16:28 -0700 From: Stephen Hemminger To: Eric Dumazet Cc: David Miller , netdev@vger.kernel.org Subject: Re: [RFC] lockdep warning in gen_kill_estimator Message-ID: <20100908121628.0eee5294@nehalam> In-Reply-To: <1283971234.2428.4.camel@edumazet-laptop> References: <20100908112719.3f4b4644@nehalam> <1283971234.2428.4.camel@edumazet-laptop> Organization: Vyatta X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 08 Sep 2010 20:40:34 +0200 Eric Dumazet 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 --- 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);