Messages in this thread | | | Date | Thu, 18 Jul 2013 01:31:21 +0200 | From | Frederic Weisbecker <> | Subject | Re: [PATCH RFC nohz_full 6/7] nohz_full: Add full-system-idle state machine |
| |
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?
| |