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]
Message-ID: <ZqqV5OxZPHUgjhag@LeoBras>
Date: Wed, 31 Jul 2024 16:52:05 -0300
From: Leonardo Bras <leobras@...hat.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Leonardo Bras <leobras@...hat.com>,
	Yury Norov <yury.norov@...il.com>,
	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,
	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()

On Tue, May 14, 2024 at 10:53:00PM +0200, Christophe JAILLET wrote:
> 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()?

Looks like a good idea to me.

Leo 

> 
> CJ
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ