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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <154fd466-5305-431f-b49a-a5ccec81507a@csgroup.eu>
Date: Tue, 26 Aug 2025 07:16:25 +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 8/8] sched/topology: Unify tl_pkg_mask() across core
 and all arch



Le 26/08/2025 à 06:13, K Prateek Nayak a écrit :
> Unify the tl_pkg_mask() wrapper around cpu_nod_mask() across 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      | 5 -----
>   include/linux/sched/topology.h | 6 ++++++
>   kernel/sched/topology.c        | 5 -----
>   5 files changed, 8 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 40719679385b..8e869c13f7ed 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -1064,11 +1064,6 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
>   }
>   #endif
>   
> -static const struct cpumask *cpu_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_node_mask(cpu);
> -}
> -
>   static int __init init_big_cores(void)
>   {
>   	int cpu;
> @@ -1728,7 +1723,7 @@ static void __init build_sched_topology(void)
>   	}
>   #endif
>   
> -	powerpc_topology[i++] = SDTL_INIT(cpu_pkg_mask, powerpc_shared_proc_flags, PKG);
> +	powerpc_topology[i++] = SDTL_INIT(tl_pkg_mask, powerpc_shared_proc_flags, PKG);
>   
>   	/* There must be one trailing NULL entry left.  */
>   	BUG_ON(i >= ARRAY_SIZE(powerpc_topology) - 1);
> diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
> index 8dbf32f362e1..8f5b6ecc055f 100644
> --- a/arch/s390/kernel/topology.c
> +++ b/arch/s390/kernel/topology.c
> @@ -524,17 +524,12 @@ static const struct cpumask *cpu_drawer_mask(struct sched_domain_topology_level
>   	return &cpu_topology[cpu].drawer_mask;
>   }
>   
> -static const struct cpumask *cpu_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_node_mask(cpu);
> -}
> -
>   static struct sched_domain_topology_level s390_topology[] = {
>   	SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
>   	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),
> +	SDTL_INIT(tl_pkg_mask, NULL, PKG),
>   	{ NULL, },
>   };
>   
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index bfbcac9a73d1..6c0ab30a80e2 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -472,11 +472,6 @@ static int x86_cluster_flags(void)
>   }
>   #endif
>   
> -static const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_node_mask(cpu);
> -}
> -
>   /*
>    * Set if a package/die has multiple NUMA nodes inside.
>    * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
> diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
> index 075d1f063668..807603bfe8ff 100644
> --- a/include/linux/sched/topology.h
> +++ b/include/linux/sched/topology.h
> @@ -71,6 +71,12 @@ struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
>   }
>   #endif /* CONFIG_SCHED_MC */
>   
> +static const __maybe_unused

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

> +struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> +{
> +	return cpu_node_mask(cpu);
> +}
> +
>   #ifdef CONFIG_NUMA
>   static inline int cpu_numa_flags(void)
>   {
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 77d14430c5e1..18889bd97e22 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -1724,11 +1724,6 @@ sd_init(struct sched_domain_topology_level *tl,
>   	return sd;
>   }
>   
> -static const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
> -{
> -	return cpu_node_mask(cpu);
> -}
> -
>   /*
>    * Topology list, bottom-up.
>    */


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ