From owner-freebsd-arch Wed Jul 17 2:22:14 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 3084837B400 for ; Wed, 17 Jul 2002 02:22:12 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9432F43E42 for ; Wed, 17 Jul 2002 02:22:11 -0700 (PDT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 279072A7D6 for ; Wed, 17 Jul 2002 02:22:11 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id E76304C26C for ; Wed, 17 Jul 2002 02:22:10 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id 934423915; Wed, 17 Jul 2002 02:22:10 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Luigi Rizzo Cc: arch@freebsd.org Subject: Re: proposed changes to kern_switch.c and kern_synch.c In-Reply-To: <20020717004750.A7375@iguana.icir.org> Date: Wed, 17 Jul 2002 02:22:10 -0700 From: Peter Wemm Message-Id: <20020717092210.934423915@overcee.wemm.org> 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 Luigi Rizzo wrote: > On Wed, Jul 17, 2002 at 12:43:35AM -0700, Peter Wemm wrote: > > Luigi Rizzo wrote: > > > > > In order to make this work, it is convenient to have all > > > scheduler-specific functions and data structures in a > > > single file (kern_switch*.c), and generic support in > > > another one (kern_synch.c). I believe this was also the original > > > BSD design in partitioning the code between the two files. > > > > You would be mistaken there. kern_switch.c is new and has only existed > > very recently. kern_switch.c came about as a C implementation of code that > > used to be embedded inside i386/swtch.s. It has taken on a life of its own > > now though. :-/ > > good to know! > Anyways, does the partitioning of functionalities sound reasonable ? Please be a little careful. There has been a lot of talk about splitting the current scheduler into an event driven system rather than a 'run once a second' thing. This was something along the lines of splitting the current schedcpu stuff and the various other glue into 3 parts. I think the gist of it was to have each process do a slight incremental priority adjustment each time it used up its entire quantum, a slight adjustment at wakeup time, and the periodic system load factoring code would still run periodically. You haven't given much details about how you're intending to implement your alternate scheduler, or even which part you're intending to provide an alternative for (I'm guessing a different kern_switch, ie: alterantive run queues, chooseproc^H^H^H^Hkse, setrunqueue(), etc) Some other comments.. You seem to have seperate the comments about the digital decay magic in schedcpu() from the code that does the magic. In fact, things like cexp[] etc are shared between kern_switch (schedcpu1) and kern_synch (loadav) etc. Are you sure the partitioning is correct? Maybe *everything* other than the msleep/wakeup/etc related stuff should move? ie: setrunnable() (which uses updatepri()) etc move as well? Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message