4.2bsd kernel auto-nicing, scheduling
John Woods, Software
john at frog.UUCP
Fri Feb 21 05:03:43 AEST 1986
>
> When I have to kill infinite-looping processes, I usually find
> them at nice 0, while much more deserving processes are at nice 4,
> getting nowhere...
> What we really want is to favor processes that someone is
> waiting for, and disfavor "overnight" types of processes...
> I would prefer that the scheduler itself knew something
> about interactive processes, and gave them a higher percentage
> of the cpu....
> My proposal is a modification to kern_synch.c such that when
> a kernel process calls sleep() with pri > PZERO (waiting on a
> slow event), the associated user process is given a short-term
> boost, probably by forgiving some of p_cpu (recent cpu usage)....
Well, here is (roughly) the scheme UNOS uses. Processes have three numbers
for priority, their ceiling, floor, and current values (makes sense). The
following things happen to the current priority value: when you are stuck
in the ready queue for longer than a certain time, it is incremented some
amount; when you use up your time quantum*, it is decremented. *(The time
quantum is a function of the priority, with low priority numbers getting long
quanta, thus allowing compute jobs to get lots of work done as long as no
high priority jobs hit the ready queue, which will interrupt the low priority
job, whether or not its quantum is up). Additionally, certain interactions
cause priority boosts, and among them are blocked teletype read or write,
pipe read or write (this boost is currently disabled, since it had some
disagreeable results; try it if you want, but I think you won't like it),
and a tunable credit for disk interaction (0 by default in our boot-time
configuration file, for similar reasons). In general, the boost for tty
interaction works quite nicely, with the slightly disagreeable result that
uucp tends to become quite a hog (not surprising, it is a hog anywhere it
lives...); this could be eased by dropping its ceiling a few notches.
--
John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101
...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc at MIT-XX.ARPA
This space dedicated to Challenger and her crew,
Francis R. Scobee, Michael J. Smith, Ellison S. Onizuka, Judith Resnik,
Ronald E. McNair, Gregory B. Jarvis, and Christa McAuliffe.
"...and slipped the surly bonds of Earth to touch the face of God."
More information about the Comp.unix.wizards
mailing list