* [RFC PATCH] cpuidle: avoid unnecessary expensive governor processing
@ 2012-03-07 3:42 Robert Lee
0 siblings, 0 replies; only message in thread
From: Robert Lee @ 2012-03-07 3:42 UTC (permalink / raw)
To: linux-arm-kernel
There a few cases when a platform's cpuidle_device will only have one
cpuidle state. e.g., when a single idle state system uses cpuidle
to provide sysfs staticstics for profiling (powertop, etc). This can
also be the case for coupled smp system implementations that keep
all but one cpuidle_device at a state_count of 1, but they still want
to export idle statistics for these states using cpuidle.
Signed-off-by: Robert Lee <rob.lee@linaro.org>
---
drivers/cpuidle/governors/ladder.c | 7 +++++--
| 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index b6a09ea..13abdba 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -71,8 +71,11 @@ static int ladder_select_state(struct cpuidle_driver *drv,
int last_residency, last_idx = ldev->last_state_idx;
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
- /* Special case when user has set very strict latency requirement */
- if (unlikely(latency_req == 0)) {
+ /*
+ * Special case when user has set very strict latency requirement or
+ * there is currently only one state for this device.
+ */
+ if ((latency_req == 0) || (dev->state_count == 1)) {
ladder_do_selection(ldev, last_idx, 0);
return 0;
}
--git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index ad09526..80eb606 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -249,8 +249,11 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
data->last_state_idx = 0;
data->exit_us = 0;
- /* Special case when user has set very strict latency requirement */
- if (unlikely(latency_req == 0))
+ /*
+ * Special case when user has set very strict latency requirement or
+ * there is currently only one state for this device.
+ */
+ if ((latency_req == 0) || (dev->state_count == 1))
return 0;
/* determine the expected residency time, round up */
--
1.7.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-07 3:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 3:42 [RFC PATCH] cpuidle: avoid unnecessary expensive governor processing Robert Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).