lkml.org 
[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 05/10] seqlock: Better document raw_write_seqcount_latch()
From
On Mon, Apr 13, 2015 at 10:43 AM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
>
> A shorthand for READ_ONCE + smp_read_barrier_depends() is the shiny
> new lockless_dereference()

Related side note - I think people should get used to seeing
"smp_load_acquire()". It has well-defined memory ordering properties
and should generally perform well on most architectures. It's (much)
stronger than lockless_dereference(), and together with
smp_store_release() you can make rather clear guarantees about passing
data locklessly from one CPU to another.

I'd like to see us use more of the pattern of

- one thread does:

.. allocate/create some data
smp_store_release() to "expose it"

- another thread does:

smp_load_acquire() to read index/pointer/flag/whatever
.. use the data any damn way you want ..

and we should probably aim to prefer that pattern over a lot of our
traditional memory barriers.

Linus


\
 
 \ /
  Last update: 2015-04-13 21:01    [W:0.101 / U:11.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site