2019-11-28 07:51:27

by Rasmus Villemoes

[permalink] [raw]
Subject: Optimization in pick_next_task

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