[Patch v3 5/6] sched/x86: Add cluster topology to hybrid CPU

Tim Chen posted 6 patches 2 years, 7 months ago
[Patch v3 5/6] sched/x86: Add cluster topology to hybrid CPU
Posted by Tim Chen 2 years, 7 months ago
From: Tim C Chen <tim.c.chen@linux.intel.com>

Cluster topology was not enabled on hybrid x86 CPU as load balance
was not properly working for cluster domain.  That has been fixed and
cluster domain can be enabled for hybrid CPU.

Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
 arch/x86/kernel/smpboot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index cea297d97034..2489d767c398 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -575,6 +575,9 @@ static struct sched_domain_topology_level x86_hybrid_topology[] = {
 #ifdef CONFIG_SCHED_SMT
 	{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
 #endif
+#ifdef CONFIG_SCHED_CLUSTER
+	{ cpu_clustergroup_mask, x86_cluster_flags, SD_INIT_NAME(CLS) },
+#endif
 #ifdef CONFIG_SCHED_MC
 	{ cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
 #endif
-- 
2.32.0
Re: [Patch v3 5/6] sched/x86: Add cluster topology to hybrid CPU
Posted by Peter Zijlstra 2 years, 7 months ago
On Fri, Jul 07, 2023 at 03:57:04PM -0700, Tim Chen wrote:
> From: Tim C Chen <tim.c.chen@linux.intel.com>
> 
> Cluster topology was not enabled on hybrid x86 CPU as load balance
> was not properly working for cluster domain.  That has been fixed and
> cluster domain can be enabled for hybrid CPU.
> 
> Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
> Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>

Yeah, you didn't actually try appling this to something recent did ya
:-)

You missed 8f2d6c41e5a6 ("x86/sched: Rewrite topology setup").

I'll replace this patch with the below.

---
 arch/x86/kernel/smpboot.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ed2d51960a7d..3b751d79cdfb 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -632,14 +632,9 @@ static void __init build_sched_topology(void)
 	};
 #endif
 #ifdef CONFIG_SCHED_CLUSTER
-	/*
-	 * For now, skip the cluster domain on Hybrid.
-	 */
-	if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) {
-		x86_topology[i++] = (struct sched_domain_topology_level){
-			cpu_clustergroup_mask, x86_cluster_flags, SD_INIT_NAME(CLS)
-		};
-	}
+	x86_topology[i++] = (struct sched_domain_topology_level){
+		cpu_clustergroup_mask, x86_cluster_flags, SD_INIT_NAME(CLS)
+	};
 #endif
 #ifdef CONFIG_SCHED_MC
 	x86_topology[i++] = (struct sched_domain_topology_level){
Re: [Patch v3 5/6] sched/x86: Add cluster topology to hybrid CPU
Posted by Tim Chen 2 years, 7 months ago
On Sat, 2023-07-08 at 14:31 +0200, Peter Zijlstra wrote:
> On Fri, Jul 07, 2023 at 03:57:04PM -0700, Tim Chen wrote:
> > From: Tim C Chen <tim.c.chen@linux.intel.com>
> > 
> > Cluster topology was not enabled on hybrid x86 CPU as load balance
> > was not properly working for cluster domain.  That has been fixed and
> > cluster domain can be enabled for hybrid CPU.
> > 
> > Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
> > Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
> 
> Yeah, you didn't actually try appling this to something recent did ya
> :-)
> 
> You missed 8f2d6c41e5a6 ("x86/sched: Rewrite topology setup").
> 
> I'll replace this patch with the below.

Thanks for catching it.

Tim

> 
> ---
>  arch/x86/kernel/smpboot.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
> index ed2d51960a7d..3b751d79cdfb 100644
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -632,14 +632,9 @@ static void __init build_sched_topology(void)
>  	};
>  #endif
>  #ifdef CONFIG_SCHED_CLUSTER
> -	/*
> -	 * For now, skip the cluster domain on Hybrid.
> -	 */
> -	if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) {
> -		x86_topology[i++] = (struct sched_domain_topology_level){
> -			cpu_clustergroup_mask, x86_cluster_flags, SD_INIT_NAME(CLS)
> -		};
> -	}
> +	x86_topology[i++] = (struct sched_domain_topology_level){
> +		cpu_clustergroup_mask, x86_cluster_flags, SD_INIT_NAME(CLS)
> +	};
>  #endif
>  #ifdef CONFIG_SCHED_MC
>  	x86_topology[i++] = (struct sched_domain_topology_level){