cpuidle: Reject idle entry if need_resched() is true
There's no reason to enter idle at this point in __CPU_PM_CPU_IDLE_ENTER() if the CPU needs to reschedule. Instead of fruitlessly entering the architecture's idle routine, reject the idle entry attempt with an error as an optimization. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
1b23bb6575
commit
09f69d7d5f
1 changed files with 3 additions and 1 deletions
|
@ -286,7 +286,9 @@ extern s64 cpuidle_governor_latency_req(unsigned int cpu);
|
|||
({ \
|
||||
int __ret = 0; \
|
||||
\
|
||||
if (!idx) { \
|
||||
if (need_resched()) { \
|
||||
__ret = -1; \
|
||||
} else if (!idx) { \
|
||||
cpu_do_idle(); \
|
||||
return idx; \
|
||||
} \
|
||||
|
|
Loading…
Reference in a new issue