]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs: drop the lock trip around I_NEW wake up in evict()
authorMateusz Guzik <mjguzik@gmail.com>
Mon, 17 Mar 2025 16:07:07 +0000 (17:07 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 18 Mar 2025 14:34:27 +0000 (15:34 +0100)
commiteb7e453a83007d019d718c6b3666a1c082b676b0
tree282367d2ae1a0cdf5d825fc9714d94c54677100e
parent008a746a01e221b05932fd4561233ef35fa791cc
fs: drop the lock trip around I_NEW wake up in evict()

The unhashed state check in __wait_on_freeing_inode() performed with
->i_lock held against remove_hash_inode() also holding the lock makes
another lock acquire in evict() completely spurious -- all potential
sleepers already dropped the lock before remove_hash_inode() acquired
it or they found the inode to be unhashed and aborted.

Note there is no trickery here: the usual cost of both sides taking
locks is still being paid, it just stops being paid twice.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20250317160707.1694135-1-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/inode.c