Re: RCU: how to suppress warnings from rcu_assign_pointer?

From: Eric Dumazet
Date: Mon Aug 01 2011 - 04:48:00 EST


Le dimanche 31 juillet 2011 Ã 22:23 -0700, Paul E. McKenney a Ãcrit :
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> rcu: Make rcu_assign_pointer() unconditionally insert a memory barrier
>
> Recent changes to gcc give warning messages on rcu_assign_pointers()'s
> checks that allow it to determine when it is OK to omit the memory
> barrier. Stephen Hemminger tried a number of gcc tricks to silence
> this warning, but #pragmas and CPP macros do not work together in the
> way that would be required to make this work.
>
> However, we now have RCU_INIT_POINTER(), which already omits this
> memory barrier, and which therefore may be used when assigning NULL to
> an RCU-protected pointer that is accessible to readers. This commit
> therefore makes rcu_assign_pointer() unconditionally emit the memory
> barrier.
>
> Reported-by: Stephen Hemminger <shemminger@xxxxxxxxxx>
> Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
> Acked-by: David S. Miller <davem@xxxxxxxxxxxxx>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
>

Sure Paul, thanks for doing this. I have _very_ limited access to
Internet this week.

Eric


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/