提交 6b1268f7 编写于 作者: J Jan Kara 提交者: Jialin Zhang

ext4: make directory inode spreading reflect flexbg size

stable inclusion
from stable-v5.10.146
commit c18383218c3102f8f9ba56fd9abed86ac80a69c3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0VX

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c18383218c3102f8f9ba56fd9abed86ac80a69c3

--------------------------------

commit 613c5a85 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: NStefan Wahren <stefan.wahren@i2se.com>
Tested-by: NOjaswin Mujoo <ojaswin@linux.ibm.com>
Cc: stable@kernel.org
Link: https://lore.kernel.org/all/0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@i2se.com/Signed-off-by: NJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220908092136.11770-3-jack@suse.czSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9c394e2e
...@@ -508,7 +508,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent, ...@@ -508,7 +508,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent,
goto fallback; 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; min_inodes = avefreei - inodes_per_group*flex_size / 4;
if (min_inodes < 1) if (min_inodes < 1)
min_inodes = 1; min_inodes = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册