aboutsummaryrefslogtreecommitdiff
path: root/drivers/nubus
diff options
context:
space:
mode:
authorQu Wenruo2017-02-15 10:43:03 +0800
committerDavid Sterba2017-02-17 12:03:55 +0100
commitfb235dc06fac9eaa4408ade9c8b20d45d63c89b7 (patch)
tree2bd827b257ac580b31097fa13a98bab3a0162c9e /drivers/nubus
parent15b34517a6368c607ae7fd51c24cdc69efcd47fc (diff)
btrfs: qgroup: Move half of the qgroup accounting time out of commit trans
Just as Filipe pointed out, the most time consuming parts of qgroup are btrfs_qgroup_account_extents() and btrfs_qgroup_prepare_account_extents(). Which both call btrfs_find_all_roots() to get old_roots and new_roots ulist. What makes things worse is, we're calling that expensive btrfs_find_all_roots() at transaction committing time with TRANS_STATE_COMMIT_DOING, which will blocks all incoming transaction. Such behavior is necessary for @new_roots search as current btrfs_find_all_roots() can't do it correctly so we do call it just before switch commit roots. However for @old_roots search, it's not necessary as such search is based on commit_root, so it will always be correct and we can move it out of transaction committing. This patch moves the @old_roots search part out of commit_transaction(), so in theory we can half the time qgroup time consumption at commit_transaction(). But please note that, this won't speedup qgroup overall, the total time consumption is still the same, just reduce the performance stall. Cc: Filipe Manana <fdmanana@suse.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'drivers/nubus')
0 files changed, 0 insertions, 0 deletions