aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-12-18 14:24:22 -0500
committerDavid Sterba <dsterba@suse.com>2021-02-08 22:58:56 +0100
commitad368f3394b796fd7faa46da8d326c98718f21d7 (patch)
tree746b747f1af12723741a3fdf907a5cfb31c0c1dc /fs/btrfs/transaction.c
parentbtrfs: delayed refs pre-flushing should only run the heads we have (diff)
downloadlinux-dev-ad368f3394b796fd7faa46da8d326c98718f21d7.tar.xz
linux-dev-ad368f3394b796fd7faa46da8d326c98718f21d7.zip
btrfs: only run delayed refs once before committing
We try to pre-flush the delayed refs when committing, because we want to do as little work as possible in the critical section of the transaction commit. However doing this twice can lead to very long transaction commit delays as other threads are allowed to continue to generate more delayed refs, which potentially delays the commit by multiple minutes in very extreme cases. So simply stick to one pre-flush, and then continue the rest of the transaction commit. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 1485f7722f47..7bb58c3ddcd1 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2061,12 +2061,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
btrfs_create_pending_block_groups(trans);
- ret = btrfs_run_delayed_refs(trans, 0);
- if (ret) {
- btrfs_end_transaction(trans);
- return ret;
- }
-
if (!test_bit(BTRFS_TRANS_DIRTY_BG_RUN, &cur_trans->flags)) {
int run_it = 0;