mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>,
	Juri Lelli <juri.lelli@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	linux-kernel@vger.kernel.org, julia.lawall@inria.fr,
	jean-pierre.lozi@inria.fr
Subject: Re: [PATCH] sched/fair: Don't pick recent_used_cpu if target has no LLC domain
Date: Tue, 24 Nov 2026 19:13:06 +0100	[thread overview]
Message-ID: <1939197c-ef2d-43e5-8243-3c6e6217d7ba@inria.fr> (raw)
In-Reply-To: <CAKfTPtARqb5VW0LBxDjGK6cZV7+6Ba4EsjchEMjqO6L2PkiHHg@mail.gmail.com>

Hello,

Thank you for the feedback.

>> select_idle_sibling() can return prev or recent_used_cpu if they are idle
>> and share the LLC with target. However, cpus_share_cache() returns true
>> for any two isolated CPUs because their sd_llc_id is never set and keeps
>> the initial value.
> 
> Are you sure that's because their sd_llc_id is never set and keeps the
> initial value? Or it's because they are in the same llc_mask() and we
> use the same sd_llc_id for all CPUs in the same llc_mask ?
> 

In the patch, I meant CPUs isolated by the boot parameter isolcpus,
whose sd_llc_id keeps the initial value. But in the case of cgroup
isolation, the following statement

 > their sd_llc_id is never set and keeps the initial value.

is not true, although the same problem occurs. I will change the description in v2.


> Being able to set a dedicated sd_llc_id for isolated cpu seems the right option
> 

That might be a cleaner fix, but I am afraid it would be a bigger change. The id 
may need to be updated whenever a CPU enters or leaves an isolated partition in 
cgroup? Since the id also seems to be used for other purposes, e.g. index of 
per-LLC arrays in cache-aware scheduling (llc_id), the change could affect more 
than this issue.

As checking sd_llc already covers both boot parameter(isolcpus) and cgroup's 
isolation, would it be okay to keep this fix in this function?


>> @@ -9175,10 +9175,13 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
>>              asym_fits_cpu(task_util, util_min, util_max, target))
>>                  goto select_smt_priority;
>>
>> +       /* NULL if target has no LLC domain, e.g. isolcpus */
>> +       sd = rcu_dereference_all(per_cpu(sd_llc, target));
> 
> if sd_lls is null, can't we return immediately as there is no shared llc ?
> 

Yes. I will do early-return here in v2.

Best,
Keisuke

      reply	other threads:[~2026-11-24 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 15:51 Keisuke Nishimura
2026-11-24 16:36 ` Vincent Guittot
2026-11-24 18:13   ` Keisuke Nishimura [this message]

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=1939197c-ef2d-43e5-8243-3c6e6217d7ba@inria.fr \
    --to=keisuke.nishimura@inria.fr \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jean-pierre.lozi@inria.fr \
    --cc=julia.lawall@inria.fr \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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®