How does one set the autonice feature?

Jeffrey Mogul mogul at wrl.dec.com
Thu Aug 23 11:08:13 AEST 1990


In article <1990Aug22.010509.11821 at portia.Stanford.EDU> buc at jessica.stanford.edu (Robert Richards) writes:
>
>Large jobs get auto nice'd after a certain limit of CPU time.  Where
>on the system is this value set?

This is left over from 4.2BSD (or even earlier).  The kernel
contains code in sys/kern_clock.c that looks like:
		/*
		 * Check to see if process has accumulated
		 * more than 10 minutes of user time.  If so
		 * reduce priority to give others a chance.
		 */
		if (p->p_uid && p->p_nice == NZERO &&
		    u.u_ru.ru_utime.tv_sec > 10 * 60) {
			p->p_nice = NZERO+4;
			(void) setpri(p);
			p->p_pri = p->p_usrpri;
		}
(This is taken from the 4.2BSD version; in Ultrix 4.0, it is
still there but has gotten a little more complex due to SMP support.)

I don't know of any way to undo this short of changing the kernel
code.  My recollection is that Stanford has an Ultrix source license,
so you should have no trouble changing this feature (it would probably
work to remove the entire "if" statement) -- at your own risk, of
course.  Other who are not so lucky might wish to file an SPR asking
for a hook to manage this feature.

Note that if the process's "nice" is already non-zero, this code
has no effect.  So, if you nice all your processes to, say, 1 or -1,
they will stay at that nice.  (Also note that super-user processes
are immune.)

-Jeff



More information about the Comp.unix.ultrix mailing list