lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zx_T6-9Ash0YEH0Z@slm.duckdns.org>
Date: Mon, 28 Oct 2024 08:11:55 -1000
From: Tejun Heo <tj@...nel.org>
To: Andrea Righi <arighi@...dia.com>
Cc: David Vernet <void@...ifault.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] sched_ext: Introduce NUMA awareness to the default
 idle selection policy

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ