Skip to content

Commit 0480855

Browse files
josefbacikkdave
authored andcommitted
btrfs: remove FLUSH_DELAYED_REFS from data ENOSPC flushing
Since we unconditionally commit the transaction now we no longer need to run the delayed refs to make sure our total_bytes_pinned value is uptodate, we can simply commit the transaction. Remove this stage from the data flushing list. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c416a30 commit 0480855

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

fs/btrfs/space-info.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,21 +1080,6 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work)
10801080
* immediately re-usable, it comes in the form of a delayed ref, which must be
10811081
* run and then the transaction must be committed.
10821082
*
1083-
* FLUSH_DELAYED_REFS
1084-
* The above two cases generate delayed refs that will affect
1085-
* ->total_bytes_pinned. However this counter can be inconsistent with
1086-
* reality if there are outstanding delayed refs. This is because we adjust
1087-
* the counter based solely on the current set of delayed refs and disregard
1088-
* any on-disk state which might include more refs. So for example, if we
1089-
* have an extent with 2 references, but we only drop 1, we'll see that there
1090-
* is a negative delayed ref count for the extent and assume that the space
1091-
* will be freed, and thus increase ->total_bytes_pinned.
1092-
*
1093-
* Running the delayed refs gives us the actual real view of what will be
1094-
* freed at the transaction commit time. This stage will not actually free
1095-
* space for us, it just makes sure that may_commit_transaction() has all of
1096-
* the information it needs to make the right decision.
1097-
*
10981083
* COMMIT_TRANS
10991084
* This is where we reclaim all of the pinned space generated by running the
11001085
* iputs
@@ -1107,7 +1092,6 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work)
11071092
static const enum btrfs_flush_state data_flush_states[] = {
11081093
FLUSH_DELALLOC_WAIT,
11091094
RUN_DELAYED_IPUTS,
1110-
FLUSH_DELAYED_REFS,
11111095
COMMIT_TRANS,
11121096
ALLOC_CHUNK_FORCE,
11131097
};

0 commit comments

Comments
 (0)