aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/governors
diff options
context:
space:
mode:
authorShuoX Liu <shuox.liu@intel.com>2012-07-03 13:05:31 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-07-03 13:05:31 -0400
commitdc7fd275ae60ef8edf952aff2a62462f5d892fd4 (patch)
tree620ffab8288830c8e8dc03b24e77fe3800d03b7e /drivers/cpuidle/governors
parent6887a4131da3adaab011613776d865f4bcfb5678 (diff)
cpuidle: move field disable from per-driver to per-cpu
Andrew J.Schorr raises a question. When he changes the disable setting on a single CPU, it affects all the other CPUs. Basically, currently, the disable field is per-driver instead of per-cpu. All the C states of the same driver are shared by all CPU in the same machine. The patch changes the `disable' field to per-cpu, so we could set this separately for each cpu. Signed-off-by: ShuoX Liu <shuox.liu@intel.com> Reported-by: Andrew J.Schorr <aschorr@telemetry-investments.com> Reviewed-by: Yanmin Zhang <yanmin_zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/cpuidle/governors')
-rw-r--r--drivers/cpuidle/governors/menu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 06335756ea14..8391d93f57d5 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -281,7 +281,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
281 * unless the timer is happening really really soon. 281 * unless the timer is happening really really soon.
282 */ 282 */
283 if (data->expected_us > 5 && 283 if (data->expected_us > 5 &&
284 drv->states[CPUIDLE_DRIVER_STATE_START].disable == 0) 284 dev->states_usage[CPUIDLE_DRIVER_STATE_START].disable == 0)
285 data->last_state_idx = CPUIDLE_DRIVER_STATE_START; 285 data->last_state_idx = CPUIDLE_DRIVER_STATE_START;
286 286
287 /* 287 /*
@@ -290,8 +290,9 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
290 */ 290 */
291 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) { 291 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
292 struct cpuidle_state *s = &drv->states[i]; 292 struct cpuidle_state *s = &drv->states[i];
293 struct cpuidle_state_usage *su = &dev->states_usage[i];
293 294
294 if (s->disable) 295 if (su->disable)
295 continue; 296 continue;
296 if (s->target_residency > data->predicted_us) 297 if (s->target_residency > data->predicted_us)
297 continue; 298 continue;