linux - 完全消除现代 Linux >=5.0 中的计时器滴答

标签 linux timer linux-kernel real-time interrupt

我试图在一台安静的机器上完全消除一组内核上的定时器中断。这些是这些内核定期处理的唯一中断。我已经 isolcpu 'd 他们,并用 CONFIG_NO_HZ_FULL 构建了一个内核,实际上现在他们每秒只收到一次定时器中断。 是否可以删除这个残留的 1Hz 定时器中断?

kernel doc表明在某些时候需要偶尔打勾:

Some process-handling operations still require the occasional scheduling-clock tick. These operations include calculating CPU load, maintaining sched average, computing CFS entity vruntime, computing avenrun, and carrying out load balancing. They are currently accommodated by scheduling-clock tick every second or so. On-going work will eliminate the need even for these infrequent scheduling-clock ticks.



还有这个 kernel patch , "Remove the 1 Hz tick code,"表明它在内核的更高版本中被删除:

Now that the 1Hz tick is offloaded to workqueues, we can safely remove the residual code that used to handle it locally.



我已经构建了 5.3.0 内核,希望可以删除这个残留的滴答声,但它仍然存在。

我需要设置额外的引导参数吗?最新版本的内核中真的去掉了residual timer tick吗? ( this question 有一些相关资料)

最佳答案

不能从所有 CPU 中完全删除 1HZ 刻度,否则我们将无法保留任何统计信息。相反,它现在通过工作队列运行,您现在可以配置 housekeeping将处理所有全局工作队列任务的 CPU。看到这个 commit详情。

还建议使用 nohz_full 命令行参数和 cpusets 来管理一组隔离的 cpu。您仍然需要让其中之一(默认情况下引导 CPU)成为内务 CPU。

关于linux - 完全消除现代 Linux >=5.0 中的计时器滴答,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60322119/

相关文章:

linux - 如何在内核模块中使用 sysfs?

c - 进程的地址空间

c++ - 如何确保例程按时执行?

c++ - 如何避免触发已经销毁的 boost::asio::deadline_timer

c# - 定时器的性能成本

Linux 内核线程 - 调度程序

linux - bash:python3.3 没有那个文件或目录

linux - Docker 守护进程接缝启动,但未在正在运行的进程中列出

linux - 我应该在关闭主机之前关闭 lxc 容器吗?

linux - 用于 MPLS 配置的 iproute2 命令