Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Back out a small and unfinished piece of the old sc...



details:   https://anonhg.NetBSD.org/src/rev/f9ccdb5daf1d
branches:  trunk
changeset: 477183:f9ccdb5daf1d
user:      ross <ross%NetBSD.org@localhost>
date:      Thu Oct 14 05:59:57 1999 +0000

description:
Back out a small and unfinished piece of the old scheduler rototill.

diffstat:

 sys/kern/kern_synch.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r c6a7dfd9182d -r f9ccdb5daf1d sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Thu Oct 14 02:33:38 1999 +0000
+++ b/sys/kern/kern_synch.c     Thu Oct 14 05:59:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.65 1999/09/17 20:09:05 thorpej Exp $  */
+/*     $NetBSD: kern_synch.c,v 1.66 1999/10/14 05:59:57 ross Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -223,6 +223,7 @@
        register struct proc *p;
        register int s;
        register unsigned int newcpu;
+       int clkhz;
 
        wakeup((caddr_t)&lbolt);
        proclist_lock_read();
@@ -246,15 +247,15 @@
                /*
                 * p_pctcpu is only for ps.
                 */
-               KASSERT(profhz);
+               clkhz = stathz != 0 ? stathz : hz;
 #if    (FSHIFT >= CCPU_SHIFT)
-               p->p_pctcpu += (profhz == 100)?
+               p->p_pctcpu += (clkhz == 100)?
                        ((fixpt_t) p->p_cpticks) << (FSHIFT - CCPU_SHIFT):
                        100 * (((fixpt_t) p->p_cpticks)
-                               << (FSHIFT - CCPU_SHIFT)) / profhz;
+                               << (FSHIFT - CCPU_SHIFT)) / clkhz;
 #else
                p->p_pctcpu += ((FSCALE - ccpu) *
-                       (p->p_cpticks * FSCALE / profhz)) >> FSHIFT;
+                       (p->p_cpticks * FSCALE / clkhz)) >> FSHIFT;
 #endif
                p->p_cpticks = 0;
                newcpu = (u_int)decay_cpu(loadfac, p->p_estcpu);



Home | Main Index | Thread Index | Old Index