内核参数 sched_min_granularity_ns 为什么看不到啦?
创始人
2024-02-01 18:10:52
0

linux内核从版本v5.13-rc1起(含),sysctl 已无法设置 kernel.sched_min_granularity_ns。

其实不止sched_min_granularity_ns,在 /proc/sys/kernel 下,和CPU调度相关的6个参数都不见了:

sched_latency_ns

sched_nr_migrate

sched_migration_cost_ns

sched_min_granularity_ns

sched_tunable_scaling

sched_wakeup_granularity_ns

看下不同内核版本的实际输出

5.15.0-52-generic

marvin@vm:~$ uname -a
Linux vm 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
marvin@vm:~$ ll /proc/sys/kernel/ | grep sched
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_autogroup_enabled
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_cfs_bandwidth_slice_us
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_child_runs_first
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_deadline_period_max_us
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_deadline_period_min_us
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_energy_aware
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_rr_timeslice_ms
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_rt_period_us
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_rt_runtime_us
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_schedstats
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_max
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_min
-rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_min_rt_default
marvin@vm:~$ 

5.4.0-131-generic

marvin@vm204:~$ uname -a
Linux vm204 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
marvin@vm204:~$ ll /proc/sys/kernel/ | grep sched
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_autogroup_enabled
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_cfs_bandwidth_slice_us
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_child_runs_first
dr-xr-xr-x 1 root root 0 11月 19 11:18 sched_domain/
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_latency_ns
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_migration_cost_ns
-rw-r--r-- 1 root root 0 11月 19 16:21 sched_min_granularity_ns
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_nr_migrate
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_rr_timeslice_ms
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_rt_period_us
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_rt_runtime_us
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_schedstats
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_tunable_scaling
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_util_clamp_max
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_util_clamp_min
-rw-r--r-- 1 root root 0 11月 19 11:18 sched_wakeup_granularity_ns
marvin@vm204:~$ 

为了看清楚变化,稍微调整下输出文本的顺序,然后,用文本比较工具展示下

那么,在新版本中缺少了的6个参数去哪里了呢?被移动到了 /sys/kernel/debug/sched 目录下

 还能修改吗?可以的,echo 4000000 >  /sys/kernel/debug/sched/min_granularity_ns 即可

代码修改的具体提交:

sched: Move SCHED_DEBUG sysctl to debugfs · torvalds/linux@8a99b68 · GitHub


 

相关内容

热门资讯

喜欢穿一身黑的男生性格(喜欢穿... 今天百科达人给各位分享喜欢穿一身黑的男生性格的知识,其中也会对喜欢穿一身黑衣服的男人人好相处吗进行解...
发春是什么意思(思春和发春是什... 本篇文章极速百科给大家谈谈发春是什么意思,以及思春和发春是什么意思对应的知识点,希望对各位有所帮助,...
网络用语zl是什么意思(zl是... 今天给各位分享网络用语zl是什么意思的知识,其中也会对zl是啥意思是什么网络用语进行解释,如果能碰巧...
为什么酷狗音乐自己唱的歌不能下... 本篇文章极速百科小编给大家谈谈为什么酷狗音乐自己唱的歌不能下载到本地?,以及为什么酷狗下载的歌曲不是...
华为下载未安装的文件去哪找(华... 今天百科达人给各位分享华为下载未安装的文件去哪找的知识,其中也会对华为下载未安装的文件去哪找到进行解...
怎么往应用助手里添加应用(应用... 今天百科达人给各位分享怎么往应用助手里添加应用的知识,其中也会对应用助手怎么添加微信进行解释,如果能...
家里可以做假山养金鱼吗(假山能... 今天百科达人给各位分享家里可以做假山养金鱼吗的知识,其中也会对假山能放鱼缸里吗进行解释,如果能碰巧解...
四分五裂是什么生肖什么动物(四... 本篇文章极速百科小编给大家谈谈四分五裂是什么生肖什么动物,以及四分五裂打一生肖是什么对应的知识点,希...
一帆风顺二龙腾飞三阳开泰祝福语... 本篇文章极速百科给大家谈谈一帆风顺二龙腾飞三阳开泰祝福语,以及一帆风顺二龙腾飞三阳开泰祝福语结婚对应...
美团联名卡审核成功待激活(美团... 今天百科达人给各位分享美团联名卡审核成功待激活的知识,其中也会对美团联名卡审核未通过进行解释,如果能...