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

Message ID e64678a22c57d572dcac20a0d492d406d56bf881.1688770494.git.tim.c.chen@linux.intel.com
State New
Headers
Series Enable Cluster Scheduling for x86 Hybrid CPUs |

Commit Message

Tim Chen July 7, 2023, 10:57 p.m. UTC
  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(+)
  

Comments

Peter Zijlstra July 8, 2023, 12:31 p.m. UTC | #1
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){
  
Tim Chen July 10, 2023, 4:13 p.m. UTC | #2
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){
  

Patch

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