lkml.org 
[lkml]   [2019]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched/fair: Optimize select_idle_cpu
From
Date

On 2019/12/12 22:41, Cheng Jian wrote:
> Our threads are all bind to the front CPUs of the LLC domain,
> and now all the threads runs on the last CPU of them. nr is
> always less than the cpumask_weight, for_each_cpu_wrap can't
> find the CPU which our threads can run on, so the threads stay
> at the last CPU all the time.
Test :

Run on ARM64 4NODE, 128 CORE

// cat a.c
#include <time.h>

int main(void)
{
    struct timespec time, save;
    int ret;

    time.tv_sec = 0;
    time.tv_nsec = 1;

    while (1) {
        ret = nanosleep(&time, &save);
        if (ret)
            nanosleep(&save, &save);
    }
    return 0;
}

#cat a.sh
for i in `seq 0 9`
do
    taskset -c 8-11 ./a.out &
done


then run:

    gcc a.c -o a.out
    sh a.sh



without this patch, you can see all the task run on CPU11 all the times.



    %Cpu8  :  0.0 us,  0.0 sy,  0.0 ni, 98.4 id,  0.0 wa,  1.6 hi, 0.0
si,  0.0 st
    %Cpu9  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi, 0.0
si,  0.0 st
    %Cpu10 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi, 0.0
si,  0.0 st
    %Cpu11 :  5.7 us, 40.0 sy,  0.0 ni, 45.7 id,  0.0 wa,  8.6 hi, 0.0
si,  0.0 st

\
 
 \ /
  Last update: 2019-12-12 15:57    [W:0.064 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site