]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
btrfs: simplify inode locking for RWF_NOWAIT
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Wed, 11 Sep 2019 16:45:15 +0000 (11:45 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit2a67dff2e5d5022c2285a765730c6e929a8c3d95
tree330a5a98c2cf29f090d015b57ad456a45a9b115c
parent7094b33cf83dc11b120fa16a7035522017039a0e
btrfs: simplify inode locking for RWF_NOWAIT

BugLink: https://bugs.launchpad.net/bugs/1861934
commit 9cf35f673583ccc9f3e2507498b3079d56614ad3 upstream.

This is similar to 942491c9e6d6 ("xfs: fix AIM7 regression"). Apparently
our current rwsem code doesn't like doing the trylock, then lock for
real scheme. This causes extra contention on the lock and can be
measured eg. by AIM7 benchmark.  So change our read/write methods to
just do the trylock for the RWF_NOWAIT case.

Fixes: edf064e7c6fe ("btrfs: nowait aio support")
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/btrfs/file.c