]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/idle/intel_idle.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[mirror_ubuntu-bionic-kernel.git] / drivers / idle / intel_idle.c
index 5dc7ea4b6bc4cc207cffd8d8efbaed776179c9d9..f0b06b14e782b5b926b5ba7876d827551ce4cfa9 100644 (file)
@@ -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();