Messages in this thread | | | From | Linus Torvalds <> | Date | Wed, 9 Dec 2020 15:01:36 -0800 | Subject | Re: [PATCH] files: rcu free files_struct |
| |
On Wed, Dec 9, 2020 at 2:58 PM Al Viro <viro@zeniv.linux.org.uk> wrote: > > On Wed, Dec 09, 2020 at 07:49:38PM +0000, Matthew Wilcox wrote: > > > > Assuming this is safe, you can use RCU_INIT_POINTER() here because you're > > storing NULL, so you don't need the wmb() before storing the pointer. > > fs/file.c:pick_file() would make more interesting target for the same treatment...
Actually, don't.
rcu_assign_pointer() itself already does the optimization for the case of a constant NULL pointer assignment.
So there's no need to manually change things to RCU_INIT_POINTER().
Linus
| |