快捷搜索: 王者荣耀 脱发

关于Linux的 High-Resolution Timer

参考自: Oracle Linux: How to Disable High-Resolution Timer (文档 ID 2207818.1)

High-Resolution Timer的作用是在纳秒级别处理内部时间分片。 若是禁用High-Resolution Timer,那么内核是在毫秒级别处理内部时间分片。

禁用掉High-Resolution Timer不会有问题,除非你的应用程序需要在纳秒级别处理时间分片。

如下摘自:Oracle Linux: How to Disable High-Resolution Timer (文档 ID 2207818.1)

High-resolution timer is implemented on UEK[1234] and RHCK for OL[67]. 
Note that RHCK for OL5 does not have this feature. 
By default, highres=on as it is configured in kernel booting procedures.
Linux kernel can handle internal time-slice within nanosecond with enabling high-resolution timer. 
By disabling this feature, kernel will handle the slice within millisecond,
it would not be any issues unless your applications need internal time-slice should be nanosecond order.
 
After rebooting the system, it can be confirmed whether highres is disabled by checking whether "highres=off" is included in /proc/cmdline. 
Note that kernel does not prepare methods/interfaces checking high-resolution timer is enabled/disabled, 
thus it is necessary to confirm it by checking the file.
经验分享 程序员 微信小程序 职场和发展