Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964978AbWJ3PBE (ORCPT ); Mon, 30 Oct 2006 10:01:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964977AbWJ3PBD (ORCPT ); Mon, 30 Oct 2006 10:01:03 -0500 Received: from smtp19.orange.fr ([80.12.242.18]:8539 "EHLO smtp-msa-out19.orange.fr") by vger.kernel.org with ESMTP id S1030330AbWJ3PBB (ORCPT ); Mon, 30 Oct 2006 10:01:01 -0500 X-ME-UUID: 20061030150100217.352311C000B0@mwinf1918.orange.fr Subject: Re: [patch] drivers: wait for threaded probes between initcall levels From: Xavier Bestel To: Arjan van de Ven Cc: Kyle Moffett , Linus Torvalds , "Adam J. Richter" , akpm@osdl.org, bunk@stusta.de, greg@kroah.com, linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz, matthew@wil.cx, pavel@ucw.cz, shemminger@osdl.org In-Reply-To: <1162219080.2948.21.camel@laptopd505.fenrus.org> References: <200610282350.k9SNoljL020236@freya.yggdrasil.com> <1162219080.2948.21.camel@laptopd505.fenrus.org> Content-Type: text/plain Date: Mon, 30 Oct 2006 16:00:52 +0100 Message-Id: <1162220452.30605.47.camel@frg-rhel40-em64t-03> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 26 On Mon, 2006-10-30 at 15:38 +0100, Arjan van de Ven wrote: > how much of this complexity goes away if you consider the > scanning/probing as a series of "work elements", and you end up with a > queue of work elements that threads can pull work off one at a time (so > that if one element blocks the others just continue to flow). If you > then find, say, a new PCI bus you just put another work element to > process it at the end of the queue, or you process it synchronously. Etc > etc. > > All you need to scale then is the number of worker threads on the > system, which should be relatively easy to size.... > (check every X miliseconds if there are more than X outstanding work > elements, if there are, spawn one new worker thread if the total number > of worker threads is less than the system wide max. Worker threads die > if they have nothing to do for more than Y miliseconds) Instead of checking every X ms, just check at each job insertion. Xav - 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/