[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161205171916.GC13035@redhat.com>
Date: Mon, 5 Dec 2016 18:19:17 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Davidlohr Bueso <dave@...olabs.net>, mingo@...nel.org,
john.stultz@...aro.org, dimitrysh@...gle.com,
linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH v2 2/3] locking/percpu-rwsem: Rework writer block/wake
to not use wait-queues
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.
Powered by blists - more mailing lists