Bug 11756 - [Anolis23.2][6.6.25-2.2_rc1][x86_64][内核兼容性]内核兼容性测试x86环境中kparams部分项存在差异
Summary: [Anolis23.2][6.6.25-2.2_rc1][x86_64][内核兼容性]内核兼容性测试x86环境中kparams部分项存在差异
Status: CLOSED BYDESIGN
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: generic (show other bugs) generic
Version: 6.6.25-2.2
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: banye97
QA Contact:
URL:
Whiteboard:
Keywords: Function
Depends on:
Blocks:
 
Reported: 2024-11-07 15:27 UTC by Banana
Modified: 2024-11-14 18:29 UTC (History)
4 users (show)

See Also:


Attachments
x86_kparams-all数据 (52.07 KB, text/csv)
2024-11-08 16:12 UTC, Banana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Banana alibaba_cloud_group 2024-11-07 15:27:38 UTC
[问题描述]:
An23.2 6.6.25-2.2_rc1.an23.x86_64内核兼容性评估kparams部分fanotify、inotify监视器的最大数量有差异

需帮忙判断是否符合预期
具体差异项
key	                               6.6.25-2.1   6.6.25-2.2_rc1
/proc/sys/fs/inotify/max_user_watches	 121908	      121905
/proc/sys/fs/fanotify/max_user_marks	 129723	      129719
/proc/sys/user/max_fanotify_marks	 129723	      129719
/proc/sys/user/max_inotify_watches	 121908	      121905


[环境信息]:
数据采集评估机器类型:ECS

[内核信息]:
- 基准内核:
6.6.25-2.1.an23.x86_64

- 评估内核:
6.6.25-2.2_rc1.an23.x86_64

[操作系统信息]:
[root@localhost ~]# cat /etc/os-release
NAME="Anolis OS"
VERSION="23.1"
ID="anolis"
VERSION_ID="23.1"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23.1"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[期望结果]:
需根据实际情况判断是否为内核问题

[实际结果]:
存在部分差异项
Comment 1 Banana alibaba_cloud_group 2024-11-08 16:12:30 UTC
Created attachment 1220 [details]
x86_kparams-all数据
Comment 2 Banana alibaba_cloud_group 2024-11-08 16:17:16 UTC
上传附件x86环境kparams全量评估数据

result为same,无需关注
result为diff的有差异,部分项已经根据之前回复备注出,评估有差异属于正常。
Comment 3 banye97 alibaba_cloud_group 2024-11-11 19:00:10 UTC
- max_user_watches:
参考内核文档: Documentation/admin-guide/sysctl/fs.rst 中的介绍
'''
max_user_watches
----------------

Every epoll file descriptor can store a number of files to be monitored
for event readiness. Each one of these monitored files constitutes a "watch".
This configuration option sets the maximum number of "watches" that are
allowed for each user.
Each "watch" costs roughly 90 bytes on a 32-bit kernel, and roughly 160 bytes
on a 64-bit one.
The current default value for ``max_user_watches`` is 4% of the
available low memory, divided by the "watch" cost in bytes.
'''
该值是动态的,根据当前可用的low memory 进行计算的。

- max_user_marks

参考内核代码:
'''
/*
 * fanotify_user_setup - Our initialization function.  Note that we cannot return
 * error because we have compiled-in VFS hooks.  So an (unlikely) failure here
 * must result in panic().
 */
static int __init fanotify_user_setup(void)
{
        ...
	/*
	 * Allow up to 1% of addressable memory to be accounted for per user
	 * marks limited to the range [8192, 1048576]. mount and sb marks are
	 * a lot cheaper than inode marks, but there is no reason for a user
	 * to have many of those, so calculate by the cost of inode marks.
	 */
	max_marks = (((si.totalram - si.totalhigh) / 100) << PAGE_SHIFT) /
		    INODE_MARK_COST;
	max_marks = clamp(max_marks, FANOTIFY_OLD_DEFAULT_MAX_MARKS,
				     FANOTIFY_DEFAULT_MAX_USER_MARKS);
        ...

	init_user_ns.ucount_max[UCOUNT_FANOTIFY_MARKS] = max_marks;

        ...
}
device_initcall(fanotify_user_setup);
'''

该值也是动态计算的。

请将该结论记录到基线白名单中,后续遇到相关参数变化时默认认为参数变化符合预期。