Subject: Re: Common Scheduler Framework update and question
To: Ben Harris <bjh21@netbsd.org>
From: Daniel Sieger <dsieger@TechFak.Uni-Bielefeld.DE>
List: tech-kern
Date: 09/28/2006 18:53:53
--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Sep 28, 2006 at 05:23:20PM +0100, Ben Harris wrote:
>=20
> It seems to me that this entirely depends on how you intend to slot in=20
> different schedulers. If the intention is that they should be selected=
=20
> at compile time, and that each scheduler should provide a function of=20
> each name, then you should rename schedcpu() and roundrobin(). If (as I=
=20
> suspect is more likely) you plan to have them selectable at run-time,=20
> then sched_adjust() and sched_resched() will have to be (or go via)=20
> pointers, and you can keep the existing names for the existing=20
> functions.
The current implementation uses a compile time option, and I intend to
leave it at that, at least for this project. OTOH, I guess it would be
nice to have the interface designed in a manner that would allow such
further improvements.
> >1. I could just rename schedcpu() and roundrobin() accordingly. But I
> > have some bad feelings about this approach, since it seems to me
> > bit like breaking our current interface.
>=20
> Since your entire plan is to replace the current interface, I'm not sure=
=20
> this can really be described as a problem.
Sounds reasonable. However, I also made a version using macros without
too much pain. The only drawback I currently see is that I have to
include sched.h in kern/init_main.c which wouldn't be necessary
otherwise.
> >4. Define sched_adjust() and sched_resched() as function pointers and
> > let them point to schedcpu() and roundrobind(). I tried this one,
> > but I ran into trouble with the callout handler that actually
> > triggers the execution of schedcpu().
>=20
> What kind of trouble?
I didn't investigate in detail, but CALLOUT_INITIALIZER_SETFUNC()
didn't like a function pointer as argument, IIRC. Maybe I should
investigate that one further.
regards,
Daniel
--=20
Daniel Sieger wwwhomes.uni-bielefeld.de/dsieger
Faculty of Technology dkenblog.blogspot.com
Bielefeld University orangeflag.blogspot.com
--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (SunOS)
iD8DBQFFG/4hJUKmeYzbnToRAhnSAJ4vIiPxjKGqm7ekVnEaxtHRFSLo7QCffkIK
J4bzF9xStg/IBRvwyz2GkKY=
=PM42
-----END PGP SIGNATURE-----
--0OAP2g/MAC+5xKAE--