Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751046AbWJ0US7 (ORCPT ); Fri, 27 Oct 2006 16:18:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751227AbWJ0US7 (ORCPT ); Fri, 27 Oct 2006 16:18:59 -0400 Received: from smtp.osdl.org ([65.172.181.4]:16060 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751046AbWJ0US6 (ORCPT ); Fri, 27 Oct 2006 16:18:58 -0400 Date: Fri, 27 Oct 2006 13:15:29 -0700 From: Andrew Morton To: Stephen Hemminger Cc: Pavel Machek , Greg KH , Matthew Wilcox , Adrian Bunk , Linus Torvalds , Linux Kernel Mailing List , linux-pci@atrey.karlin.mff.cuni.cz Subject: Re: [patch] drivers: wait for threaded probes between initcall levels Message-Id: <20061027131529.980cd53e.akpm@osdl.org> In-Reply-To: <20061027114729.49185fd2@freekitty> References: <20061026224541.GQ27968@stusta.de> <20061027010252.GV27968@stusta.de> <20061027012058.GH5591@parisc-linux.org> <20061026182838.ac2c7e20.akpm@osdl.org> <20061026191131.003f141d@localhost.localdomain> <20061027170748.GA9020@kroah.com> <20061027172219.GC30416@elf.ucw.cz> <20061027113908.4a82c28a.akpm@osdl.org> <20061027114144.f8a5addc.akpm@osdl.org> <20061027114237.d577c153.akpm@osdl.org> <20061027114729.49185fd2@freekitty> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 37 On Fri, 27 Oct 2006 11:47:29 -0700 Stephen Hemminger wrote: > On Fri, 27 Oct 2006 11:42:37 -0700 > Andrew Morton wrote: > > > From: Andrew Morton > > > > The multithreaded-probing code has a problem: after one initcall level (eg, > > core_initcall) has been processed, we will then start processing the next > > level (postcore_initcall) while the kernel threads which are handling > > core_initcall are still executing. This breaks the guarantees which the > > layered initcalls previously gave us. > > > > IOW, we want to be multithreaded _within_ an initcall level, but not between > > different levels. > > > > Fix that up by causing the probing code to wait for all outstanding probes at > > one level to complete before we start processing the next level. > > > > Cc: Greg KH > > Signed-off-by: Andrew Morton > > --- > > > > This looks like a good place to use a counting semaphore. > I couldn't work out a way of doing that. I guess one could a) count the number of threads which are going to be started, b) start them all, c) do an up() when each thread ends and d) handle errors somehow. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/