lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH RFC tip/core/rcu 12/15] lib/assoc_array: Remove smp_read_barrier_depends()
    On Wed, Oct 11, 2017 at 01:19:59PM +0100, David Howells wrote:
    > Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
    >
    > > - node = result.terminal_node.node;
    > > - smp_read_barrier_depends();
    > > + node = READ_ONCE(result.terminal_node.node); /* Address dependency. */
    >
    > The main problem I have with this method of annotation is that it's not
    > obvious there's a barrier there or which side the barrier is.
    >
    > I think one of the trickiest issues is that a barrier is typically between two
    > things and we're not making it clear what those two things actually are.
    >
    > Also, I would say that the most natural interpretation of READ_ONCE() is that
    > the implicit barrier comes after the read, e.g.:
    >
    > f = READ_ONCE(stuff->foo);
    > /* Implied barrier */
    > look_at(f->a);
    > look_at(f->b);
    >
    > I.e. READ_ONCE() prevents stuff->foo from being reread whilst you access f and
    > orders LOAD(stuff->foo) before LOAD(f->a) and LOAD(f->b).

    FWIW, that's exactly what my patches do, this fixup looks a bit weird
    because it removes a prior barrier which suggests that either (a) it's in
    the wrong place to start with, or (b) we're annotating the wrong load.

    Will

    \
     
     \ /
      Last update: 2017-10-11 14:23    [W:4.088 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site