Optimization in pick_next_task

From: Rasmus Villemoes
Date: Thu Nov 28 2019 - 02:46:40 EST


In kernel/sched/core.c, we have

/*
* Optimization: we know that if all tasks are in the fair class
we can
* call that function directly,

But then the code goes on to do

p = fair_sched_class.pick_next_task(rq, prev, rf);
...
if (unlikely(!p))
p = idle_sched_class.pick_next_task(rq, prev, rf);

which still loads a function pointer and calls
pick_next_task_{fair,idle} through that. Should those be made extern and
used here, or am I misinterpreting what "directly" refers to?

Rasmus