summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorBoris Burkov <boris@bur.io>2022-12-16 01:06:35 +0100
committerDavid Sterba <dsterba@suse.com>2023-02-13 17:50:34 +0100
commitcb0922f264643f03b04352f7a04abb913c609369 (patch)
tree2fbe7804f1e87b4e080b5c5a83575cd8011642e4 /fs/btrfs/extent-tree.c
parentbtrfs: load block group size class when caching (diff)
downloadlinux-cb0922f264643f03b04352f7a04abb913c609369.tar.xz
linux-cb0922f264643f03b04352f7a04abb913c609369.zip
btrfs: don't use size classes for zoned file systems
When a file system has ZNS devices which are constrained by a maximum number of active block groups, then not being able to use all the block groups for every allocation is not ideal, and could cause us to loop a ton with mixed size allocations. In general, since zoned doesn't write into gaps behind where block groups are writing, it is not susceptible to the same sort of fragmentation that size classes are designed to solve, so we can skip size classes for zoned file systems in general, even though there would probably be no harm for SMR devices. Signed-off-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index e9be9430faa0..ad6c66ff9ba8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4064,7 +4064,7 @@ static bool find_free_extent_check_size_class(struct find_free_extent_ctl *ffe_c
{
if (ffe_ctl->policy == BTRFS_EXTENT_ALLOC_ZONED)
return true;
- if (!btrfs_is_block_group_data_only(bg))
+ if (!btrfs_block_group_should_use_size_class(bg))
return true;
if (ffe_ctl->loop >= LOOP_WRONG_SIZE_CLASS)
return true;