From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761365Ab2FHHzj (ORCPT ); Fri, 8 Jun 2012 03:55:39 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39468 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760497Ab2FHHzh convert rfc822-to-8bit (ORCPT ); Fri, 8 Jun 2012 03:55:37 -0400 Message-ID: <1339142120.23343.28.camel@twins> Subject: Re: lockdep and kmemcheck From: Peter Zijlstra To: Tejun Heo Cc: Borislav Petkov , Rus , linux-kernel@vger.kernel.org Date: Fri, 08 Jun 2012 09:55:20 +0200 In-Reply-To: <20120608061037.GJ21357@google.com> References: <20120607142459.GB5053@x1.osrc.amd.com> <20120607151352.GA8261@x1.osrc.amd.com> <20120607193331.GA20723@liondog.tnic> <20120607194516.GB20723@liondog.tnic> <20120608061037.GJ21357@google.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2012-06-08 at 15:10 +0900, Tejun Heo wrote: > On Thu, Jun 07, 2012 at 09:45:16PM +0200, Borislav Petkov wrote: > > static struct worker *create_worker(struct global_cwq *gcwq, bool bind) > > { > > bool on_unbound_cpu = gcwq->cpu == WORK_CPU_UNBOUND; > > struct worker *worker = NULL; > > int id = -1; > > > > spin_lock_irq(&gcwq->lock); > > while (ida_get_new(&gcwq->worker_ida, &id)) { > > spin_unlock_irq(&gcwq->lock); > > if (!ida_pre_get(&gcwq->worker_ida, GFP_KERNEL)) > > > > and GFP_KERNEL has __GFP_FS. > > > > > > [] init_workqueues+0x1f2/0x393 > > > > [] ? usermodehelper_init+0x36/0x36 > > > > [] ? usermodehelper_init+0x36/0x36 > > > > [] do_one_initcall+0x122/0x180 > > > > [] kernel_init+0x9b/0x1f6 > > > > [] kernel_thread_helper+0x4/0x10 > > > > [] ? retint_restore_args+0x13/0x13 > > > > [] ? start_kernel+0x3d2/0x3d2 > > > > [] ? gs_change+0x13/0x13 > > > > ---[ end trace 6d450e935ee1897c ]--- > > > > MCE: In-kernel MCE decoding enabled. > > > > NMI watchdog: enabled, takes one hw-pmu counter. > > > > Let's add some more people to CC. > > > > Tejun, this create_worker() uses ida_pre_get() with GFP_KERNEL mask > > but lockdep complains about __GFP_FS allocations with IRQs off in > > __lockdep_trace_alloc. What's up? > > The GFP_KERNEL allocation is right after spin_unlock_irq(). I suppose > this is from early boot before IRQs are brought online, right? My > memory is very fuzzy now but ISTR irq debug code and lockdep having > workarounds for early boot. Peter? early_boot_irqs_disabled, but kernel_init() is way past that, that's where we've forked the first thread and are fully scheduling already.