]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: remove redundant memory barrier from extent_io_tree_release()
authorFilipe Manana <fdmanana@suse.com>
Fri, 22 Sep 2023 10:39:05 +0000 (11:39 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 12 Oct 2023 14:44:15 +0000 (16:44 +0200)
commit28967c762220d22ca26f4a5acacb69b9fbb9748b
treea61711971feee1a9b604fddf846fc9637ddd5f83
parenta1c20d15ee1e2cdcb54134174f0dab3b2fbcf4e4
btrfs: remove redundant memory barrier from extent_io_tree_release()

The memory barrier at extent_io_tree_release() is redundant. Holding
spin_lock here is not enough to drop the barrier completely.  We only
change the waitqueue of an extent state record while holding the tree
lock - see wait_on_state().

The update to waitqueue state will not become stale because there will
be an spin_unlock/spin_lock sequence between the change and waiting,
this implies a full memory barrier.

So remove the explicit smp_mb() barrier.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ reword reasoning ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c