Skip to content

Commit 90bc7b6

Browse files
jankaragregkh
authored andcommitted
ext4: make directory inode spreading reflect flexbg size
commit 613c5a8 upstream. 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 <[email protected]> Tested-by: Ojaswin Mujoo <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 95d714d commit 90bc7b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/ialloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent,
510510
goto fallback;
511511
}
512512

513-
max_dirs = ndirs / ngroups + inodes_per_group / 16;
513+
max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16;
514514
min_inodes = avefreei - inodes_per_group*flex_size / 4;
515515
if (min_inodes < 1)
516516
min_inodes = 1;

0 commit comments

Comments
 (0)