Skip to content

Commit 93c60b1

Browse files
josefbacikkdave
authored andcommitted
btrfs: reduce the preemptive flushing threshold to 90%
The preemptive flushing code was added in order to avoid needing to synchronously wait for ENOSPC flushing to recover space. Once we're almost full however we can essentially flush constantly. We were using 98% as a threshold to determine if we were simply full, however in practice this is a really high bar to hit. For example reports of systems running into this problem had around 94% usage and thus continued to flush. Fix this by lowering the threshold to 90%, which is a more sane value, especially for smaller file systems. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=212185 CC: [email protected] # 5.12+ Fixes: 576fa34 ("btrfs: improve preemptive background space flushing") Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3736127 commit 93c60b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/space-info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static bool need_preemptive_reclaim(struct btrfs_fs_info *fs_info,
733733
{
734734
u64 global_rsv_size = fs_info->global_block_rsv.reserved;
735735
u64 ordered, delalloc;
736-
u64 thresh = div_factor_fine(space_info->total_bytes, 98);
736+
u64 thresh = div_factor_fine(space_info->total_bytes, 90);
737737
u64 used;
738738

739739
/* If we're just plain full then async reclaim just slows us down. */

0 commit comments

Comments
 (0)