[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-84c407084137d4e491b07ea5ff8665d19106a5ac@git.kernel.org>
Date: Thu, 5 Jun 2014 07:37:07 -0700
From: tip-bot for Andy Lutomirski <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
torvalds@...ux-foundation.org, peterz@...radead.org,
luto@...capital.net, tglx@...utronix.de, rjw@...ysocki.net,
daniel.lezcano@...aro.org
Subject: [tip:sched/core] cpuidle: Set polling in poll_idle
Commit-ID: 84c407084137d4e491b07ea5ff8665d19106a5ac
Gitweb: http://git.kernel.org/tip/84c407084137d4e491b07ea5ff8665d19106a5ac
Author: Andy Lutomirski <luto@...capital.net>
AuthorDate: Wed, 4 Jun 2014 10:31:14 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 5 Jun 2014 12:09:49 +0200
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 <luto@...capital.net>
Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Cc: nicolas.pitre@...aro.org
Cc: umgwanakikbuti@...il.com
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Rafael J. Wysocki <rjw@...ysocki.net>
Cc: linux-kernel@...r.kernel.org
Cc: linux-pm@...r.kernel.org
Link: http://lkml.kernel.org/r/c65ce49615d338bae8fb79df5daffab19353c900.1401902905.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
drivers/cpuidle/driver.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 136d6a2..9634f20 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -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));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists