[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d188305-66ab-81cf-6340-34d155dcaf3b@arm.com>
Date: Fri, 13 Dec 2019 11:28:00 +0000
From: Valentin Schneider <valentin.schneider@....com>
To: "chengjian (D)" <cj.chengjian@...wei.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org,
chenwandun@...wei.com, xiexiuqi@...wei.com, liwei391@...wei.com,
huawei.libin@...wei.com, bobo.shaobowang@...wei.com,
juri.lelli@...hat.com, vincent.guittot@...aro.org
Subject: Re: [PATCH] sched/fair: Optimize select_idle_cpu
On 13/12/2019 09:57, chengjian (D) wrote:
>
> in select_idle_smt()
>
> /*
> * Scan the local SMT mask for idle CPUs.
> */
> static int select_idle_smt(struct task_struct *p, int target)
> {
> int cpu, si_cpu = -1;
>
> if (!static_branch_likely(&sched_smt_present))
> return -1;
>
> for_each_cpu(cpu, cpu_smt_mask(target)) {
> if (!cpumask_test_cpu(cpu, p->cpus_ptr))
> continue;
> if (available_idle_cpu(cpu))
> return cpu;
> if (si_cpu == -1 && sched_idle_cpu(cpu))
> si_cpu = cpu;
> }
>
> return si_cpu;
> }
>
>
> Why don't we do the same thing in this function,
>
> although cpu_smt_present () often has few CPUs.
>
> it is better to determine the 'p->cpus_ptr' first.
>
>
Like you said the gains here would probably be small - the highest SMT
count I'm aware of is SMT8 (POWER9). Still, if we end up with both
select_idle_core() and select_idle_cpu() using that pattern, it would make
sense IMO to align select_idle_smt() with those.
>
>
>
Powered by blists - more mailing lists