lkml.org 
[lkml]   [2013]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 tip/core/rcu 07/13] ipv6/ip6_tunnel: Apply rcu_access_pointer() to avoid sparse false positive
On Wed, Oct 09, 2013 at 03:10:24PM -0700, Eric Dumazet wrote:
> On Wed, 2013-10-09 at 14:57 -0700, Paul E. McKenney wrote:
>
> > Hmmm... I could use RCU_INIT_POINTER(). Something like the following?
> >
> > RCU_INIT_POINTER(ACCESS_ONCE(*tp), t->next);
> >
> > The ACCESS_ONCE() to prevent the compiler from doing anything stupid.
> > Presumably the value of t->next cannot change, so a normal load suffices.
> >
> > Or did you have something else in mind?
>
> Well, *tp and t->next are both of the same type, with __rcu attribute.
>
> struct ip6_tnl __rcu **tp;
>
> So I meant :
>
> ACCESS_ONCE(*tp) = t->next;
>
> If really we can have a really stupid compiler.

That would work, though it would probably give sparse complaints.

Of course, it is not the stupid compilers that worry me, but rather the
smart ones...

Thanx, Paul



\
 
 \ /
  Last update: 2013-10-10 01:01    [W:0.061 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site