tech-kern archive

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

Re: CPUs and processes not evenly assigned?!



hubert%feyrer.de@localhost (Hubert Feyrer) writes:

>On Sat, 5 Nov 2016, Hubert Feyrer wrote:
>> Is this expected behaviour? Definitely surprised me! :)

>FWIW, it seems the same behaviour happens on both netbsd-7/amd64 as of 
>today as well as on -current/amd64, also from today.

>I've put a screenshot here that shows the issue:
>http://www.feyrer.de/Misc/priv/bad-scheduling-7.0_STABLE+7.99.42.png
>(Right side is 7.0_STABLE, left is -current as can be seen on the top)

Can you try this?

--- sys/kern/kern_runq.c        7 Jul 2016 06:55:43 -0000       1.45
+++ sys/kern/kern_runq.c        9 Nov 2016 19:10:16 -0000
@@ -534,7 +534,9 @@
                ci_rq = ci->ci_schedstate.spc_sched_info;
 
                /* Average count of the threads */
-               ci_rq->r_avgcount = (ci_rq->r_avgcount + ci_rq->r_mcount) >> 1;
+               ci_rq->r_avgcount = (
+                       ci_rq->r_avgcount + 2 * ci_rq->r_mcount
+                       ) / 2;
 
                /* Look for CPU with the highest average */
                if (ci_rq->r_avgcount > highest) {

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index