update_fast_timekeeper(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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.


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