Date: Sun, 01 Feb 2004 15:55:05 +0000 From: Ian Dowse <iedowse@maths.tcd.ie> To: Don Lewis <truckman@FreeBSD.org> Cc: bde@zeta.org.au Subject: Re: cvs commit: src/sys/kern sched_4bsd.c Message-ID: <200402011555.aa86743@salmon.maths.tcd.ie> In-Reply-To: Your message of "Sat, 31 Jan 2004 22:45:32 PST." <200402010645.i116jW7E096596@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <200402010645.i116jW7E096596@gw.catspoiler.org>, Don Lewis writes: >Yup, I missed the change in 1.59. I did a binary search to find the >version in vm_meter.c and found a slightly older version before the >SSLEEP code had been removed. > FYI, the original change seems to date back to May 1990: REV:7.7 vm_meter.c 1990/05/02 19:07:25 mckusick do not count processes in load average sleeping over one second --- vm_meter.c 1989/05/29 13:09:36 7.6 +++ vm_meter.c 1990/05/02 19:07:25 7.7 @@ -405,9 +405,10 @@ switch (p->p_stat) { case SSLEEP: + if (p->p_pri <= PZERO && p->p_slptime == 0) + nrun++; + /* fall through */ case SSTOP: - if (p->p_pri <= PZERO && p->p_stat == SSLEEP) - nrun++; if (p->p_flag & SPAGE) total.t_pw++; else if (p->p_flag & SLOAD) { The bug here is that p->p_slptime has just been incremented in schedcpu() immediately before loadav() is called, so it will never be 0 here. Fixing this now is likely to trigger a lot of questions and complaints, so it is left as an excercise for the brave :-) Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402011555.aa86743>