lkml.org 
[lkml]   [2020]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/5] rcuwait: Introduce prepare_to and finish_rcuwait
    On Tue, Apr 21, 2020 at 09:07:37PM -0700, Davidlohr Bueso wrote:

    > +static inline void prepare_to_rcuwait(struct rcuwait *w)
    > +{
    > + rcu_assign_pointer(w->task, current);
    > +}
    > +
    > +static inline void finish_rcuwait(struct rcuwait *w)
    > +{
    > + WRITE_ONCE(w->task, NULL);

    I think that wants to be:

    rcu_assign_pointer(w->task, NULL);

    There is a special case in rcu_assign_pointer() that looses the barrier,
    but it will keep the __rcu sparse people happy. That is w->task is
    __rcu, and WRITE_ONCE ignores that etc.. blah.

    The alternative is using RCU_INIT_POINTER() I suppose.

    > + __set_current_state(TASK_RUNNING);
    > +}

    \
     
     \ /
      Last update: 2020-04-23 11:24    [W:3.073 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site