From owner-freebsd-arch Wed Jul 17 4:45:44 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67A2137B400 for ; Wed, 17 Jul 2002 04:45:41 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20FCC43E42 for ; Wed, 17 Jul 2002 04:45:41 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g6HBjc809384; Wed, 17 Jul 2002 04:45:38 -0700 (PDT) (envelope-from rizzo) Date: Wed, 17 Jul 2002 04:45:38 -0700 From: Luigi Rizzo To: "Matthew D. Fuller" Cc: arch@FreeBSD.ORG Subject: Re: proposed changes to kern_switch.c and kern_synch.c Message-ID: <20020717044538.A9282@iguana.icir.org> References: <20020716235216.B6785@iguana.icir.org> <20020717105433.GB29269@over-yonder.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020717105433.GB29269@over-yonder.net>; from fullermd@over-yonder.net on Wed, Jul 17, 2002 at 05:54:34AM -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jul 17, 2002 at 05:54:34AM -0500, Matthew D. Fuller wrote: ... > Luigi Rizzo, and lo! it spake thus: > > > > --- Re. the multi-scheduler architecture --- > > > > The general idea is to make the process/thread/kse scheduler > > a replaceable piece of the kernel, requiring no modifications > > to the "struct proc", and with the ability of switching from > > one scheduler to another one at runtime (this both for testing > > purposes and for whatever need may arise). > > Random related thoughts: > > 1) From the work you've done on this already, how difficult would you > expect it to be to do this in such a way that you could have multiple > (>2) schedulers around, loading and unloading at will (when disabled, of > course) through KLD's? it is basically already done -- schedulers are loaded and initialized via SYSINIT, and when you switch to another one all references to the old one are removed and data structures freed. It is just a matter of providing the module glue. > 2) How much unavoidable overhead is there in switching between the > schedulers? Could it get low enough that it might be meaningful to, > instead of writing One True Scheduler, instead write 3 or 4 different > optimized ones, and have some intelligence to switch between them > automagically as load demands? you need to move all processes from one scheduler to another, so it is O(n) overhead. Frankly i do not believe it is very interesting to switch between different schedulers at runtime other than for testing purposes. What _might_ be more interesting is to use multiple schedulers in a hierarchical fashion, e.g. WFQ within each priority class, or priority among threads or processes belonging to the same scheduling entity (KSEG or process group). Not that I am an advocate of that either, i generally prefer flat structures. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message