Subject: Re: Scheduler API changes for yamt-idlelwp
To: Daniel Sieger <dsieger@TechFak.Uni-Bielefeld.DE>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 02/20/2007 02:44:46
On Mon, Feb 19, 2007 at 11:10:41PM +0100, Daniel Sieger wrote:

> On Mon, Feb 19, 2007 at 08:14:26PM +0000, Andrew Doran wrote:

> > I'm not sure if it is worth #ifdefing this just yet. I think it would make
> > more sense to have other schedulers provide a dummy routine that just
> > returns and does nothing.
> 
> Well, statscheddiv is only used to periodically call schedclock(),
> which is a completely 4BSD specific function. I don't see any need why
> we should enforce other schedulers to provide a dummy for this. Maybe
> you can explain the rationale behind your proposal a bit more?

The main intention is to avoid using ifdefs unless it costs us to do
otherwise: code size, or real overhead at execution time. schedclock()
isn't called all that often, so we can get away without the ifdefs if
we just make it a dummy function.

> > +sched_setup()
> > 
> > This kicks off scheduling, right? So why not sched_start() or
> > something?
> 
> Not really right. I does not "start" scheduling. I just kicks off
> schedcpu(), which is only one part of the scheduler in 4BSD
> case. The scheduler actually schedules processes even before
> sched_setup() is called. I agree that sched_setup() is probably not
> the best naming, but sched_start() seems confusing for me, as it does
> not correctly/completely describe what it does.

Ok. I was curious as to the naming because I was thinking in terms of
the 4BSD scheduler. That makes more sense now - sched_setup() sounds
fine to me.

Cheers,
Andrew