mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
cpuidle: powernv: Avoid a branch in the core snooze_loop() loop
When in the snooze_loop() we want to take up the least amount of resources. On my version of gcc (6.3), we end up with an extra branch because it predicts snooze_timeout_en to be false, whereas it is almost always true. Use likely() to avoid the branch and be a little nicer to the other non idle threads on the core. Signed-off-by: Anton Blanchard <[email protected]> Reviewed-by: Vaidyanathan Srinivasan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
26eb48a9fa
commit
0baa91cb73
1 changed files with 1 additions and 1 deletions
|
|
@ -58,7 +58,7 @@ static int snooze_loop(struct cpuidle_device *dev,
|
|||
ppc64_runlatch_off();
|
||||
HMT_very_low();
|
||||
while (!need_resched()) {
|
||||
if (snooze_timeout_en && get_tb() > snooze_exit_time)
|
||||
if (likely(snooze_timeout_en) && get_tb() > snooze_exit_time)
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue