On 2019/1/16 上午1:26, Josef Bacik wrote: > On Tue, Jan 15, 2019 at 04:15:57PM +0800, Qu Wenruo wrote: >> This patchset can be fetched from github: >> https://github.com/adam900710/linux/tree/qgroup_delayed_subtree >> >> Which is based on v5.0-rc1. >> > > I've been testing these patches hoping to get rid of the qgroup deadlock that > these patches are supposed to fix, but instead they make the box completely > unusable with 100% cpu usage for minutes at a time at every transaction commit. I'm afraid it's related to the v5.0-rc1 base, not the patchset itself. Just try to balance metadata with 16 snapshots, you'll see btrfs bumping its generation like crazy, no matter if quota is enabled or not. And since btrfs is committing transaction like crazy, no wonder it will do tons of qgroup accounting. My bisect leads to commit 64403612b73a94bc7b02cf8ca126e3b8ced6e921 btrfs: rework btrfs_check_space_for_delayed_refs. Thanks, Qu > Thanks, > > Josef >