On Tue, Sep 10, 2024 at 03:21:04PM +0930, Qu Wenruo wrote: > 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. Sounds like a sane idea to set it to some low value as default. Reviewed-by: David Sterba <dsterba@xxxxxxxx>