hrtimer_clock_base and hrtimer_cpu_base

Pratyush Patel pratyushpatel.1995 at gmail.com
Tue Mar 22 03:38:21 EDT 2016


Hello,

I am unable to understand what exactly "clock_base" and "cpu_base", or
simply "base" means (I am seeking an intuitive idea).

I understand that hrtimer subsystem stores its timers in a red-black
tree data structure, and the node for each timer can be found in
struct hrtimer. And if I understand correctly, these red-black trees
are stored per-CPU, each of which is processed differently, leading to
a "hrtimer_cpu_base"? However, as mentioned in a comment in the
hrtimer.h, the "active" attribute in "hrtimer_clock_base" stores the
root node of the red-black tree. Does this mean that each CPU has
multiple clock_bases, and hence multiple red-black trees? Also, could
someone please let me know, or perhaps point to a relevant resource,
which explains what a "timer_base" means?

Relevant files:
1) http://lxr.free-electrons.com/source/include/linux/hrtimer.h
2) http://lxr.free-electrons.com/source/kernel/time/hrtimer.c

Thank you,
Pratyush



More information about the Kernelnewbies mailing list