• 内核参数 sched_min_granularity_ns 为什么看不到啦?


    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

    1. marvin@vm:~$ uname -a
    2. 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
    3. marvin@vm:~$ ll /proc/sys/kernel/ | grep sched
    4. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_autogroup_enabled
    5. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_cfs_bandwidth_slice_us
    6. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_child_runs_first
    7. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_deadline_period_max_us
    8. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_deadline_period_min_us
    9. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_energy_aware
    10. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_rr_timeslice_ms
    11. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_rt_period_us
    12. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_rt_runtime_us
    13. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_schedstats
    14. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_max
    15. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_min
    16. -rw-r--r-- 1 root root 0 11月 19 11:20 sched_util_clamp_min_rt_default
    17. marvin@vm:~$

    5.4.0-131-generic

    1. marvin@vm204:~$ uname -a
    2. 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
    3. marvin@vm204:~$ ll /proc/sys/kernel/ | grep sched
    4. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_autogroup_enabled
    5. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_cfs_bandwidth_slice_us
    6. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_child_runs_first
    7. dr-xr-xr-x 1 root root 0 11月 19 11:18 sched_domain/
    8. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_latency_ns
    9. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_migration_cost_ns
    10. -rw-r--r-- 1 root root 0 11月 19 16:21 sched_min_granularity_ns
    11. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_nr_migrate
    12. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_rr_timeslice_ms
    13. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_rt_period_us
    14. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_rt_runtime_us
    15. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_schedstats
    16. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_tunable_scaling
    17. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_util_clamp_max
    18. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_util_clamp_min
    19. -rw-r--r-- 1 root root 0 11月 19 11:18 sched_wakeup_granularity_ns
    20. 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


     

  • 相关阅读:
    【2022黑色星期五】5个有效的方法让客户打开您的电子邮件营销
    groovy笔记
    浏览器复制功能
    paddle 自定义数据集和预处理
    2311rust过程宏的示例
    论文笔记:Auto-Encoding Scene Graphs for Image Captioning
    FPGA - 7系列 FPGA SelectIO -05- 逻辑资源之OLOGIC
    nodejs+vue人脸识别考勤管理系统的设计与实现-计算机毕业设计
    mac电影特效合成软件nuke15 完美激活版下载
    选择边缘计算网关的五大优势
  • 原文地址:https://blog.csdn.net/iceman1952/article/details/127938186