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: <Z6nAr_K1AN_ssP-l@gpd3>
Date: Mon, 10 Feb 2025 10:02:39 +0100
From: Andrea Righi <arighi@...dia.com>
To: lirongqing <lirongqing@...du.com>
Cc: tj@...nel.org, void@...ifault.com, changwoo@...lia.com,
	mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
	vincent.guittot@...aro.org, dietmar.eggemann@....com,
	rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
	vschneid@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched_ext: Take NUMA node into account when allocating
 per-CPU cpumasks

On Mon, Feb 10, 2025 at 04:52:25PM +0800, lirongqing wrote:
> From: Li RongQing <lirongqing@...du.com>
> 
> per-CPU cpumasks are dominantly accessed from their own local CPUs,
> so allocate them node-local to improve performance.

Makes sense to me, did you run some tests/benchmarks on any large NUMA
system with this?

Thanks,
-Andrea

> 
> Signed-off-by: Li RongQing <lirongqing@...du.com>
> ---
>  kernel/sched/ext.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 8857c07..3fe5a2e 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -6325,15 +6325,16 @@ void __init init_sched_ext_class(void)
>  
>  	for_each_possible_cpu(cpu) {
>  		struct rq *rq = cpu_rq(cpu);
> +		int  n = cpu_to_node(cpu);
>  
>  		init_dsq(&rq->scx.local_dsq, SCX_DSQ_LOCAL);
>  		INIT_LIST_HEAD(&rq->scx.runnable_list);
>  		INIT_LIST_HEAD(&rq->scx.ddsp_deferred_locals);
>  
> -		BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_kick, GFP_KERNEL));
> -		BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_kick_if_idle, GFP_KERNEL));
> -		BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_preempt, GFP_KERNEL));
> -		BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_wait, GFP_KERNEL));
> +		BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_kick, GFP_KERNEL, n));
> +		BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_kick_if_idle, GFP_KERNEL, n));
> +		BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_preempt, GFP_KERNEL, n));
> +		BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_wait, GFP_KERNEL, n));
>  		init_irq_work(&rq->scx.deferred_irq_work, deferred_irq_workfn);
>  		init_irq_work(&rq->scx.kick_cpus_irq_work, kick_cpus_irq_workfn);
>  
> -- 
> 2.9.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ