From cb0922f264643f03b04352f7a04abb913c609369 Mon Sep 17 00:00:00 2001 From: Boris Burkov Date: Thu, 15 Dec 2022 16:06:35 -0800 Subject: 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 Signed-off-by: David Sterba --- fs/btrfs/block-group.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/btrfs/block-group.h') diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h index 2b9d328b589e..4fdc39f00a4d 100644 --- a/fs/btrfs/block-group.h +++ b/fs/btrfs/block-group.h @@ -363,5 +363,6 @@ enum btrfs_block_group_size_class btrfs_calc_block_group_size_class(u64 size); int btrfs_use_block_group_size_class(struct btrfs_block_group *bg, enum btrfs_block_group_size_class size_class, bool force_wrong_size_class); +bool btrfs_block_group_should_use_size_class(struct btrfs_block_group *bg); #endif /* BTRFS_BLOCK_GROUP_H */ -- cgit v1.2.3-73-gaa49b