ntp_clear(9)
π ntp_clear(9)
okay so this is a page from the Kernel API Manual, and it's about ntp_clear β yes bestie, the (9) means it's a kernel function, not a command you type at your shell, so don't go trying it in the terminal, iykyk π
β¨ NAME β¨
ntp_clear β clears the NTP state and sets the clocksource quantisation adjustment. two jobs, one function, main character energy fr π
π¦ SYNOPSIS π¦
void ntp_clear (unsigned int tkid , s64 cs_tick_adj );
πΈ ARGUMENTS πΈ
tkidβ the Timekeeper ID. that's it, that's the whole vibe πcs_tick_adjβ the per-second adjustment, measured in ns<<NTP_SCALE_SHIFT. yes the shift is part of the deal, don't skip it β¨
π DESCRIPTION π
okay so here's the tea β the timekeeping core uses a whole integer number of cycles (cycle_interval) per NTP interval. sounds fine right? but nope β because of that, the real time that interval represents can differ from the nominal NTP_INTERVAL_LENGTH by up to half a counter period. half! a whole half! π
so what this function does is fold that fixed offset straight into cs_tick_adj, which makes it an explicit part of the tick_length computation over in ntp.c β instead of it getting quietly applied during timekeeping accumulation, where the NTP code literally never saw it π like, the NTP code was just out here living its life with no idea. not anymore.
and just like ntp_tick_adj, this whole thing stays internal to the kernel β it's giving secretive, it's giving private. userspace still only sees the nominal tick via adjtimex, no cap. π«Ά
good news though: NTP keeps its full symmetric Β±MAXFREQ range around that corrected base rate, so nothing gets clipped π
when does it get called? whenever the clocksource is (re)configured β which just so happens to also be exactly when the rest of the NTP state has to be cleared. so the two get done together, obviously. why do one thing when you can slay two at once β¨π
π₯ SEE ALSO π₯
- Kernel file
./kernel/time/ntp.c struct ntp_data(9)pps_clear(9)ntp_get_next_leap(9)ntp_synced(9)
go read those too, bestie, they're all connected π¦
<div>β and that's the whole page! straight outta ./kernel/time, dated October 2026, and yeah β it's ntp_clear(9), we been knew πβ¨π</div>
π¦ 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