diff options
| author | Robert Richter <robert.richter@amd.com> | 2010-10-15 06:45:00 -0400 |
|---|---|---|
| committer | Robert Richter <robert.richter@amd.com> | 2010-10-15 06:45:00 -0400 |
| commit | 6268464b370e234e0255330190f9bd5d19386ad7 (patch) | |
| tree | 5742641092ce64227dd2086d78baaede57da1f80 /drivers/idle/intel_idle.c | |
| parent | 7df01d96b295e400167e78061b81d4c91630b12d (diff) | |
| parent | 0fdf13606b67f830559abdaad15980c7f4f05ec4 (diff) | |
Merge remote branch 'tip/perf/core' into oprofile/core
Conflicts:
arch/arm/oprofile/common.c
kernel/perf_event.c
Diffstat (limited to 'drivers/idle/intel_idle.c')
| -rw-r--r--[-rwxr-xr-x] | drivers/idle/intel_idle.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index a10152bb1427..0906fc5b69b9 100755..100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -83,7 +83,7 @@ static unsigned int mwait_substates; | |||
| 83 | /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ | 83 | /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ |
| 84 | static unsigned int lapic_timer_reliable_states; | 84 | static unsigned int lapic_timer_reliable_states; |
| 85 | 85 | ||
| 86 | static struct cpuidle_device *intel_idle_cpuidle_devices; | 86 | static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; |
| 87 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); | 87 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); |
| 88 | 88 | ||
| 89 | static struct cpuidle_state *cpuidle_state_table; | 89 | static struct cpuidle_state *cpuidle_state_table; |
| @@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 108 | .name = "NHM-C3", | 108 | .name = "NHM-C3", |
| 109 | .desc = "MWAIT 0x10", | 109 | .desc = "MWAIT 0x10", |
| 110 | .driver_data = (void *) 0x10, | 110 | .driver_data = (void *) 0x10, |
| 111 | .flags = CPUIDLE_FLAG_TIME_VALID, | 111 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 112 | .exit_latency = 20, | 112 | .exit_latency = 20, |
| 113 | .power_usage = 500, | 113 | .power_usage = 500, |
| 114 | .target_residency = 80, | 114 | .target_residency = 80, |
| @@ -117,7 +117,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 117 | .name = "NHM-C6", | 117 | .name = "NHM-C6", |
| 118 | .desc = "MWAIT 0x20", | 118 | .desc = "MWAIT 0x20", |
| 119 | .driver_data = (void *) 0x20, | 119 | .driver_data = (void *) 0x20, |
| 120 | .flags = CPUIDLE_FLAG_TIME_VALID, | 120 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 121 | .exit_latency = 200, | 121 | .exit_latency = 200, |
| 122 | .power_usage = 350, | 122 | .power_usage = 350, |
| 123 | .target_residency = 800, | 123 | .target_residency = 800, |
| @@ -149,7 +149,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 149 | .name = "ATM-C4", | 149 | .name = "ATM-C4", |
| 150 | .desc = "MWAIT 0x30", | 150 | .desc = "MWAIT 0x30", |
| 151 | .driver_data = (void *) 0x30, | 151 | .driver_data = (void *) 0x30, |
| 152 | .flags = CPUIDLE_FLAG_TIME_VALID, | 152 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 153 | .exit_latency = 100, | 153 | .exit_latency = 100, |
| 154 | .power_usage = 250, | 154 | .power_usage = 250, |
| 155 | .target_residency = 400, | 155 | .target_residency = 400, |
| @@ -159,7 +159,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
| 159 | .name = "ATM-C6", | 159 | .name = "ATM-C6", |
| 160 | .desc = "MWAIT 0x40", | 160 | .desc = "MWAIT 0x40", |
| 161 | .driver_data = (void *) 0x40, | 161 | .driver_data = (void *) 0x40, |
| 162 | .flags = CPUIDLE_FLAG_TIME_VALID, | 162 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED, |
| 163 | .exit_latency = 200, | 163 | .exit_latency = 200, |
| 164 | .power_usage = 150, | 164 | .power_usage = 150, |
| 165 | .target_residency = 800, | 165 | .target_residency = 800, |
| @@ -185,6 +185,16 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) | |||
| 185 | 185 | ||
| 186 | local_irq_disable(); | 186 | local_irq_disable(); |
| 187 | 187 | ||
| 188 | /* | ||
| 189 | * If the state flag indicates that the TLB will be flushed or if this | ||
| 190 | * is the deepest c-state supported, do a voluntary leave mm to avoid | ||
| 191 | * costly and mostly unnecessary wakeups for flushing the user TLB's | ||
| 192 | * associated with the active mm. | ||
| 193 | */ | ||
| 194 | if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED || | ||
| 195 | (&dev->states[dev->state_count - 1] == state)) | ||
| 196 | leave_mm(cpu); | ||
| 197 | |||
| 188 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) | 198 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) |
| 189 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); | 199 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu); |
| 190 | 200 | ||
