On Mon, Jul 08, 2013 at 06:30:05PM -0700, Paul E. McKenney wrote: > } > > /* > + * Unconditionally force exit from full system-idle state. This is > + * invoked when a normal CPU exits idle, but must be called separately > + * for the timekeeping CPU (tick_do_timer_cpu). The reason for this > + * is that the timekeeping CPU is permitted to take scheduling-clock > + * interrupts while the system is in system-idle state, and of course > + * rcu_sysidle_exit() has no way of distinguishing a scheduling-clock > + * interrupt from any other type of interrupt. > + */ > +void rcu_sysidle_force_exit(void) > +{ > + int oldstate = ACCESS_ONCE(full_sysidle_state); > + int newoldstate; > + > + /* > + * Each pass through the following loop attempts to exit full > + * system-idle state. If contention proves to be a problem, > + * a trylock-based contention tree could be used here. > + */ > + while (oldstate > RCU_SYSIDLE_SHORT) {
I'm missing a key here. Let's imagine that the timekeeper has finally set full_sysidle_state = RCU_SYSIDLE_FULL_NOTED with cmpxchg, what guarantees that this CPU is not seeing a stale RCU_SYSIDLE_SHORT value for example? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/