update_fast_timekeeper(9)
π update_fast_timekeeper(9) π
okay so bestie, this is the Kernel API Manual page for update_fast_timekeeper(9), and it's lowkey one of those tiny kernel helpers with main-character energy. It updates the fast and NMI safe monotonic timekeeper. no cap. π
β¨ NAME β¨
update_fast_timekeeper β update the fast and NMI safe monotonic timekeeper. That's the whole name-line vibe, and honestly it ate. π
πΈ SYNOPSIS πΈ
void update_fast_timekeeper (const struct tk_read_base *tkr , struct
tk_fast *tkf );
π ARGUMENTS π
tkrβ timekeeping readout base from which we take the update. It's giving "source info, but make it kernel." π«Άtkfβ pointer to the NMI safe timekeeper. Just a pointer, bestie, but a very important one. β¨
π¦ DESCRIPTION π¦
okay so the whole plot: we want to use this from any context, including NMI and tracing / instrumenting the timekeeping code itself. That's a big ask, and the function is literally built for it. π₯
Employ the latch technique; see write_seqcount_latch. That's the iconic move. π§
So if a NMI hits the update of base[0] then it will use base[1] which is still consistent. That's the whole safety slay. π¦
In the worst case this can result in a slightly wrong timestamp (a few nanoseconds). Yes, literally a few nanoseconds. See ktime_get_mono_fast_ns. It's a tiny caveat, not a whole crisis. π
π SEE ALSO π
Kernel file: ./kernel/time/timekeeping.c.
struct tk_fast(9)tk_setup_internals(9)ktime_get_mono_fast_ns(9)ktime_get_raw_fast_ns(9)ktime_get_boot_fast_ns(9)ktime_get_tai_fast_ns(9)ktime_get_real_fast_ns(9)halt_fast_timekeeper(9)pvclock_gtod_register_notifier(9)pvclock_gtod_unregister_notifier(9)timekeeping_forward_now(9)ktime_get_real_ts64(9)ktime_mono_to_any(9)ktime_get_raw(9)ktime_get_ts64(9)ktime_get_seconds(9)ktime_get_real_seconds(9)__ktime_get_real_seconds(9)ktime_get_snapshot_id(9)adjust_historical_crosststamp(9)ktime_real_to_base_clock(9)get_device_system_crosststamp(9)timekeeping_clocksource_has_base(9)do_settimeofday64(9)__timekeeping_inject_offset(9)timekeeping_notify(9)ktime_get_raw_ts64(9)timekeeping_valid_for_hres(9)timekeeping_max_deferment(9)read_persistent_clock64(9)read_persistent_wall_and_boot_offset(9)__timekeeping_inject_sleeptime(9)timekeeping_inject_sleeptime64(9)timekeeping_resume(9)update_wall_time(9)getboottime64(9)ktime_get_coarse_real_ts64_mg(9)ktime_get_real_ts64_mg(9)ktime_get_update_offsets_now(9)random_get_entropy_fallback(9)do_adjtimex(9)hardpps(9)ktime_get_aux(9)ktime_get_aux_ts64(9)
mwah π that's the page! This one is from source ./kernel/time, dated October 2026, and it's all about update_fast_timekeeper(9). go be fast, go be NMI safe, and remember: 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