Skip to content

Commit

Permalink
intel_idle: simplify test for leave_mm()
Browse files Browse the repository at this point in the history
A run-time test to invoke leave_mm() for the deepest
supported C-state is redundant, since the appropriate
C-states already have flags with CPUIDLE_FLAG_TLB_FLUSHED set.

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown committed Oct 16, 2010
1 parent cd07202 commit c8381cc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,10 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
local_irq_disable();

/*
* If the state flag indicates that the TLB will be flushed or if this
* is the deepest c-state supported, do a voluntary leave mm to avoid
* costly and mostly unnecessary wakeups for flushing the user TLB's
* associated with the active mm.
* 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 ||
(&dev->states[dev->state_count - 1] == state))
if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED)
leave_mm(cpu);

if (!(lapic_timer_reliable_states & (1 << (cstate))))
Expand Down

0 comments on commit c8381cc

Please sign in to comment.