]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched_ext: Guard cpu_smt_mask() with CONFIG_SCHED_SMT
authorAndrea Righi <arighi@nvidia.com>
Sun, 22 Mar 2026 06:51:46 +0000 (07:51 +0100)
committerTejun Heo <tj@kernel.org>
Sun, 22 Mar 2026 20:02:49 +0000 (10:02 -1000)
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>
Reviewed-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext_idle.c

index d9596427b5aa1b45bb3d50d44918bf7a7e072928..857d8e902b448d1a94c908957f1dc0fba2507de5 100644 (file)
@@ -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.