From: Jan Kara Date: Thu, 8 Sep 2022 09:21:26 +0000 (+0200) Subject: ext4: make directory inode spreading reflect flexbg size X-Git-Tag: v6.6.17~6474^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=613c5a85898d1cd44e68f28d65eccf64a8ace9cf;p=platform%2Fkernel%2Flinux-rpi.git ext4: make directory inode spreading reflect flexbg size Currently the Orlov inode allocator searches for free inodes for a directory only in flex block groups with at most inodes_per_group/16 more directory inodes than average per flex block group. However with growing size of flex block group this becomes unnecessarily strict. Scale allowed difference from average directory count per flex block group with flex block group size as we do with other metrics. Tested-by: Stefan Wahren Tested-by: Ojaswin Mujoo Cc: stable@kernel.org Link: https://lore.kernel.org/all/0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@i2se.com/ Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220908092136.11770-3-jack@suse.cz Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index f73e5eb..208b87c 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -510,7 +510,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent, goto fallback; } - max_dirs = ndirs / ngroups + inodes_per_group / 16; + max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes = avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes = 1;