diff options
author | Youquan Song <youquan.song@intel.com> | 2012-10-26 06:26:59 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-14 18:34:20 -0500 |
commit | d73d68dc49e09143e8e3bef10670a021c26ec4a5 (patch) | |
tree | 1efde05ffcfcbe38ac3cb6900c8f01b70d0ec066 /drivers | |
parent | e11538d1f03914eb92af5a1a378375c05ae8520c (diff) |
cpuidle: Set residency to 0 if target Cstate not enter
When cpuidle governor choose a C-state to enter for idle CPU, but it notice that
there is tasks request to be executed. So the idle CPU will not really enter
the target C-state and go to run task.
In this situation, it will use the residency of previous really entered target
C-states. Obviously, it is not reasonable.
So, this patch fix it by set the target C-state residency to 0.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index f4b8fc50c0f2..ce4cac706dd1 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -144,6 +144,10 @@ int cpuidle_idle_call(void) | |||
144 | /* ask the governor for the next state */ | 144 | /* ask the governor for the next state */ |
145 | next_state = cpuidle_curr_governor->select(drv, dev); | 145 | next_state = cpuidle_curr_governor->select(drv, dev); |
146 | if (need_resched()) { | 146 | if (need_resched()) { |
147 | dev->last_residency = 0; | ||
148 | /* give the governor an opportunity to reflect on the outcome */ | ||
149 | if (cpuidle_curr_governor->reflect) | ||
150 | cpuidle_curr_governor->reflect(dev, next_state); | ||
147 | local_irq_enable(); | 151 | local_irq_enable(); |
148 | return 0; | 152 | return 0; |
149 | } | 153 | } |