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: <20250826082404.GF3245006@noisy.programming.kicks-ass.net>
Date: Tue, 26 Aug 2025 10:24:04 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: K Prateek Nayak <kprateek.nayak@....com>,
	Madhavan Srinivasan <maddy@...ux.ibm.com>,
	Michael Ellerman <mpe@...erman.id.au>,
	Nicholas Piggin <npiggin@...il.com>,
	Heiko Carstens <hca@...ux.ibm.com>,
	Vasily Gorbik <gor@...ux.ibm.com>,
	Alexander Gordeev <agordeev@...ux.ibm.com>,
	Christian Borntraeger <borntraeger@...ux.ibm.com>,
	Sven Schnelle <svens@...ux.ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	linux-s390@...r.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Valentin Schneider <vschneid@...hat.com>,
	thomas.weissschuh@...utronix.de, Li Chen <chenl311@...natelecom.cn>,
	Bibo Mao <maobibo@...ngson.cn>, Mete Durlu <meted@...ux.ibm.com>,
	Tobias Huschle <huschle@...ux.ibm.com>,
	Easwar Hariharan <easwar.hariharan@...ux.microsoft.com>,
	Guo Weikang <guoweikang.kernel@...il.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	Brian Gerst <brgerst@...il.com>,
	Patryk Wlazlyn <patryk.wlazlyn@...ux.intel.com>,
	Swapnil Sapkal <swapnil.sapkal@....com>,
	"Yury Norov [NVIDIA]" <yury.norov@...il.com>,
	Sudeep Holla <sudeep.holla@....com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	Andrea Righi <arighi@...dia.com>,
	Yicong Yang <yangyicong@...ilicon.com>,
	Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
	Tim Chen <tim.c.chen@...ux.intel.com>,
	Vinicius Costa Gomes <vinicius.gomes@...el.com>
Subject: Re: [PATCH v7 5/8] sched/topology: Unify tl_smt_mask() across core
 and all arch

On Tue, Aug 26, 2025 at 10:11:40AM +0200, Christophe Leroy wrote:
> 
> 
> Le 26/08/2025 à 10:01, Peter Zijlstra a écrit :
> > > diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
> > > index 602508130c8a..d75fbb7d9667 100644
> > > --- a/include/linux/sched/topology.h
> > > +++ b/include/linux/sched/topology.h
> > > @@ -37,7 +37,13 @@ static inline int cpu_smt_flags(void)
> > >   {
> > >   	return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC;
> > >   }
> > > -#endif
> > > +
> > > +static const __maybe_unused
> > > +struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
> > > +{
> > > +	return cpu_smt_mask(cpu);
> > > +}
> > > +#endif /* CONFIG_SCHED_SMT */
> > 
> > Problem with that __maybe_unused is that you forgot inline.
> > 
> > static inline const
> > struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
> > {
> > 	return cpu_smt_mask(cpu);
> > }
> > 
> > seems to make it happy.
> > 
> 
> But the function is referenced by SDTL_INIT() macro so there is no real
> point in declaring it inline. Would be cleaner to have it defined in a C
> file.

Ah, that's what you mean. I was more focussed on getting rid of that
horrible __maybe_unused and then either works. But yes, perhaps just
having them in a .c file is best.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ