From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] sched_ext: idle: Extend topology optimizations to all tasks
Date: Fri, 14 Mar 2025 21:05:09 +0100 [thread overview]
Message-ID: <Z9SL9chJFYswO5MU@gpd3> (raw)
In-Reply-To: <Z9RzvWMiHWqiO2v7@slm.duckdns.org>
On Fri, Mar 14, 2025 at 08:21:49AM -1000, Tejun Heo wrote:
> Hello,
>
> On Fri, Mar 14, 2025 at 10:45:35AM +0100, Andrea Righi wrote:
> ...
> > - if (p->nr_cpus_allowed >= num_possible_cpus()) {
> > - if (static_branch_maybe(CONFIG_NUMA, &scx_selcpu_topo_numa))
> > - numa_cpus = numa_span(prev_cpu);
> > -
> > - if (static_branch_maybe(CONFIG_SCHED_MC, &scx_selcpu_topo_llc))
> > - llc_cpus = llc_span(prev_cpu);
> > + if (static_branch_maybe(CONFIG_NUMA, &scx_selcpu_topo_numa)) {
> > + struct cpumask *cpus = numa_span(prev_cpu);
> > +
> > + if (cpus && !cpumask_equal(cpus, p->cpus_ptr)) {
> > + if (cpumask_subset(cpus, p->cpus_ptr)) {
> > + numa_cpus = cpus;
> > + } else {
> > + numa_cpus = this_cpu_cpumask_var_ptr(local_numa_idle_cpumask);
> > + if (!cpumask_and(numa_cpus, cpus, p->cpus_ptr))
> > + numa_cpus = NULL;
> > + }
> > + }
> > + }
> > + if (static_branch_maybe(CONFIG_SCHED_MC, &scx_selcpu_topo_llc)) {
> > + struct cpumask *cpus = llc_span(prev_cpu);
> > +
> > + if (cpus && !cpumask_equal(cpus, p->cpus_ptr)) {
> > + if (cpumask_subset(cpus, p->cpus_ptr)) {
> > + llc_cpus = cpus;
> > + } else {
> > + llc_cpus = this_cpu_cpumask_var_ptr(local_llc_idle_cpumask);
> > + if (!cpumask_and(llc_cpus, cpus, p->cpus_ptr))
> > + llc_cpus = NULL;
> > + }
> > + }
> >
>
> Wouldn't it still make sense to special case p->nr_cpus_allowed >=
> num_possible_cpus()? That'd be vast majority of cases and we can skip all
> the cpumask comparisons for them.
Yeah, that's probably a good idea, I'll re-add that in the next version.
Thanks,
-Andrea
next prev parent reply other threads:[~2025-03-14 20:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 9:45 [PATCHSET v3 sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with allowed CPUs Andrea Righi
2025-03-14 9:45 ` [PATCH 1/8] sched_ext: idle: Honor idle flags in the built-in idle selection policy Andrea Righi
2025-03-14 9:45 ` [PATCH 2/8] sched_ext: idle: Refactor scx_select_cpu_dfl() Andrea Righi
2025-03-14 18:17 ` Tejun Heo
2025-03-14 9:45 ` [PATCH 3/8] sched_ext: idle: Extend topology optimizations to all tasks Andrea Righi
2025-03-14 18:21 ` Tejun Heo
2025-03-14 20:05 ` Andrea Righi [this message]
2025-03-14 9:45 ` [PATCH 4/8] sched_ext: idle: Explicitly pass allowed cpumask to scx_select_cpu_dfl() Andrea Righi
2025-03-14 9:45 ` [PATCH 5/8] sched_ext: idle: Accept an arbitrary cpumask in scx_select_cpu_dfl() Andrea Righi
2025-03-14 9:45 ` [PATCH 6/8] sched_ext: idle: Introduce scx_bpf_select_cpu_and() Andrea Righi
2025-03-15 1:35 ` Changwoo Min
2025-03-15 9:08 ` Andrea Righi
2025-03-14 9:45 ` [PATCH 7/8] selftests/sched_ext: Add test for scx_bpf_select_cpu_and() Andrea Righi
2025-03-14 9:45 ` [PATCH 8/8] sched_ext: idle: Deprecate scx_bpf_select_cpu_dfl() Andrea Righi
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=Z9SL9chJFYswO5MU@gpd3 \
--to=arighi@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.