From: Andrea Righi <arighi@nvidia.com>
To: changwoo <changwoo@igalia.com>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to scx_select_cpu_dfl()
Date: Fri, 21 Mar 2025 23:02:12 +0100 [thread overview]
Message-ID: <Z93h5B4xdzRHpjGQ@gpd3> (raw)
In-Reply-To: <5c932b64-82f6-4374-b48f-e3983013b759@igalia.com>
On Fri, Mar 21, 2025 at 07:15:37PM +0900, changwoo wrote:
> Hi Andrea,
>
> On 3/20/25 16:36, Andrea Righi wrote:
> > Modify scx_select_cpu_dfl() to take the allowed cpumask as an explicit
> > argument, instead of implicitly using @p->cpus_ptr.
> >
> > This prepares for future changes where arbitrary cpumasks may be passed
> > to the built-in idle CPU selection policy.
> >
> > This is a pure refactoring with no functional changes.
> >
> > Signed-off-by: Andrea Righi <arighi@nvidia.com>
> > ---
> > kernel/sched/ext.c | 2 +-
> > kernel/sched/ext_idle.c | 45 ++++++++++++++++++++++++++---------------
> > kernel/sched/ext_idle.h | 3 ++-
> > 3 files changed, 32 insertions(+), 18 deletions(-)
> >
> > diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> > index 06561d6717c9a..f42352e8d889e 100644
> > --- a/kernel/sched/ext.c
> > +++ b/kernel/sched/ext.c
> > @@ -3395,7 +3395,7 @@ static int select_task_rq_scx(struct task_struct *p, int prev_cpu, int wake_flag
> > } else {
> > s32 cpu;
> >
> > - cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags, 0);
> > + cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags, p->cpus_ptr, 0);
> > if (cpu >= 0) {
> > p->scx.slice = SCX_SLICE_DFL;
> > p->scx.ddsp_dsq_id = SCX_DSQ_LOCAL;
> > diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
> > index e1e020c27c07c..a90d85bce1ccb 100644
> > --- a/kernel/sched/ext_idle.c
> > +++ b/kernel/sched/ext_idle.c
> > @@ -397,11 +397,19 @@ void scx_idle_update_selcpu_topology(struct sched_ext_ops *ops)
> > static_branch_disable_cpuslocked(&scx_selcpu_topo_numa);
> > }
> >
> > +static inline bool task_allowed_all_cpus(const struct task_struct *p)
> > +{
> > + return p->nr_cpus_allowed >= num_possible_cpus();
> > +}
>
> This function will be renamed to task_affinity_all() in patch #3.
> Can we use the same name from the beginning?
> That will make the commits easier to read.
Right, I'll clean up also this patch in the next version, thanks!
-Andrea
next prev parent reply other threads:[~2025-03-21 22:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 7:36 [PATCHSET v5 sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with allowed CPUs Andrea Righi
2025-03-20 7:36 ` [PATCH 1/6] sched_ext: idle: Extend topology optimizations to all tasks Andrea Righi
2025-03-20 16:49 ` Tejun Heo
2025-03-20 22:08 ` Andrea Righi
2025-03-20 7:36 ` [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to scx_select_cpu_dfl() Andrea Righi
2025-03-21 10:15 ` changwoo
2025-03-21 22:02 ` Andrea Righi [this message]
2025-03-20 7:36 ` [PATCH 3/6] sched_ext: idle: Accept an arbitrary cpumask in scx_select_cpu_dfl() Andrea Righi
2025-03-20 7:36 ` [PATCH 4/6] sched_ext: idle: Introduce scx_bpf_select_cpu_and() Andrea Righi
2025-03-20 7:36 ` [PATCH 5/6] selftests/sched_ext: Add test for scx_bpf_select_cpu_and() Andrea Righi
2025-03-20 7:36 ` [PATCH 6/6] sched_ext: idle: Deprecate scx_bpf_select_cpu_dfl() Andrea Righi
2025-03-20 14:05 ` [PATCHSET v5 sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with allowed CPUs Joel Fernandes
2025-03-20 15:33 ` Andrea Righi
-- strict thread matches above, loose matches on Subject: below --
2025-03-21 22:10 [PATCHSET v6 " Andrea Righi
2025-03-21 22:10 ` [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to scx_select_cpu_dfl() Andrea Righi
2025-03-31 21:50 ` Tejun Heo
2025-04-01 6:21 ` Andrea Righi
2025-03-17 17:53 [PATCHSET v4 sched_ext/for-6.15] sched_ext: Enhance built-in idle selection with allowed CPUs Andrea Righi
2025-03-17 17:53 ` [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to scx_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=Z93h5B4xdzRHpjGQ@gpd3 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=joelagnelf@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox