STRUCT CLOCK_DATA(9)
π struct clock_data(9) π
okay bestie, gather round β this is the Kernel API Manual entry for struct clock_data, and it's literally all the data needed for sched_clock() (including registration of a new clock source). no cap, it's giving behind-the-scenes main character energy. π«Ά
π NAME π
struct clock_data β all data needed for sched_clock() (including registration of a new clock source)
β¨ SYNOPSIS β¨
struct clock_data {
seqcount_latch_t seq;
struct clock_read_data read_data[2];
ktime_t wrap_kt;
unsigned long rate;
u64 (*actual_read_sched_clock)(void);
};
π«Ά Members π«Ά
seqβ sequence counter for protecting updates. the lowest bit is the index forread_data. so iconic of it. πread_dataβ data required to read fromsched_clock.wrap_ktβ duration for which the clock can run before wrapping.rateβ tick rate of the registered clock.actual_read_sched_clockβ registered hardware level clock read function.
πΈ DESCRIPTION πΈ
the ordering of this structure has been chosen to optimize cache performance. specifically, 'seq' and 'read_data[0]' (combined) should fit into a single 64-byte cache line. yes bestie, that's the whole point β cache-line slay. β¨
π₯ SEE ALSO π₯
Kernel file ./kernel/time/sched_clock.c
mwah π this lil page is brought to you by ./kernel/time, October 2026. go off, bestie. π
π¦ 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