Re: [PATCH v2] futex: replace bare barrier() with a READ_ONCE()

From: Jianyu Zhan
Date: Wed Mar 02 2016 - 08:57:18 EST


On Wed, Mar 2, 2016 at 9:35 PM, Christian Borntraeger
<borntraeger@xxxxxxxxxx> wrote:
> That change makes sense. I did the original barrier back in 2006 (could you cc me next time?)

Sorry for that, I thought get_maintainer.pl would had spit the
original author's email, but apparently it didn't :(

> ACCESS_ONCE or READ_ONCE was not available at that time and its now the better way.
>
> This is not an s390 specific problem, it was just triggered there as the gcc cost model
> considered the memory read as cheap as a register read.
>

Thanks for the clarification.

> Maybe simplify the comment to something like
>
> /* Prevent the compiler to read lock_ptr twice (if and spin_lock) */

Will do.


Regards,
Jianyu Zhan