aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvenkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com>2008-07-30 22:21:44 -0400
committerAndi Kleen <ak@linux.intel.com>2008-08-15 15:25:35 -0400
commit06d9e908b2248f983b186aaf569c58e1430db85d (patch)
treea72b6608c6f787df72fe34d1d58f02b4b8d1bef7
parent320eee776357db52d6fcfb11cff985b1976a4595 (diff)
cpuidle: Make ladder governor honor latency requirements fully
ladder governor only honored latency requirement when promoting C-states. Instead. it should check for latency requirement on each idle call, and demote to appropriate C-state when there is a latency requirement change. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r--drivers/cpuidle/governors/ladder.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index 27ab3bfe375b..a4bec3f919aa 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -99,6 +99,18 @@ static int ladder_select_state(struct cpuidle_device *dev)
99 99
100 /* consider demotion */ 100 /* consider demotion */
101 if (last_idx > CPUIDLE_DRIVER_STATE_START && 101 if (last_idx > CPUIDLE_DRIVER_STATE_START &&
102 dev->states[last_idx].exit_latency > latency_req) {
103 int i;
104
105 for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
106 if (dev->states[i].exit_latency <= latency_req)
107 break;
108 }
109 ladder_do_selection(ldev, last_idx, i);
110 return i;
111 }
112
113 if (last_idx > CPUIDLE_DRIVER_STATE_START &&
102 last_residency < last_state->threshold.demotion_time) { 114 last_residency < last_state->threshold.demotion_time) {
103 last_state->stats.demotion_count++; 115 last_state->stats.demotion_count++;
104 last_state->stats.promotion_count = 0; 116 last_state->stats.promotion_count = 0;