]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: run delayed refs less often in commit_cowonly_roots
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Dec 2020 19:24:26 +0000 (14:24 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:57 +0000 (22:58 +0100)
commita40e55953d4b54da05cfe8901023a93d738aa994
tree507f01f21358c5def8d34849ac75f731108535ce
parentac48eff2dcb31718a8bf992ac9132ae3bd2b8195
btrfs: run delayed refs less often in commit_cowonly_roots

We love running delayed refs in commit_cowonly_roots, but it is a bit
excessive.  I was seeing cases of running 3 or 4 refs a few times in a
row during this time.  Instead simply:

- update all of the roots first
- then run delayed refs
- then handle the empty block groups case
- and then if we have any more dirty roots do the whole thing again

This allows us to be much more efficient with our delayed ref running,
as we can batch a few more operations at once.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/transaction.c