[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-sPlB3ih10SS9w0@slm.duckdns.org>
Date: Mon, 31 Mar 2025 11:56:36 -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 3/6] sched_ext: idle: Accept an arbitrary cpumask in
scx_select_cpu_dfl()
On Fri, Mar 21, 2025 at 11:10:49PM +0100, Andrea Righi wrote:
...
> + /*
> + * If @prev_cpu is not in the allowed domain, try to assign a new
> + * arbitrary CPU usable by the task in the allowed domain.
> + */
> + if (!cpumask_test_cpu(prev_cpu, allowed)) {
> + cpu = cpumask_any_and_distribute(p->cpus_ptr, allowed);
> + if (cpu < nr_cpu_ids) {
> + prev_cpu = cpu;
> + } else {
> + cpu = -EBUSY;
> + goto out_enable;
> + }
> + }
Would it be better to clear it to -1 and disable @prev_cpu optimizations if
negative? Not a big deal, so please feel free to push back but things like
wake_sync optimization become a bit weird with @prev_cpu set to some random
CPU and down the line if we want to allow e.g. preferring previous idle CPU
even when the sibling CPU isn't idle which seems to help with some
workloads, this can become tricky.
Thanks.
--
tejun
Powered by blists - more mailing lists