From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] sched_ext: Introduce NUMA awareness to the default idle selection policy
Date: Mon, 28 Oct 2024 08:11:55 -1000 [thread overview]
Message-ID: <Zx_T6-9Ash0YEH0Z@slm.duckdns.org> (raw)
In-Reply-To: <20241028113338.85525-1-arighi@nvidia.com>
Hello,
On Mon, Oct 28, 2024 at 12:33:38PM +0100, Andrea Righi wrote:
...
> +static void update_selcpu_topology(void)
> {
> + bool enable_llc = false, enable_numa = false;
> + struct sched_domain *sd;
> + const struct cpumask *cpus;
> + s32 cpu = cpumask_first(cpu_possible_mask);
On x86, the first CPU is guaranteed to be online but there are archs that
allow the first CPU to go down in which case the topo information might not
be available. Use cpumask_first(cpu_online_mask) instead?
...
> @@ -3383,6 +3479,10 @@ static void handle_hotplug(struct rq *rq, bool online)
>
> atomic_long_inc(&scx_hotplug_seq);
>
> + if ((SCX_HAS_OP(cpu_online) || SCX_HAS_OP(cpu_offline)) &&
> + static_branch_likely(&scx_builtin_idle_enabled))
> + update_selcpu_topology();
Hmm... this feels a bit too complicated. Just gate it with scx_enabled()?
> if (online && SCX_HAS_OP(cpu_online))
> SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_online, cpu);
> else if (!online && SCX_HAS_OP(cpu_offline))
> @@ -5202,6 +5302,10 @@ static int scx_ops_enable(struct sched_ext_ops *ops, struct bpf_link *link)
> static_branch_enable_cpuslocked(&scx_has_op[i]);
>
> check_hotplug_seq(ops);
> +#ifdef CONFIG_SMP
> + if (!ops->update_idle || (ops->flags & SCX_OPS_KEEP_BUILTIN_IDLE))
> + update_selcpu_topology();
> +#endif
And always update here?
Thanks.
--
tejun
next prev parent reply other threads:[~2024-10-28 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 11:33 [PATCH v4] sched_ext: Introduce NUMA awareness to the default idle selection policy Andrea Righi
2024-10-28 18:11 ` Tejun Heo [this message]
2024-10-28 18:44 ` 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=Zx_T6-9Ash0YEH0Z@slm.duckdns.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=linux-kernel@vger.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.