Re: [PATCH v5 4/4] btrfs: increase metadata alloc size to 5GB for volumes > 50GB
From: Wang Yugui <hidden>
Date: 2021-11-10 05:02:40
Hi, We chose 5ULL * SZ_1G because it is a half of BTRFS_MAX_DATA_CHUNK_SIZE(10G)? A same chunk size of data/metadata maybe better for long-term alloc/free? so the following mabye better. /* Handle BTRFS_BLOCK_GROUP_METADATA */ if (info->fs_devices->total_rw_bytes > 2048ULL * SZ_1G) - return SZ_1G; + return BTRFS_MAX_DATA_CHUNK_SIZE; by the way, we need to update btrfs-progs to apply this new policy from mkfs.btrfs. Best Regards Wang Yugui (wangyugui@e16-tech.com) 2021/11/10
quoted hunk ↗ jump to hunk
This increases the metadata default allocation size from 1GB to 5GB for volumes with a size greater than 50GB. Signed-off-by: Stefan Roesch <redacted> --- fs/btrfs/space-info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 3a31aea701a8..0d0accbe3bfb 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c@@ -195,7 +195,7 @@ static u64 compute_chunk_size_regular(struct btrfs_fs_info *info, u64 flags) /* Handle BTRFS_BLOCK_GROUP_METADATA */ if (info->fs_devices->total_rw_bytes > 50ULL * SZ_1G) - return SZ_1G; + return 5ULL * SZ_1G; return SZ_256M; }-- 2.30.2