Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/fair: Define sched_idle_cpu() only for SMP configurations

sched_idle_cpu() isn't used for non SMP configuration and with a recent
change, we have started getting following warning:

kernel/sched/fair.c:5221:12: warning: ‘sched_idle_cpu’ defined but not used [-Wunused-function]

Fix that by defining sched_idle_cpu() only for SMP configurations.

Fixes: 323af6deaf70 ("sched/fair: Load balance aggressively for SCHED_IDLE CPUs")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Link: https://lore.kernel.org/r/f0554f590687478b33914a4aff9f0e6a62886d44.1579499907.git.viresh.kumar@linaro.org

authored by

Viresh Kumar and committed by
Ingo Molnar
afa70d94 ccf74128

+2
+2
kernel/sched/fair.c
··· 5218 5218 rq->nr_running); 5219 5219 } 5220 5220 5221 + #ifdef CONFIG_SMP 5221 5222 static int sched_idle_cpu(int cpu) 5222 5223 { 5223 5224 return sched_idle_rq(cpu_rq(cpu)); 5224 5225 } 5226 + #endif 5225 5227 5226 5228 /* 5227 5229 * The enqueue_task method is called before nr_running is