From patchwork Wed Aug 5 07:06:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 30773 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 3CA37B6F20 for ; Wed, 5 Aug 2009 17:07:29 +1000 (EST) Received: by ozlabs.org (Postfix) id 2FDB4DDD0C; Wed, 5 Aug 2009 17:07:29 +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 A6578DDD0B for ; Wed, 5 Aug 2009 17:07:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933613AbZHEHHG (ORCPT ); Wed, 5 Aug 2009 03:07:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933592AbZHEHHF (ORCPT ); Wed, 5 Aug 2009 03:07:05 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:52607 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933610AbZHEHHD (ORCPT ); Wed, 5 Aug 2009 03:07:03 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n7576Cv7013316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Aug 2009 00:06:14 -0700 Received: from y.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id n7576BR4019769; Wed, 5 Aug 2009 00:06:12 -0700 Date: Wed, 5 Aug 2009 00:06:11 -0700 From: Andrew Morton To: Dave Young Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Peter Zijlstra , Jiri Pirko Subject: Re: mmotm 2009-08-04-14-22 uploaded Message-Id: <20090805000611.e8183608.akpm@linux-foundation.org> In-Reply-To: <20090805063946.GA1934@darkstar> References: <200908042125.n74LP9qY018119@imap1.linux-foundation.org> <20090805063946.GA1934@darkstar> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 X-Spam-Status: No, hits=-3.012 required=5 tests=AWL,BAYES_00 X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 5 Aug 2009 14:39:46 +0800 Dave Young wrote: > Hi andrew, > > I see following lockdep warning with this release: > > [ 0.474144] INFO: trying to register non-static key. > [ 0.474144] the code is fine but needs lockdep annotation. > [ 0.474144] turning off the locking correctness validator. > [ 0.474144] Pid: 1, comm: swapper Not tainted 2.6.31-rc5-mm1 #7 > [ 0.474144] Call Trace: > [ 0.474144] [] register_lock_class+0x58/0x241 > [ 0.474144] [] __lock_acquire+0xac/0xb73 > [ 0.474144] [] ? __alloc_pages_nodemask+0xe2/0x483 > [ 0.474144] [] ? mark_lock+0x1e/0x1c7 > [ 0.474144] [] ? mark_lock+0x1e/0x1c7 > [ 0.474144] [] ? mark_held_locks+0x43/0x5b > [ 0.474144] [] ? kmem_cache_alloc+0xac/0x11b > [ 0.474144] [] lock_acquire+0x9d/0xc0 > [ 0.474144] [] ? netif_addr_lock_bh+0xd/0xf > [ 0.474144] [] _spin_lock_bh+0x20/0x2f > [ 0.474144] [] ? netif_addr_lock_bh+0xd/0xf > [ 0.474144] [] netif_addr_lock_bh+0xd/0xf > [ 0.474144] [] alloc_netdev_mq+0xf9/0x1a5 > [ 0.474144] [] ? loopback_setup+0x0/0x74 > [ 0.474144] [] loopback_net_init+0x20/0x5d > [ 0.474144] [] register_pernet_operations+0x13/0x15 > [ 0.474144] [] register_pernet_device+0x1f/0x47 > [ 0.474144] [] net_dev_init+0xfe/0x14d > [ 0.474144] [] do_one_initcall+0x4a/0x11a > [ 0.474144] [] ? net_dev_init+0x0/0x14d > [ 0.474144] [] ? register_irq_proc+0x64/0xa8 > [ 0.474144] [] ? init_irq_proc+0x53/0x60 > [ 0.474144] [] kernel_init+0x129/0x17a > [ 0.474144] [] ? kernel_init+0x0/0x17a > [ 0.474144] [] kernel_thread_helper+0x7/0x10 At a guess I'd say that alloc_netdev_mq()->dev_unicast_init() is doing netif_addr_lock_bh()->spin_lock_bh(&dev->addr_list_lock) prior to initialising add_list_lock. Something like this might shut it up: --- a/net/core/dev.c~a +++ a/net/core/dev.c @@ -5111,7 +5111,7 @@ struct net_device *alloc_netdev_mq(int s if (dev_addr_init(dev)) goto free_tx; - dev_unicast_init(dev); + __hw_addr_init(&dev->uc); dev_net_set(dev, &init_net); but it'd be better to intialise this thing earlier like: --- a/net/core/dev.c~a +++ a/net/core/dev.c @@ -4730,8 +4730,6 @@ int register_netdevice(struct net_device BUG_ON(dev->reg_state != NETREG_UNINITIALIZED); BUG_ON(!net); - spin_lock_init(&dev->addr_list_lock); - netdev_set_addr_lockdep_class(dev); netdev_init_queue_locks(dev); dev->iflink = -1; @@ -5107,6 +5105,8 @@ struct net_device *alloc_netdev_mq(int s dev = PTR_ALIGN(p, NETDEV_ALIGN); dev->padded = (char *)dev - (char *)p; + spin_lock_init(&dev->addr_list_lock); + netdev_set_addr_lockdep_class(dev); if (dev_addr_init(dev)) goto free_tx;