Subject: Re: Configurable scheduler quantum?
To: Charles M. Hannum <abuse@spamalicious.com>
From: Thorbjorn Jemander <thoan@ifm.liu.se>
List: netbsd-users
Date: 05/03/2001 09:13:42
"Charles M. Hannum" wrote:
> 
> On Wed, May 02, 2001 at 02:20:48PM +0200, Manuel Bouyer wrote:
> > On Wed, May 02, 2001 at 08:49:22AM +0200, Thorbjorn Jemander wrote:
> > > Hi,
> > >
> > > I'm pretty new to NetBSD, and I'm wondering if
> > > there's a way to set the scheduler time quantum
> > > anywhere? I took a quick peek at the kernel
> > > sources, and it seemed to be set to a whopping
> > > 100 ms for the rr-scheduled processes, as default.
> > > I'd like to change that for my desktop system.
> >
> > Use
> > options  HZ=256
> > (or whatever value you want). I'm not sure any value will work, though ...
> 
> That will *not* change the quantum (significantly).  What you need to
> change is `rrticks', which is initialized in initclocks().

I'm on i386, and there I can't see that the "option HZ"
is specified anywhere in the conf-files, and in conf/param.c
HZ (and thus hz) is defaulted to 100. The rrticks is one
tenth of that, i.e. 100 ms. The lowest achievable value is
10 ms by setting the rrticks to hz/100. If I want values
lower than that, say 5 or 3 ms I have to up the HZ value,
but how does that affect the rest of the system? When
will the context-switching start to consume a large part of
the CPU time? How long time does a context switch take,
anyway?

/Thorbjörn