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: <29c26faf-98da-42fa-9408-0e0d2932bb13@csgroup.eu>
Date: Tue, 26 Aug 2025 07:15:50 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: 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>, Peter Zijlstra <peterz@...radead.org>,
 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
Cc: 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 7/8] sched/topology: Unify tl_mc_mask() across core and
 all arch



Le 26/08/2025 à 06:13, K Prateek Nayak a écrit :
> Unify the tl_mc_mask() wrapper around cpu_coregroup_mask() used by core,
> x86, powerpc, and s390.
> 
> No functional changes intended.
> 
> Signed-off-by: K Prateek Nayak <kprateek.nayak@....com>
> ---
>   arch/powerpc/kernel/smp.c      | 7 +------
>   arch/s390/kernel/topology.c    | 7 +------
>   arch/x86/kernel/smpboot.c      | 7 -------
>   include/linux/sched/topology.h | 8 +++++++-
>   kernel/sched/topology.c        | 7 -------
>   5 files changed, 9 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index c58ddf84fe63..40719679385b 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -1062,11 +1062,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
>   
>   	return cpu_node_mask(cpu);
>   }
> -
> -static const struct cpumask *cpu_mc_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_corgrp_mask(cpu);
> -}
>   #endif
>   
>   static const struct cpumask *cpu_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> @@ -1729,7 +1724,7 @@ static void __init build_sched_topology(void)
>   #ifdef CONFIG_SCHED_MC
>   	if (has_coregroup_support()) {
>   		powerpc_topology[i++] =
> -			SDTL_INIT(cpu_mc_mask, powerpc_shared_proc_flags, MC);
> +			SDTL_INIT(tl_mc_mask, powerpc_shared_proc_flags, MC);
>   	}
>   #endif
>   
> diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
> index c88eda847309..8dbf32f362e1 100644
> --- a/arch/s390/kernel/topology.c
> +++ b/arch/s390/kernel/topology.c
> @@ -514,11 +514,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
>   	return &cpu_topology[cpu].core_mask;
>   }
>   
> -static const struct cpumask *cpu_mc_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return &cpu_topology[cpu].core_mask;
> -}
> -
>   static const struct cpumask *cpu_book_mask(struct sched_domain_topology_level *tl, int cpu)
>   {
>   	return &cpu_topology[cpu].book_mask;
> @@ -536,7 +531,7 @@ static const struct cpumask *cpu_pkg_mask(struct sched_domain_topology_level *tl
>   
>   static struct sched_domain_topology_level s390_topology[] = {
>   	SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
> -	SDTL_INIT(cpu_mc_mask, cpu_core_flags, MC),
> +	SDTL_INIT(tl_mc_mask, cpu_core_flags, MC),
>   	SDTL_INIT(cpu_book_mask, NULL, BOOK),
>   	SDTL_INIT(cpu_drawer_mask, NULL, DRAWER),
>   	SDTL_INIT(cpu_pkg_mask, NULL, PKG),
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index 81a40d777d65..bfbcac9a73d1 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -472,13 +472,6 @@ static int x86_cluster_flags(void)
>   }
>   #endif
>   
> -#ifdef CONFIG_SCHED_MC
> -static const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_coregroup_mask(cpu);
> -}
> -#endif
> -
>   static const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
>   {
>   	return cpu_node_mask(cpu);
> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
> index e54501cc8e47..075d1f063668 100644
> --- a/include/linux/sched/topology.h
> +++ b/include/linux/sched/topology.h
> @@ -63,7 +63,13 @@ static inline int cpu_core_flags(void)
>   {
>   	return SD_SHARE_LLC;
>   }
> -#endif
> +
> +static const __maybe_unused

Same as the two previous patches, __maybe_unused shouldn't be required.

> +struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
> +{
> +	return cpu_coregroup_mask(cpu);
> +}
> +#endif /* CONFIG_SCHED_MC */
>   
>   #ifdef CONFIG_NUMA
>   static inline int cpu_numa_flags(void)
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 4530cbad41e1..77d14430c5e1 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -1724,13 +1724,6 @@ sd_init(struct sched_domain_topology_level *tl,
>   	return sd;
>   }
>   
> -#ifdef CONFIG_SCHED_MC
> -static const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_coregroup_mask(cpu);
> -}
> -#endif
> -
>   static const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
>   {
>   	return cpu_node_mask(cpu);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ