Subject: Re: Scheduler API changes for yamt-idlelwp
To: Daniel Sieger <dsieger@TechFak.Uni-Bielefeld.DE>
From: haad <haaaad@gmail.com>
List: tech-kern
Date: 02/19/2007 23:29:30
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Sieger wrote:
> On Mon, Feb 19, 2007 at 08:14:26PM +0000, Andrew Doran wrote:
>> Hi,
>>
>> On Sat, Feb 17, 2007 at 10:17:36PM +0100, Daniel Sieger wrote:
>>
>>> Here's a proposed patch to introduce a new scheduler API in
>>> Yamamoto-san's idle lwp branch. It is a slightly modified/improved
>>> version of the patch I send a couple of weeks ago (see [1]).
>> [...]
>>
>>> +#ifdef SCHED_4BSD
>>>  	if (schedhz == 0) {
>>>  		/* 16Hz is best */
>>>  		statscheddiv = i / 16;
>>>  		if (statscheddiv <= 0)
>>>  			panic("statscheddiv");
>>>  	}
>>> +#endif /* SCHED_4BSD */
>> 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?
> 

We should have properly defined API with standard functions like e.g.
schedclock()
....
sched_init()

and other schedulers can use this functions or leave them as dummy routines.

AFAIK we probably want to avoid ifdefing in kernel if we can :).

[snip]
> Regards,
> Daniel
> 

Regards
- ---------------------------------------------------------------
Adam Hamsik
ICQ 249727910
jabber haad@jabber.org
- ---------------------------------------------------------------
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
				
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF2iTJ9Wt2FT7y228RAh6YAJ4/ld/yj7/RGWrn4M3khP+kxe6rzQCfYHKD
zLVWuW5xVSro6+abDwWMT4s=
=mHH9
-----END PGP SIGNATURE-----