Date: Wed, 02 Oct 1996 20:44:52 -0500 From: "Chris Csanady" <ccsanady@friley216.res.iastate.edu> To: freebsd-smp@freebsd.org Subject: Load avg fixes.. Message-ID: <199610030144.UAA00282@friley216.res.iastate.edu>
next in thread | raw e-mail | index | archive | help
Ive been working on making the statistics for SMP look nice. So far with the following patches, the load average looks reasonable. I was thinking of ignoring all the RTP_IDLE procs, but this just does not seem right. Other than hard coding the pids of the idle procs, all I could think of is an added p_flag for now. Also, how would one go about properly calculating cpu %ages now? It almost seems futile. :\ Chris Csanady here are the diffs from before the last commits. anything else, let me know.. *** sys/sys/proc.h.old Wed Oct 2 19:43:04 1996 --- sys/sys/proc.h Wed Oct 2 19:55:17 1996 *************** *** 218,223 **** --- 218,226 ---- #define P_SWAPPING 0x40000 /* Process is being swapped. */ + /* Hack for SMP idle procs XXX */ + #define P_IGNORE 0x80000 /* Ignore during load average calculation. */ + /* * MOVE TO ucred.h? * *** sys/vm/vm_meter.c.old Wed Oct 2 19:35:56 1996 --- sys/vm/vm_meter.c Wed Oct 2 19:52:40 1996 *************** *** 79,84 **** --- 79,86 ---- register struct proc *p; for (nrun = 0, p = allproc.lh_first; p != 0; p = p->p_list.le_next) { + if (p->p_flag & P_IGNORE) + continue; switch (p->p_stat) { case SSLEEP: if (p->p_priority > PZERO || p->p_slptime != 0) *** sys/kern/init_main.c.old Wed Oct 2 19:59:56 1996 --- sys/kern/init_main.c Wed Oct 2 19:53:32 1996 *************** *** 688,693 **** --- 688,694 ---- struct proc *p = curproc; p->p_rtprio.type = RTP_PRIO_IDLE; /* last of the three classes */ p->p_rtprio.prio = RTP_PRIO_MAX; /* lowest priority possible */ + p->p_flag |= P_IGNORE; /* ignore during ldavg calc */ smp_idleloop(); /*NOTREACHED*/ }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610030144.UAA00282>