[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-sOIwUNgrjbQJkx@slm.duckdns.org>
Date: Mon, 31 Mar 2025 11:50:27 -1000
From: Tejun Heo <tj@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: David Vernet <void@...ifault.com>, Changwoo Min <changwoo@...lia.com>,
Joel Fernandes <joelagnelf@...dia.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] sched_ext: idle: Explicitly pass allowed cpumask to
scx_select_cpu_dfl()
Hello,
On Fri, Mar 21, 2025 at 11:10:48PM +0100, Andrea Righi wrote:
...
> +s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
> + const struct cpumask *cpus_allowed, u64 flags)
> {
> const struct cpumask *llc_cpus = NULL, *numa_cpus = NULL;
> int node = scx_cpu_node_if_enabled(prev_cpu);
> @@ -457,9 +458,9 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags, u64
> struct cpumask *local_cpus = this_cpu_cpumask_var_ptr(local_numa_idle_cpumask);
> const struct cpumask *cpus = numa_span(prev_cpu);
>
> - if (task_affinity_all(p))
> + if (cpus_allowed == p->cpus_ptr && task_affinity_all(p))
> numa_cpus = cpus;
Note that this test isn't quite correct. While the error isn't introduced by
this patchset, this becomes a lot more prominent with the series.
p->nr_cpus_allowed tracks the number of CPUs in p->cpus_mask. p->cpus_ptr
can point away from p->cpus_mask without updating p->nr_cpus_allowed, so the
condition that should be checked is p->cpus_ptr == &p->cpus_mask &&
p->nr_cpus_allowed == num_possible_cpus().
Thanks.
--
tejun
Powered by blists - more mailing lists