STRUCT TK_READ_BASE(9)
๐ struct tk_read_base(9) ๐
okay so this is a page from the Kernel API Manual and it's all about struct tk_read_base โ literally the base structure for timekeeping readout, iykyk ๐ฐ๏ธโจ
๐ธ NAME ๐ธ
struct tk_read_base โ the base structure for timekeeping readout. that's it, that's the vibe ๐
โจ SYNOPSIS โจ
get a load of this icon:
struct tk_read_base {
struct clocksource *clock;
u64 mask;
u64 cycle_last;
u32 mult;
u32 shift;
u64 xtime_nsec;
ktime_t base;
u64 base_real;
};
๐ฆ Members ๐ฆ
no cap, every single field, coming right up:
clockโ the currentclocksourcebeing used for timekeeping. the main character of the time source world ๐maskโ the bitmask for two's complement subtraction of non-64bit clocks. lowkey essential ๐งฎcycle_lastโ the clock cycle value at the last update. the receipts, basically ๐งพmultโ the (NTP adjusted) multiplier for scaled math conversion. yes bestie, NTP adjusted ๐shiftโ the shift value for scaled math conversion. shifting, as one does โจxtime_nsecโ the shifted (fractional) nano seconds offset for readout. fractional! fancy! ๐baseโ thektime_t(nanoseconds) base time for readout โฑ๏ธbase_realโ the nanoseconds base value for the clock REALTIME readout. REALTIME in all caps, she means it ๐ฅ
๐ Description ๐
so this struct is 56 byte on 64 bit โ and together with a seqcount it occupies a single 64byte cache line. cache line efficiency? she ate. ๐โจ
the reason the struct is separate from struct timekeeper is that it's also used for the fast NMI safe accessors. multitasking queen ๐ซถ
and base_real? that one exists specifically for the fast NMI safe accessor, so you can read clock realtime from any context. any context!! ๐๐
โญ SEE ALSO โญ
- Kernel file
./include/linux/timekeeper_internal.h struct timekeeper(9)
that's the whole page bestie, go forth and read those cycles ๐๐ง
๐ท source/version and date, sign-off style: this one lives in./include/linux, dated October 2026, and the page isstruct tk_read_base(9)โ mwah, periodt ๐ ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms