From: Bill Joy Date: Tue, 14 Oct 1980 01:58:00 +0000 (-0800) Subject: change %cpu constant; new disk monitoring/cpu scheme X-Git-Tag: BSD-4^3~326 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/2d7d59e9bd0c8c5662d5ddab5fda25cfce06d2a5 change %cpu constant; new disk monitoring/cpu scheme SCCS-vsn: sys/kern/kern_clock.c 3.21 --- diff --git a/usr/src/sys/kern/kern_clock.c b/usr/src/sys/kern/kern_clock.c index 84eef5716a..3247eda54e 100644 --- a/usr/src/sys/kern/kern_clock.c +++ b/usr/src/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* %H% 3.20 kern_clock.c */ +/* %H% 3.21 kern_clock.c */ #include "../h/param.h" #include "../h/systm.h" @@ -22,7 +22,7 @@ /* * Constant for decay filter for cpu usage. */ -double ccpu = 0.93550698503161773774; /* exp(-1/15) */ +double ccpu = 0.95122942450071400909; /* exp(-1/20) */ /* * Clock is called straight from @@ -54,7 +54,7 @@ caddr_t pc; register struct callo *p1, *p2; register struct proc *pp; register int s; - int a, cpstate; + int a, cpstate, i; /* * reprime clock @@ -151,7 +151,10 @@ out: else u.u_vm.vm_stime++; } - dk_time[cpstate][dk_busy&(DK_NSTATES-1)]++; + cp_time[cpstate]++; + for (i = 0; i < DK_NDRIVE; i++) + if (dk_busy&(1<p_cpticks++;