Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-05 Thread Michael S. Tsirkin
On Wed, Nov 23, 2016 at 10:48:19PM +0200, Michael S. Tsirkin wrote: > sparse is unhappy about this code in hlist_add_tail_rcu: > > struct hlist_node *i, *last = NULL; > > for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i)) > last = i; > > This is because

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-05 Thread Michael S. Tsirkin
On Wed, Nov 23, 2016 at 10:48:19PM +0200, Michael S. Tsirkin wrote: > sparse is unhappy about this code in hlist_add_tail_rcu: > > struct hlist_node *i, *last = NULL; > > for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i)) > last = i; > > This is because

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-04 Thread Michael S. Tsirkin
On Mon, Nov 28, 2016 at 06:39:19AM -0800, Paul E. McKenney wrote: > On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > > From: "Michael S. Tsirkin" > > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > > > I would appreciate review to confirm the function doesn't > > > do

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-04 Thread Michael S. Tsirkin
On Mon, Nov 28, 2016 at 06:39:19AM -0800, Paul E. McKenney wrote: > On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > > From: "Michael S. Tsirkin" > > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > > > I would appreciate review to confirm the function doesn't > > > do anything unsafe

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-04 Thread Michael S. Tsirkin
On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > I would appreciate review to confirm the function doesn't > > do anything unsafe though. > > > > In particular, should this use

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-12-04 Thread Michael S. Tsirkin
On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > I would appreciate review to confirm the function doesn't > > do anything unsafe though. > > > > In particular, should this use __hlist_for_each_rcu instead?

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-28 Thread Michael S. Tsirkin
On Mon, Nov 28, 2016 at 06:39:19AM -0800, Paul E. McKenney wrote: > On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > > From: "Michael S. Tsirkin" > > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > > > I would appreciate review to confirm the function doesn't > > > do

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-28 Thread Michael S. Tsirkin
On Mon, Nov 28, 2016 at 06:39:19AM -0800, Paul E. McKenney wrote: > On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > > From: "Michael S. Tsirkin" > > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > > > I would appreciate review to confirm the function doesn't > > > do anything unsafe

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-28 Thread Paul E. McKenney
On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > I would appreciate review to confirm the function doesn't > > do anything unsafe though. > > > > In particular, should this use

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-28 Thread Paul E. McKenney
On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 23 Nov 2016 22:48:19 +0200 > > > I would appreciate review to confirm the function doesn't > > do anything unsafe though. > > > > In particular, should this use __hlist_for_each_rcu instead?

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-25 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 23 Nov 2016 22:48:19 +0200 > I would appreciate review to confirm the function doesn't > do anything unsafe though. > > In particular, should this use __hlist_for_each_rcu instead? > I note that __hlist_for_each_rcu does rcu_dereference >

Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-25 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 23 Nov 2016 22:48:19 +0200 > I would appreciate review to confirm the function doesn't > do anything unsafe though. > > In particular, should this use __hlist_for_each_rcu instead? > I note that __hlist_for_each_rcu does rcu_dereference > internally, which

[PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-23 Thread Michael S. Tsirkin
sparse is unhappy about this code in hlist_add_tail_rcu: struct hlist_node *i, *last = NULL; for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i)) last = i; This is because hlist_next_rcu and hlist_next_rcu return __rcu pointers. The following trivial patch

[PATCH RFC] hlist_add_tail_rcu disable sparse warning

2016-11-23 Thread Michael S. Tsirkin
sparse is unhappy about this code in hlist_add_tail_rcu: struct hlist_node *i, *last = NULL; for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i)) last = i; This is because hlist_next_rcu and hlist_next_rcu return __rcu pointers. The following trivial patch