mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "chengjian (D)" <cj.chengjian@huawei.com>
To: <mingo@kernel.org>, <peterz@infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: <chenwandun@huawei.com>, <xiexiuqi@huawei.com>,
	<liwei391@huawei.com>, <huawei.libin@huawei.com>,
	<bobo.shaobowang@huawei.com>, <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>,
	"chengjian (D)" <cj.chengjian@huawei.com>
Subject: Re: [PATCH] sched/fair: Optimize select_idle_cpu
Date: Thu, 12 Dec 2019 22:56:38 +0800	[thread overview]
Message-ID: <3cf0931f-d2f4-008e-8e58-cbc9bd45e3a6@huawei.com> (raw)
In-Reply-To: <20191212144102.181510-1-cj.chengjian@huawei.com>


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


  reply	other threads:[~2019-12-12 14:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 14:41 Cheng Jian
2019-12-12 14:56 ` chengjian (D) [this message]
2019-12-12 15:04 ` Peter Zijlstra
2019-12-13  1:51   ` chengjian (D)
2019-12-13  8:10     ` Peter Zijlstra
2019-12-12 15:24 ` Peter Zijlstra
2019-12-12 15:44   ` Valentin Schneider
2019-12-13  9:47     ` chengjian (D)
2019-12-13  9:57   ` chengjian (D)
2019-12-13 11:28     ` Valentin Schneider
2019-12-13 12:09       ` Peter Zijlstra
2019-12-13 12:20         ` Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cf0931f-d2f4-008e-8e58-cbc9bd45e3a6@huawei.com \
    --to=cj.chengjian@huawei.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=chenwandun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=xiexiuqi@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®