Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too

From: Peter Zijlstra
Date: Fri Jan 20 2017 - 11:53:53 EST


On Fri, Jan 20, 2017 at 11:14:25AM -0500, Steven Rostedt wrote:
> > OK, so I hate this patch because it makes the condition more complex,
> > and while staring at what it does for code generation I couldn't for the
> > life of me figure out why we care about prev->sched_class to begin with.
>
> I was thinking it would save on checking the rq at all, but rq is used
> by pick_next_task_*() anyway, so I doubt it's much savings.

fwiw, code generation adds something like:

CMP imm32, reg
JE imm8

So the overhead is not immense, something like 7-8 bytes, but still,
less is more :-)