Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-25 Thread David Miller
From: Monam Agarwal Date: Mon, 24 Mar 2014 00:02:32 +0530 > This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) > > The rcu_assign_pointer() ensures that the initialization of a structure > is carried out before storing a pointer to that structure. > And in the

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-24 Thread Paul E. McKenney
On Mon, Mar 24, 2014 at 04:47:32PM +0800, Lai Jiangshan wrote: > On 03/24/2014 01:25 PM, Eric Dumazet wrote: > > On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote: > > > >> Seems an incredibly strict requirement for something that just > >> silences a warning. > >> What exactly should I

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-24 Thread Eric Dumazet
On Mon, 2014-03-24 at 08:22 +0200, Michael S. Tsirkin wrote: > What happens if someone then changes that NULL to something else? > Things will start to break in subtle way, won't they? Sure. As anything else can break when/if using wrong API or in any change. Particularly in RCU protected code. E

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-24 Thread Michael S. Tsirkin
On Mon, Mar 24, 2014 at 08:22:25AM +0200, Michael S. Tsirkin wrote: > On Sun, Mar 23, 2014 at 10:25:27PM -0700, Eric Dumazet wrote: > > On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote: > > > > > Seems an incredibly strict requirement for something that just > > > silences a warning. >

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-24 Thread Lai Jiangshan
On 03/24/2014 01:25 PM, Eric Dumazet wrote: > On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote: > >> Seems an incredibly strict requirement for something that just >> silences a warning. >> What exactly should I test? >> I intended to just verify this produces same code as before >> d32

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Michael S. Tsirkin
On Sun, Mar 23, 2014 at 10:25:27PM -0700, Eric Dumazet wrote: > On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote: > > > Seems an incredibly strict requirement for something that just > > silences a warning. > > What exactly should I test? > > I intended to just verify this produces same

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Eric Dumazet
On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote: > Seems an incredibly strict requirement for something that just > silences a warning. > What exactly should I test? > I intended to just verify this produces same code as before > d322f45ceed525daa under a recent gcc. Thats because man

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Michael S. Tsirkin
On Sun, Mar 23, 2014 at 03:12:56PM -0700, Paul E. McKenney wrote: > On Sun, Mar 23, 2014 at 11:33:49PM +0200, Michael S. Tsirkin wrote: > > On Sun, Mar 23, 2014 at 12:54:17PM -0700, Eric Dumazet wrote: > > > On Sun, 2014-03-23 at 21:41 +0200, Michael S. Tsirkin wrote: > > > > > > > The rcu_assign_

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Paul E. McKenney
On Sun, Mar 23, 2014 at 11:33:49PM +0200, Michael S. Tsirkin wrote: > On Sun, Mar 23, 2014 at 12:54:17PM -0700, Eric Dumazet wrote: > > On Sun, 2014-03-23 at 21:41 +0200, Michael S. Tsirkin wrote: > > > > > The rcu_assign_pointer() ensures that the initialization of a structure > > > > > >

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Michael S. Tsirkin
On Sun, Mar 23, 2014 at 12:54:17PM -0700, Eric Dumazet wrote: > On Sun, 2014-03-23 at 21:41 +0200, Michael S. Tsirkin wrote: > > > The rcu_assign_pointer() ensures that the initialization of a structure > > > > is carried out before storing a pointer to that structure. > > In the case of

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Eric Dumazet
On Sun, 2014-03-23 at 21:41 +0200, Michael S. Tsirkin wrote: > The rcu_assign_pointer() ensures that the initialization of a structure > is carried out before storing a pointer to that structure. > In the case of the NULL pointer, there is no structure to initialize, > so we can safely dro

Re: [PATCH] drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

2014-03-23 Thread Michael S. Tsirkin
On Mon, Mar 24, 2014 at 12:02:32AM +0530, Monam Agarwal wrote: > This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) > > The rcu_assign_pointer() ensures that the initialization of a structure > is carried out before storing a pointer to that structure. > And in