[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161205052506-mutt-send-email-mst@kernel.org>
Date: Mon, 5 Dec 2016 05:29:23 +0200
From: "Michael S. Tsirkin" <mst@...hat.com>
To: David Miller <davem@...emloft.net>
Cc: paulmck@...ux.vnet.ibm.com, arnd@...db.de,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] hlist_add_tail_rcu disable sparse warning
On Fri, Nov 25, 2016 at 07:52:23PM -0500, David Miller wrote:
> From: "Michael S. Tsirkin" <mst@...hat.com>
> 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 is missing here.
>
> I personally think it should use __hlist_for_each_rcu, otherwise
> nothing expresses the rcu-ness of the operation.
What does "rcu-ness" mean in this context?
The question is not just about making the code pretty.
This operation is called outside any rcu critical section.
If you are going to call __hlist_for_each_rcu which
calls rcu_dereference, you should do it inside
a critical section.
Other operations such as hlist_add_behind_rcu manipulate
lists manually, maybe this one should, too?
Paul?
--
MST
Powered by blists - more mailing lists