ktime_get_mono_fast_ns(9)
okay bestie, welcome to the ktime_get_mono_fast_ns(9) page from the Kernel API Manual π
β¨ this one is short but spicy.
π NAME π
ktime_get_mono_fast_ns β Fast NMI safe access to clock monotonic π
β¨ SYNOPSIS β¨
the whole signature is literally:
u64 notrace ktime_get_mono_fast_ns (void );
π¦ ARGUMENTS π¦
voidβ no arguments. that's it, that's the whole argument list π«Ά
πΈ DESCRIPTION πΈ
π¨ real talk: this timestamp is not guaranteed to be monotonic across an update. no cap.
The timestamp is calculated by:
now = base_mono + clock_delta * slope
So if the update lowers the slope, readers who are forced to the not yet updated second array are still using the old steeper slope. it's giving βtwo vibes at onceβ π
tmono ^ | o n | o n | u | o |o |12345678---> reader order
o = old slope u = update n = new slope
in the diagram: o = old slope, u = update, n = new slope. iconic little chart tbh π
So reader 6 will observe time going backwards versus reader 5. yeah. time really said βlet me reverseβ π
While other CPUs are likely to be able to observe that, the only way for a CPU local observation is when an NMI hits in the middle of the update. Timestamps taken from that NMI context might be ahead of the following timestamps. Callers need to be aware of that and deal with it. that's the assignment, bestie β handle your business π«‘
π SEE ALSO π
kernel file: ./kernel/time/timekeeping.c β and the rest of the SEE ALSO squad is:
struct tk_fast(9)tk_setup_internals(9)update_fast_timekeeper(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)
later bestie π«Ά source/version: ./kernel/time Β· date: October 2026 Β· manual: ktime_get_mono_fast_ns(9) β 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