Source-Changes-HG archive

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

[src/trunk]: src/sys/kern revert rev.1.37 for now.



details:   https://anonhg.NetBSD.org/src/rev/48ad3c83e241
branches:  trunk
changeset: 785418:48ad3c83e241
user:      yamt <yamt%NetBSD.org@localhost>
date:      Tue Mar 12 23:16:31 2013 +0000

description:
revert rev.1.37 for now.

PR/47634 from Ryo ONODERA.
while i have no idea how this change can break bge,
i don't have hardware and/or time to investigate right now.

diffstat:

 sys/kern/kern_runq.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (58 lines):

diff -r a3a051259a6f -r 48ad3c83e241 sys/kern/kern_runq.c
--- a/sys/kern/kern_runq.c      Tue Mar 12 21:54:36 2013 +0000
+++ b/sys/kern/kern_runq.c      Tue Mar 12 23:16:31 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_runq.c,v 1.37 2013/03/06 11:25:01 yamt Exp $      */
+/*     $NetBSD: kern_runq.c,v 1.38 2013/03/12 23:16:31 yamt Exp $      */
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius <rmind at NetBSD org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.37 2013/03/06 11:25:01 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.38 2013/03/12 23:16:31 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -90,8 +90,6 @@
        struct evcnt    r_ev_localize;
 } runqueue_t;
 
-#define        AVGCOUNT_SHIFT  4       /* shift for r_avgcount */
-
 static void *  sched_getrq(runqueue_t *, const pri_t);
 #ifdef MULTIPROCESSOR
 static lwp_t * sched_catchlwp(struct cpu_info *);
@@ -385,7 +383,7 @@
        /* Make sure that thread is in appropriate processor-set */
        if (__predict_true(spc->spc_psid == l->l_psid)) {
                /* If CPU of this thread is idling - run there */
-               if (ci_rq->r_avgcount <= (1 << AVGCOUNT_SHIFT)) {
+               if (ci_rq->r_count == 0) {
                        ci_rq->r_ev_stay.ev_count++;
                        return ci;
                }
@@ -524,20 +522,10 @@
 
        /* Make lockless countings */
        for (CPU_INFO_FOREACH(cii, ci)) {
-               const bool notidle = ci->ci_data.cpu_idlelwp != ci->ci_curlwp;
-               u_int nrunning;
-
                ci_rq = ci->ci_schedstate.spc_sched_info;
 
                /* Average count of the threads */
-               nrunning = ci_rq->r_count + notidle;
-               ci_rq->r_avgcount = (ci_rq->r_avgcount +
-                   (nrunning << AVGCOUNT_SHIFT)) >> 1;
-
-               /* We are not interested in a CPU without migratable threads */
-               if (ci_rq->r_mcount == 0) {
-                       continue;
-               }
+               ci_rq->r_avgcount = (ci_rq->r_avgcount + ci_rq->r_mcount) >> 1;
 
                /* Look for CPU with the highest average */
                if (ci_rq->r_avgcount > highest) {



Home | Main Index | Thread Index | Old Index