Subject: Re: Autonice bugging my but!
To: None <current-users@NetBSD.ORG>
From: Michael Graff <>
List: current-users
Date: 01/21/1996 15:31:13
>       Before someone runs of and implements this, remember that
>every instruction generated in this piece of code is run at each
>scheduling interupt.  There is an incredible cost to everything that
>you do here.  For someone who doesn't want this feature, I would
>definately want it to be #ifdef'd out.

I've not allowed it to be #ifdef'd out in what I've written, but it
can be disabled by setting the time to zero.

What I've coded can be found as a patch (ala cvs diff -- will patch
actually apply that thing correctly?) for the /sys direcrory.  After
applying this, make install in /usr/src/include and recompile sysctl
to allow looking / tweaking.  I haven't updated the sysctl man page
yet, but will once the name is set in stone.  :)

Here's the basic features:

autonicetime is in seconds.  Once the process exceeds that time,
autoniceval will be applied.  It is _very_ innefficent to set
autoniceval to 0 to disable the thing, but setting autonicetime to 0
is ok.

If autonicetime < 0, all non-root processes will get niced right away,
I think.  :)

After I get a comment or two about it I'll send it in as a pr.  I
don't like the names ``autonice{time,val}'' but what would be better?

The disable code (setting autonicetime to zero) will short-circuit at
the first test:

  if (autonicetime && s > autonicetime ...)

so the speed hit should be minimal if autonicetime == 0.


Michael Graff <>        NetBSD is the way to go!
PGP key on a key-server near you!         Netshade the world!