lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] refcount: provide same memory ordering guarantees as in atomic_t
On Thu, Nov 02, 2017 at 04:21:56PM -0400, Alan Stern wrote:
> I was trying to think of something completely different. If you have a
> release/acquire to the same address, it creates a happens-before
> ordering:
>
> Access x
> Release a
> Acquire a
> Access y
>
> Here is the access to x happens-before the access to y. This is true
> even on x86, even in the presence of forwarding -- the CPU still has to
> execute the instructions in order. But if the release and acquire are
> to different addresses:
>
> Access x
> Release a
> Acquire b
> Access y
>
> then there is no happens-before ordering for x and y -- the CPU can
> execute the last two instructions before the first two. x86 and
> PowerPC won't do this, but I believe ARMv8 can. (Please correct me if
> it can't.)

Release/Acquire are RCsc on ARMv8, so they are ordered irrespective of
address.

Will

\
 
 \ /
  Last update: 2017-11-15 19:06    [W:0.082 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site