Subject: Re: Loads under 1.1 ALPHA i386?
To: Michael L. VanLoon -- HeadCandy.com <michaelv@HeadCandy.com>
From: Chris G Demetriou <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
List: current-users
Date: 11/08/1995 13:36:58
> In fact, those people are probably now doing three or four times as
> much work, just because the machine feels so much quicker, yet you
> aren't seeing any slowdown because of this upgrade.

Uh, no.

Matt Green had the right answer: i fixed a bug.  8-)


In Net/2 and 4.4-Lite (and Lite2, i think; i forget when i sent in my
fix), the load average calculation code was broken.  in particular,
the path to the load average calculation looks like:

	kern_synch.c:schedcpu()
		do a whole lot of stuff, for all processes, including:
		if (p->p_stat == SSLEEP || p->p_stat == SSTOP)
			p->p_slptime++;
		then, later, call vm_meter.c:vmmeter()

	vm_meter.c:vmmeter()
		calls vm_meter.c:loadav()

	vm_meter.c:loadav()
		computed "number of runnable processes" to be
			the number of processes in the SRUN and SIDL
			state, plus the number of processes
			in the SSLEEP state with p_priority <= 0 and
			p_slptime == 0


of course, at that point, _no_ SSLEEP'd processes could have
p_slptime == 0, because it had just been incremented for all all of
them!

It looked like some code had been moved around, and that
less-than-careful movement broken the load average calculation.


My change restored the load average calculation to the "normal"
traditional one:
	instantaneous load average = number of runnable processes +
				     number of processes in short-term
				         (< 1s) uninterruptable wait.





chris