Re: kernel scheduler

Andrew J. Anderson (andrew@db.erau.edu)
Wed, 18 Feb 1998 09:06:07 -0500 (EST)


On Wed, 18 Feb 1998, David Fries wrote:

> On Tue, Feb 17, 1998 at 09:49:31PM -0800, Karl M. Hegbloom wrote:
> > >>>>> "Andrew" == Andrew J Anderson <andrew@db.erau.edu> writes:
> > Andrew> I have been looking at the QNX-style scheduler patches for
> > Andrew> 2.0.x, and I would like to know what the feeling is about
> > Andrew> touching the scheduling code.
> -snip-
> > It occured to me that if you went and upped the priority of your
> > Apache daemon, and a CGI program began to infloop, you'd have to
> > reboot your server to get it back. That sort of situation could be
> > dangerous in some industrial environments...
>
> I have thought of a few ways to do it, but I think I would like a
> QNX-style scheduler in the way that processes that are niced from
> negative to around 5 or so are scheduled according to the regular
> kernel scheduler and processes above 5 are scheduled according to the
> QNX-style. That way if you have something you don't want taking away
> from interaction processing nice it up and it doesn't get scheduled
> unless nothing else is needing to be run. Also, if something gets
> niced to be negative and goes in a infinite loop, you don't have to
> worry about loosing the system, you can still login and do something
> about it.

One solution to something like this that I have seen takes advantage of
the tunable scheduler. You basically split the priority table into a
"fast" and "slow" part, and you can define the amount of CPU time that
each part will get. For example, "normal" processes could be part of the
fast part, and get up to 70% of the CPU, while "slow" processes could only
get up to 30%. One can also create a 'batch' queue inside the scheduler
that will only run when interactive processes are not scheduled.

Right now I am working towards something like this. I have been able to
test with different priorities, and with a dozen `dd if=/dev/zero
of=/dev/null`'s running in the background, an renice'd shell is still very
responsive. I'm dealing with the feedback issues, and after those are
fixed, I shouldn't have to renice at all to get good performance under
load (or so my theory goes).

Keep in mind that with the approach I'm taking, the user can't directly
muck with priorities. The priority can be enhanced with nice values, but
those will only set a maximum and minimum window for which queue's the
process could be scheduled to run in. Thus in the example referenced
above with a runaway CGI, the renice'd CGI process would only be demoted
to the lowest runlevel + nice value queue, instead of the lowest queue.

Andrew

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrew Anderson http://amelia.db.erau.edu/~andrew/
if(!(family_tree=fork())){redneck=TRUE;}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu