Skip to content

Commit

Permalink
cpuidle: Make ladder governor honor latency requirements fully
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
venkatesh.pallipadi@intel.com authored and Andi Kleen committed Aug 15, 2008
1 parent 320eee7 commit 06d9e90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/cpuidle/governors/ladder.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ static int ladder_select_state(struct cpuidle_device *dev)
}

/* consider demotion */
if (last_idx > CPUIDLE_DRIVER_STATE_START &&
dev->states[last_idx].exit_latency > latency_req) {
int i;

for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
if (dev->states[i].exit_latency <= latency_req)
break;
}
ladder_do_selection(ldev, last_idx, i);
return i;
}

if (last_idx > CPUIDLE_DRIVER_STATE_START &&
last_residency < last_state->threshold.demotion_time) {
last_state->stats.demotion_count++;
Expand Down

0 comments on commit 06d9e90

Please sign in to comment.