lkml.org 
[lkml]   [2019]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Documentation: atomic_t.txt: Explain ordering provided by smp_mb__{before,after}_atomic()
On Tue, Apr 23, 2019 at 10:28:31PM +0200, Peter Zijlstra wrote:
> On Tue, Apr 23, 2019 at 01:16:37PM -0700, Paul E. McKenney wrote:
>
> > Agreed, but I thought that one of the ideas going forward was to get
> > rid of smp_mb__{before,after}_atomic().
>
> It's not one I had considered.. I just wanted to get rid of this
> 'surprise' behaviour.

Ah, good point, your patch is in fact a midpoint between those two
positions. Just to make sure I understand:

1. Without your patch, smp_mb__{before,after}_atomic() orders
only against the atomic itself.

2. With your patch, smp_mb__{before,after}_atomic() orders against
the atomic itself and the accesses on the other side of that
atomic. However, it does not order the atomic against the
accesses on the other side of that atomic.

Putting things between the smp_mb__{before,after}_atomic()
and the atomic is in my opinion a bad idea, but in this case
they are not necessarily ordered.

3. Dispensing with smp_mb__{before,after}_atomic() would have
void RMW atomics fully ordered, but I suspect that it results
in ugly performance regressions.

Or am I still missing something?

Thanx, Paul

\
 
 \ /
  Last update: 2019-04-24 10:32    [W:0.079 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site