If we want to change the tick time for Linux Kernel, we need to change CONFIG_HZ parameter in Linux Kernel. Do we have other better ways to change it rather than compiling Linux Kernel. Please ignore the way to add ‘divider=10’ in grub config file because it is limited only for RH/CentOS distros.
如果要更改Linux内核的滴答时间,则需要更改Linux内核中的CONFIG_HZ参数。 除了编译Linux Kernel,我们还有其他更好的方法来更改它吗? 请忽略在grub配置文件中添加'divider = 10'的方法,因为它仅限于RH / CentOS发行版。
Zhiqiang, please answer this question if you know it. I cannot find the answer after Google for a long time. Thank you.
志强,如果您知道,请回答这个问题。 我在Google找了很久才找到答案。 谢谢。
The HZ
variable is extensively used as a macro, such as in
https://github.com/torvalds/linux/blob/e4fba88d00d21f50239eac7d653027bfaf844296/kernel/time/time.c#L277
HZ
变量广泛用作宏,例如
https://github.com/torvalds/linux/blob/e4fba88d00d21f50239eac7d653027bfaf844296/kernel/time/time.c#L277
This is likely for performance.
这可能会提高性能。
This may make it compile-time configurable only.
这可能使其仅在编译时可配置。
So it can only be changed by compiling a new Kernel.
因此,只能通过编译新内核来更改它。
翻译自: https://www.systutorials.com/how-to-change-config_hz-parameter-for-linux-kernel/