[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d9e076c-8505-4538-83f5-506ccf62f7a9@inria.fr>
Date: Wed, 10 Jan 2024 18:57:24 +0100
From: Keisuke Nishimura <keisuke.nishimura@...ia.fr>
To: Vincent Guittot <vincent.guittot@...aro.org>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, Dietmar Eggemann <dietmar.eggemann@....com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
Julia Lawall <julia.lawall@...ia.fr>, Xunlei Pang
<xlpang@...ux.alibaba.com>, Abel Wu <wuyun.abel@...edance.com>
Subject: Re: [PATCH v2 1/2 RESEND] sched/fair: take into account scheduling
domain in select_idle_smt()
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 533547e3c90a..66457d4b8965 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -7311,13 +7311,19 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu
>> /*
>> * Scan the local SMT mask for idle CPUs.
>> */
>> -static int select_idle_smt(struct task_struct *p, int target)
>> +static int select_idle_smt(struct task_struct *p, struct sched_domain *sd, int target)
>> {
>> int cpu;
>>
>> for_each_cpu_and(cpu, cpu_smt_mask(target), p->cpus_ptr) {
>> if (cpu == target)
>> continue;
>> + /*
>> + * Check if the CPU is in the LLC scheduling domain of @target.
>> + * Due to isolcpus, there is no guarantee that all the siblings are in the domain.
>> + */
>> + if (!cpumask_test_cpu(cpu, sched_domain_span(sd)))
>
> commit df3cb4ea1fb6 ("sched/fair: Fix wrong cpu selecting from isolated domain")
> also checked if (!cpumask_test_cpu(cpu, p->cpus_ptr) ||
>
> Why didn't you also re-add this test ?
>
>
Thank you for your comment. This is because the iterator "for_each_cpu_and(cpu,
cpu_smt_mask(target), p->cpus_ptr)" ensures that cpu is included in p->cpus_ptr.
The iterator has changed. FYI, here is the change made in commit df3cb4ea1fb6:
for_each_cpu(cpu, cpu_smt_mask(target)) {
- if (!cpumask_test_cpu(cpu, p->cpus_ptr))
+ if (!cpumask_test_cpu(cpu, p->cpus_ptr) ||
+ !cpumask_test_cpu(cpu, sched_domain_span(sd)))
continue;
if (available_idle_cpu(cpu) || sched_idle_cpu(cpu))
best,
Keisuke
Powered by blists - more mailing lists