]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfs: elide smp_mb in iversion handling in the common case
authorMateusz Guzik <mjguzik@gmail.com>
Thu, 15 Aug 2024 08:33:10 +0000 (10:33 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 30 Aug 2024 06:22:37 +0000 (08:22 +0200)
commitb381fbbccb4cb60aefa1ab7f8e3766ddb4a461db
tree57edc85b86716eceaa8a68045dd2f142221c2f18
parent433f9d76a01056dfeaefc15167b11e514e56f956
vfs: elide smp_mb in iversion handling in the common case

According to bpftrace on these routines most calls result in cmpxchg,
which already provides the same guarantee.

In inode_maybe_inc_iversion elision is possible because even if the
wrong value was read due to now missing smp_mb fence, the issue is going
to correct itself after cmpxchg. If it appears cmpxchg wont be issued,
the fence + reload are there bringing back previous behavior.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/r/20240815083310.3865-1-mjguzik@gmail.com
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/libfs.c