automatic renice in 4.1 bsd?

Guy Harris guy at rlgvax.UUCP
Sat Oct 13 14:39:43 AEST 1984


> We have started to notice a problem with some
> people's login csh being reniced. Since we always
> have a few processes running, these people's terminal
> appears to be dead.
> 
> By reniceing the csh to 0, the terminal becomes alive
> again, and renice reports the old priority as 19.
> 
> Is there some thing in 4.1 bsd that renices people when
> the system load gets too high?

In 4.2BSD, the following code appears in "kern_clock.c":

	/*
	 * 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;
	}

so if a process accumulates enough CPU time, the system decides it's had
enough favorable treatment and it's time to get tough with it.  I seem to
remember something like this also being in 4.1BSD, so that's what may be
happening.  Check "clock.c" in the kernel source.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list