Re: [PATCH v4 2/5] locking/rwsem: Protect all writes to owner by WRITE_ONCE

From: Davidlohr Bueso
Date: Mon May 23 2016 - 17:05:12 EST


On Mon, 23 May 2016, Paul E. McKenney wrote:

But rcu_read_lock() does not exclude updates, which is one reason why
pointer reads use rcu_dereference() rather than normal assignments.

Yes, I was referring to readers. With updates, otoh, are done holding a number of locks.


So I do not believe that rcu_read_lock() is helping you in this case.

That said, it is a bit hard to imagine the compiler tearing a load from
an int...

Oh, right, good point.

Thanks,
Davidlohr