[PATCH sched_ext/for-7.1] sched_ext: Guard cpu_smt_mask() with CONFIG_SCHED_SMT

Andrea Righi posted 1 patch 1 week, 5 days ago
kernel/sched/ext_idle.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH sched_ext/for-7.1] sched_ext: Guard cpu_smt_mask() with CONFIG_SCHED_SMT
Posted by Andrea Righi 1 week, 5 days ago
Wrap cpu_smt_mask() usage with CONFIG_SCHED_SMT to avoid build failures
on kernels built without SMT support.

Fixes: 2197cecdb02c ("sched_ext: idle: Prioritize idle SMT sibling")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603221422.XIueJOE9-lkp@intel.com/
Signed-off-by: Andrea Righi <arighi@nvidia.com>
---
 kernel/sched/ext_idle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
index d9596427b5aa1..857d8e902b448 100644
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -622,6 +622,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
 		goto out_unlock;
 	}
 
+#ifdef CONFIG_SCHED_SMT
 	/*
 	 * Use @prev_cpu's sibling if it's idle.
 	 */
@@ -633,6 +634,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
 				goto out_unlock;
 		}
 	}
+#endif
 
 	/*
 	 * Search for any idle CPU in the same LLC domain.
-- 
2.53.0
Re: [PATCH sched_ext/for-7.1] sched_ext: Guard cpu_smt_mask() with CONFIG_SCHED_SMT
Posted by Tejun Heo 1 week, 5 days ago
Applied to sched_ext/for-7.1.

Thanks.

--
tejun
Re: [PATCH sched_ext/for-7.1] sched_ext: Guard cpu_smt_mask() with CONFIG_SCHED_SMT
Posted by Cheng-Yang Chou 1 week, 5 days ago
Hi Andrea,

On Sun, Mar 22, 2026 at 07:51:46AM +0100, Andrea Righi wrote:
> Wrap cpu_smt_mask() usage with CONFIG_SCHED_SMT to avoid build failures
> on kernels built without SMT support.
> 
> Fixes: 2197cecdb02c ("sched_ext: idle: Prioritize idle SMT sibling")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202603221422.XIueJOE9-lkp@intel.com/
> Signed-off-by: Andrea Righi <arighi@nvidia.com>
> ---
>  kernel/sched/ext_idle.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c
> index d9596427b5aa1..857d8e902b448 100644
> --- a/kernel/sched/ext_idle.c
> +++ b/kernel/sched/ext_idle.c
> @@ -622,6 +622,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
>  		goto out_unlock;
>  	}
>  
> +#ifdef CONFIG_SCHED_SMT
>  	/*
>  	 * Use @prev_cpu's sibling if it's idle.
>  	 */
> @@ -633,6 +634,7 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
>  				goto out_unlock;
>  		}
>  	}
> +#endif
>  
>  	/*
>  	 * Search for any idle CPU in the same LLC domain.
> -- 
> 2.53.0
> 

Tested with the robot's config and the error is gone.

Reviewed-by: Cheng-Yang Chou <yphbchou0911@gmail.com>

-- 
Thanks,
Cheng-Yang