Re: [PATCH 01/10] rcu: define __rcu address space modifier for sparse

From: Arnd Bergmann
Date: Wed Feb 24 2010 - 15:38:35 EST


On Wednesday 24 February 2010, Mathieu Desnoyers wrote:
> > +/**
> > + * RCU_INIT_POINTER - initialize an RCU protected member
> > + * in a statically allocated data structure.
> > + */
> > +#define RCU_INIT_POINTER(p, v) \
> > + p = (typeof(*v) __force __rcu *)(v)
>
> Hrm, I'm not sure about this one. It would be better to something closer to
> list.h LIST_HEAD_INIT / LIST_HEAD / INIT_LIST_HEAD. The first two are for
> static declaration/init, while the last one is for runtime init. I fear that
> your RCU_INIT_POINTER might be semantically confusing between static and dynamic
> initialization usual semantic.

I only had to use it in one place, INIT_STRUCT_PID (see patch 08/10), and
the approach of LIST_HEAD does not seem to work there. I'd certainly
prefer to write it in a way that cannot be used for dynamic initialization,
but could not think of one.

Arnd

--
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/