[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whgwb5oysYi_sTgzQjDPdg+DGH=VmfQk0o1EBrWOk+JRw@mail.gmail.com>
Date: Mon, 31 Oct 2022 10:37:01 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Jann Horn <jannh@...gle.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <mszeredi@...hat.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Will Deacon <will@...nel.org>
Subject: Re: [PATCH] fs: add memory barrier in __fget_light()
On Mon, Oct 31, 2022 at 10:13 AM Jann Horn <jannh@...gle.com> wrote:
>
> If this is too expensive on platforms like arm64, I guess the more
> performant alternative would be to add another flags field that tracks
> whether the fs_struct was ever shared and check that instead of the
> reference count in __fget_light().
No, the problem is that you should never use the "smp_*mb()" horrors
for any new code.
All the "smp_*mb()" things really are broken. Please consider them
legacy garbage. It was how people though about SMP memory ordering in
the bad old days.
So get with the 21st century, and instead replace the "atomic_read()"
with a "smp_load_acquire()".
Much better on sane architectures.
Linus
Powered by blists - more mailing lists