Re: [PATCH] files: rcu free files_struct

From: Paul E. McKenney
Date: Wed Dec 09 2020 - 19:40:38 EST


On Wed, Dec 09, 2020 at 03:29:09PM -0800, Linus Torvalds wrote:
> On Wed, Dec 9, 2020 at 3:07 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> >
> > #. It is not necessary to use rcu_assign_pointer() when creating
> > linked structures that are to be published via a single external
> > - pointer. The RCU_INIT_POINTER() macro is provided for this task
> > - and also for assigning ``NULL`` pointers at runtime.
> > + pointer. The RCU_INIT_POINTER() macro is provided for this task.
> > + It used to be more efficient to use RCU_INIT_POINTER() to store a
> > + ``NULL`` pointer, but rcu_assign_pointer() now optimises for a constant
> > + ``NULL`` pointer itself.
>
> I would just remove the historical note about "It used to be more
> efficient ..". It's not really helpful.
>
> If somebody wants to dig into the history, it's there in git.
>
> Maybe the note could be part of the commit message for the comment
> update, explaining that it used to be more efficient but no longer is.
> Because commit messages are about the explanation for the change.
>
> But I don't feel it makes any sense in the source code.

Like this, then?

Thanx, Paul

#. It is not necessary to use rcu_assign_pointer() when creating
linked structures that are to be published via a single external
- pointer. The RCU_INIT_POINTER() macro is provided for this task
- and also for assigning ``NULL`` pointers at runtime.
+ pointer. The RCU_INIT_POINTER() macro is provided for this task.