]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched_ext: idle: Remove unnecessary ifdef in scx_bpf_cpu_node()
authorAndrea Righi <arighi@nvidia.com>
Wed, 4 Jun 2025 14:33:11 +0000 (16:33 +0200)
committerTejun Heo <tj@kernel.org>
Mon, 9 Jun 2025 16:25:02 +0000 (06:25 -1000)
There's no need to make scx_bpf_cpu_node() dependent on CONFIG_NUMA,
since cpu_to_node() can be used also in systems with CONFIG_NUMA
disabled.

This also allows to always validate the @cpu argument regardless of the
CONFIG_NUMA settings.

Fixes: 01059219b0cfd ("sched_ext: idle: Introduce node-aware idle cpu kfunc helpers")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext_idle.c

index 6d29d3cbc6707c1630ab3e1cee5a529c0d9fe56f..1598681b681e7ee4f689ba07cd6dbf59eeda76fa 100644 (file)
@@ -929,14 +929,10 @@ s32 select_cpu_from_kfunc(struct task_struct *p, s32 prev_cpu, u64 wake_flags,
  */
 __bpf_kfunc int scx_bpf_cpu_node(s32 cpu)
 {
-#ifdef CONFIG_NUMA
        if (!kf_cpu_valid(cpu, NULL))
                return NUMA_NO_NODE;
 
        return cpu_to_node(cpu);
-#else
-       return 0;
-#endif
 }
 
 /**