From: Keisuke Nishimura <keisuke.nishimura@inria.fr>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Julia Lawall <julia.lawall@inria.fr>,
Xunlei Pang <xlpang@linux.alibaba.com>,
Abel Wu <wuyun.abel@bytedance.com>
Subject: Re: [PATCH v2 1/2 RESEND] sched/fair: take into account scheduling domain in select_idle_smt()
Date: Wed, 10 Jan 2024 18:57:24 +0100 [thread overview]
Message-ID: <8d9e076c-8505-4538-83f5-506ccf62f7a9@inria.fr> (raw)
In-Reply-To: <CAKfTPtCgqkUUtWMknyHrNeb994V_L4T9bxV9A=bUXCQu-+S1SQ@mail.gmail.com>
>>
>> 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
next prev parent reply other threads:[~2024-01-10 17:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 13:17 Keisuke Nishimura
2024-01-10 13:17 ` [PATCH v2 2/2 RESEND] sched/fair: take into account scheduling domain in select_idle_core() Keisuke Nishimura
2024-01-10 17:16 ` Vincent Guittot
2024-02-28 22:00 ` [tip: sched/core] sched/fair: Take the scheduling domain into account " tip-bot2 for Keisuke Nishimura
2024-01-10 17:21 ` [PATCH v2 1/2 RESEND] sched/fair: take into account scheduling domain in select_idle_smt() Vincent Guittot
2024-01-10 17:57 ` Keisuke Nishimura [this message]
2024-01-11 8:52 ` Vincent Guittot
2024-02-28 22:00 ` [tip: sched/core] sched/fair: Take the scheduling domain into account " tip-bot2 for Keisuke Nishimura
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=8d9e076c-8505-4538-83f5-506ccf62f7a9@inria.fr \
--to=keisuke.nishimura@inria.fr \
--cc=dietmar.eggemann@arm.com \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wuyun.abel@bytedance.com \
--cc=xlpang@linux.alibaba.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®