mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
cpuidle: Set polling in poll_idle
poll_idle is the archetypal polling idle loop; tell the core idle code about it. This avoids pointless IPIs when all of the other cpuidle states are disabled. Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Daniel Lezcano <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/c65ce49615d338bae8fb79df5daffab19353c900.1401902905.git.luto@amacapital.net Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
0b07939cbf
commit
84c4070841
1 changed files with 5 additions and 2 deletions
|
|
@ -187,8 +187,11 @@ static int poll_idle(struct cpuidle_device *dev,
|
|||
|
||||
t1 = ktime_get();
|
||||
local_irq_enable();
|
||||
while (!need_resched())
|
||||
cpu_relax();
|
||||
if (!current_set_polling_and_test()) {
|
||||
while (!need_resched())
|
||||
cpu_relax();
|
||||
}
|
||||
current_clr_polling();
|
||||
|
||||
t2 = ktime_get();
|
||||
diff = ktime_to_us(ktime_sub(t2, t1));
|
||||
|
|
|
|||
Loading…
Reference in a new issue