]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit29fc14dcf57351875e30ebba4113094dd34cbb80
treeeccc8c52607a3d2e83a4fca2a44c8b3d34751a9d
parent60eb6c659ff1abe2f2668739226140ed03c7191e
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