diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-11-08 12:17:15 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-11-08 12:17:15 +0300 |
commit | 8a103df440afea30c91ebd42e61dc644e647f4bd (patch) | |
tree | 2cfa99e9c6e1e138e1404bce4294e46cb0034cce /drivers/idle/intel_idle.c | |
parent | a9903f04e0a4ea522d959c2f287cdf0ab029e324 (diff) | |
parent | fbc3edf7d7731d7a22c483c679700589bab936a3 (diff) | |
download | linux-8a103df440afea30c91ebd42e61dc644e647f4bd.tar.xz |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r-- | drivers/idle/intel_idle.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 5dc7ea4b6bc4..f0b06b14e782 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -913,15 +913,16 @@ static __cpuidle int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state = &drv->states[index]; unsigned long eax = flg2MWAIT(state->flags); unsigned int cstate; + int cpu = smp_processor_id(); cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; /* - * NB: if CPUIDLE_FLAG_TLB_FLUSHED is set, this idle transition - * will probably flush the TLB. It's not guaranteed to flush - * the TLB, though, so it's not clear that we can do anything - * useful with this knowledge. + * leave_mm() to avoid costly and often unnecessary wakeups + * for flushing the user TLB's associated with the active mm. */ + if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED) + leave_mm(cpu); if (!(lapic_timer_reliable_states & (1 << (cstate)))) tick_broadcast_enter(); |