Re: [PATCH] rcu: convert uses of rcu_assign_pointer(x, NULL) toRCU_INIT_POINTER

From: Paul E. McKenney
Date: Tue Aug 02 2011 - 06:32:25 EST


On Mon, Aug 01, 2011 at 10:44:01PM -0700, David Miller wrote:
> From: Stephen Hemminger <shemminger@xxxxxxxxxx>
> Date: Mon, 1 Aug 2011 09:19:00 -0700
>
> > When assigning a NULL value to an RCU protected pointer, no barrier
> > is needed. The rcu_assign_pointer, used to handle that but will soon
> > change to not handle the special case.
> >
> > Convert all rcu_assign_pointer of NULL value.
> >
> > //smpl
> > @@ expression P; @@
> >
> > - rcu_assign_pointer(P, NULL)
> > + RCU_INIT_POINTER(P, NULL)
> >
> > // </smpl>
> >
> >
> > Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxx>
>
> Acked-by: David S. Miller <davem@xxxxxxxxxxxxx>

Very good, thank you!

This patch does not depend on Eric's earlier patch because
RCU_INIT_POINTER() already exists. So although I would be happy to
carry this patch, there is no reason I can see not to run it up through
net-next. Either way, the Coccinelle script does look generally
useful. ;-)

If you would prefer me to carry it, please let me know. Otherwise:

Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>

Thanx, Paul
--
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/