STRUCT VDSO_CLOCK(9)
π struct vdso_clock(9) β like, the whole kernel API manual vibe
okay bestie, buckle up, we're reading a manpage from the Kernel API Manual and honestly? it's iconic. this one's all about struct vdso_clock, which is the vdso per clocksource datapage representation. yes, that's a mouthful, no, i'm not gonna dumb it down for you π«Ά
β¨ NAME β¨
struct vdso_clock β the vdso per clocksource datapage representation, periodt.
πΈ SYNOPSIS πΈ
struct vdso_clock {
u32 seq;
s32 clock_mode;
u64 cycle_last;
#ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT;
u64 max_cycles;
#endif;
u64 mask;
u32 mult;
u32 shift;
union {
struct vdso_timestamp basetime[VDSO_BASES];
struct timens_offset offset[VDSO_BASES];
};
};
look at her. absolutely stunning structure. no notes. π
π Members π
okay so let's meet the cast, one field at a time:
seqβ the timebase sequence counter. she's keeping track of the order of things, main character energy fr.clock_modeβ clock mode. that's it, that's the field. πcycle_lastβ timebase at clocksource init. the og snapshot, if you will.max_cyclesβ maximum cycles which won't overflow 64bit multiplication. she's the safety rail, the vibe check for overflow π₯maskβ clocksource mask.multβ clocksource multiplier.shiftβ clocksource shift.{unnamed_union}β anonymous. literally no name. mysterious. lowkey slaying πbasetimeβ basetime perclock_id.offsetβ time namespace offset perclock_id.
π¦ Description π¦
so like, first things first: go see also struct vdso_time_data for the basic access and ordering information, because struct vdso_clock is used there. they're a package deal, iykyk π
basetime is used to store the base time for the system wide time getter VVAR page. that's her job, that's her purpose, she ate.
offset is what the special time namespace VVAR pages use β the ones installed instead of the real VVAR page. and here's the important bit, bestie, don't miss it: these namespace pages must set seq to 1 and clock_mode to VDSO_CLOCKMODE_TIMENS to force the code into the time namespace slow path. no cap, those two things are required. the namespace aware functions retrieve the real system wide VVAR page, read host time, and add the per clock offset. and for clocks which are not affected by time namespace adjustment, the offset must be zero. literally zero. not "close to zero". zero. π―
π SEE ALSO π
- Kernel file
./include/vdso/datapage.h struct vdso_timestamp(9)struct vdso_time_data(9)struct vdso_rng_data(9)
and that's the whole page, bestie! this lil beauty lives in ./include/vdso, it's dated October 2026, and the footer says struct vdso_clock(9) β same as the top, cute symmetry β¨ go read struct vdso_time_data(9) next, mwah π
π
π¦ 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