lkml.org 
[lkml]   [2020]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [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

    \
     
     \ /
      Last update: 2020-12-10 00:03    [W:3.633 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site