]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/btrfs/block-group.c
btrfs: do not block on deleted bgs mutex in the cleaner
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Dec 2020 19:24:19 +0000 (14:24 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:56 +0000 (22:58 +0100)
commitddfd08cb0484e491cae47a76ead051a168a0e644
treeeccc8c52607a3d2e83a4fca2a44c8b3d34751a9d
parent867ed321f90d06aaba84e2c91de51cd3038825ef
btrfs: do not block on deleted bgs mutex in the cleaner

While running some stress tests I started getting hung task messages.
This is because the delete unused block groups code has to take the
delete_unused_bgs_mutex to do it's work, which is taken by balance to
make sure we don't delete block groups while we're balancing.

The problem is that balance can take a while, and so we were getting
hung task warnings.  We don't need to block and run these things, and
the cleaner is needed to do other work, so trylock on this mutex and
just bail if we can't acquire it right away.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c