On Thu, Dec 1, 2016 at 9:42 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Thu, Dec 1, 2016 at 5:12 PM, Alexey Dobriyan <adobri...@gmail.com> wrote: >> struct net_generic { >> - unsigned int len; >> - struct rcu_head rcu; >> + struct { >> + unsigned int len; >> + struct rcu_head rcu; >> + } s; >> >> void *ptr[0]; >> }; > > I think you can put them in a union, since rcu is only used > for kfree_rcu() where len is not needed and rcu_head doesn't > need to be initialized by callers.
Never mind, readers could be still reading ->len while we modify ->rcu. So they can't be in a union.