Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which hardware timer is used for hr timers in linux?

The kernel timers are based on the systick HW timer (systick HW timer block or some other timer) with a resolution of 1 jiffy. In case of hr timers (high resolution timers) the resolution is 1 ns. Which hardware timer is used for the operation of hr timers to get 1 ns resolution? I think the hardware timer used for hr timers vary from platform to platform. Any typical example is fine for me. Also, could you point in code where exactly we declare that hr timers use that particular hardware timer?

like image 993
YBlore Avatar asked Oct 20 '25 10:10

YBlore


1 Answers

The resolution is just labelled as 1 ns; the actual resolution depends on the hardware.

High-resolution timers use a clock events device, which is registered by clockevents_register_device.

On x86, this is typically the per-CPU local APIC timer.

like image 190
CL. Avatar answered Oct 21 '25 23:10

CL.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!