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] [day] [month] [year] [list]
Date: Tue, 14 May 2024 22:53:00 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Yury Norov <yury.norov@...il.com>
Cc: anna-maria@...utronix.de, bristot@...hat.com, bsegall@...gle.com,
 cgroups@...r.kernel.org, dietmar.eggemann@....com, frederic@...nel.org,
 gregkh@...uxfoundation.org, hannes@...xchg.org, imran.f.khan@...cle.com,
 juri.lelli@...hat.com, leobras@...hat.com, linux-kernel@...r.kernel.org,
 lizefan.x@...edance.com, longman@...hat.com, mgorman@...e.de,
 mingo@...hat.com, paulmck@...nel.org, peterz@...radead.org,
 rafael@...nel.org, riel@...riel.com, rostedt@...dmis.org,
 tglx@...utronix.de, tj@...nel.org, vincent.guittot@...aro.org,
 vschneid@...hat.com
Subject: Re: [PATCH 2/6] sched/topology: optimize topology_span_sane()

Le 14/05/2024 à 00:01, Yury Norov a écrit :
> The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i),
> even though cpu != i. In such case, cpumask_equal() would always return
> true, and we can proceed to the next CPU immediately.
> 
> Signed-off-by: Yury Norov <yury.norov-Re5JQEeQqe8AvxtiuMwx3w@...lic.gmane.org>
> ---
>   kernel/sched/topology.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 99ea5986038c..eb9eb17b0efa 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -2360,7 +2360,7 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl,
>   	 * breaks the linking done for an earlier span.
>   	 */
>   	for_each_cpu(i, cpu_map) {
> -		if (i == cpu)
> +		if (i == cpu || tl->mask(cpu) == tl->mask(i))
>   			continue;
>   		/*
>   		 * We should 'and' all those masks with 'cpu_map' to exactly

Hi,

does it make sense to pre-compute tl->mask(cpu) outside the for_each_cpu()?

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ