[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4f3vsaxp7q5nm4byfp5b4cbtmwphqozqmtvtncagwehfu3omc3@txrarl2xglia>
Date: Tue, 24 Jun 2025 00:19:14 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Jan Kara <jack@...e.cz>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Amir Goldstein <amir73il@...il.com>, Matthew Bobrowski <repnop@...gle.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] fanotify: wake-up all waiters on release
On (25/06/23 12:52), Jan Kara wrote:
> > My another silly idea was, fsnotify_put_mark_wake() is called in a loop
> > and it tests group->shutdown locklessly, as far as I can tell, so maybe
> > there is a speculative load and we use stale/"cached" group->shutdown
> > value w/o ever waking up ->notification_waitq. Am running out of ideas.
>
> Well, but atomic_dec_and_test() in fsnotify_put_mark_wake() should be a
> full memory barrier so such reordering should not be possible?
You are right, as always. Generated code looks fine:
...
61f: f0 41 ff 4e 6c lock decl 0x6c(%r14)
624: 75 1f jne 645 <fsnotify_finish_user_wait+0x55>
626: 41 80 7e 44 01 cmpb $0x1,0x44(%r14)
62b: 75 18 jne 645 <fsnotify_finish_user_wait+0x55>
...
->shutdown fetch is always done after atomic-dec.
Powered by blists - more mailing lists