On 12/05, Peter Zijlstra wrote: > > > + for (;;) { > > + set_current_state(TASK_UNINTERRUPTIBLE); > > + > > + if (readers_active_check(sem)) > > + break; > > + > > + schedule(); > > + } > > + > > + rcu_assign_pointer(sem->writer, NULL); > > And this one does not, and the value being NULL this actually reverts to > WRITE_ONCE().
Do we really care? We do not even need WRITE_ONCE() afaics, this is like __set_current_state(TASK_RUNNING) after the main loop. We can't avoid the spurious wakeups anyway after return from percpu_down_write(). Oleg.