cpuidle: check for need_resched() after the idle entry trace event
trace_cpu_idle_rcuidle() can end up waking ksoftirqd under certain
conditions. Since there is no check for need_resched() following
this wake up, the cpu ends up going into an idle state despite there
being a runnable task on that runqueue. Furthermore, since the
resched flag is set, any sucessive waking up tasks on the idle cpu
will not result in an IPI being sent to that cpu. Consequently tasks
on that runqueue will starve until the cpu exits idle by itself. Fix
this problem by adding a need_resched() check after the idle entry
trace event.
A side effect of this change is that the idle trace entry and exit
event may be recorded for an extremely short duration even though
the cpu does not actually enter idle.
Change-Id: I370c39a1e39ecd829e44ac783b4888a00ab05eae
Signed-off-by:
Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Loading
Please register or sign in to comment