]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: qgroup: set a more sane default value for subtree drop threshold
authorQu Wenruo <wqu@suse.com>
Tue, 10 Sep 2024 05:51:04 +0000 (15:21 +0930)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:39 +0000 (02:02 +0100)
commitcfc75736f49c6c985bf32cc6b964e6d71ec3817d
treeaac0f5f64961a3a1ce3cbff7ac1f8e349e647a15
parent2a9a3a4f26fedd4de5a3f7d4dbb0452693e4d0be
btrfs: qgroup: set a more sane default value for subtree drop threshold

commit 5f9062a48db260fd6b53d86ecfb4d5dc59266316 upstream.

Since commit 011b46c30476 ("btrfs: skip subtree scan if it's too high to
avoid low stall in btrfs_commit_transaction()"), btrfs qgroup can
automatically skip large subtree scan at the cost of marking qgroup
inconsistent.

It's designed to address the final performance problem of snapshot drop
with qgroup enabled, but to be safe the default value is
BTRFS_MAX_LEVEL, requiring a user space daemon to set a different value
to make it work.

I'd say it's not a good idea to rely on user space tool to set this
default value, especially when some operations (snapshot dropping) can
be triggered immediately after mount, leaving a very small window to
that that sysfs interface.

So instead of disabling this new feature by default, enable it with a
low threshold (3), so that large subvolume tree drop at mount time won't
cause huge qgroup workload.

CC: stable@vger.kernel.org # 6.1
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h