ktime_get_real_ts64_mg(9)
π ktime_get_real_ts64_mg(9) π
okay so welcome to this page from the Kernel API Manual, bestie β it's all about ktime_get_real_ts64_mg. β¨
πΈ NAME πΈ
ktime_get_real_ts64_mg β attempt to update floor value and return result. That's the whole assignment, and it ate. π
β¨ SYNOPSIS β¨
void ktime_get_real_ts64_mg (struct timespec64 *ts );
π ARGUMENTS π
tsβ pointer to thetimespecto be set. π
π¦ DESCRIPTION π¦
okay so what happens is: it gets a monotonic fine-grained time value and attempts to swap it into mg_floor. If that succeeds, then it accepts the new floor value. If it fails, that means another task raced in during the interim time and updated the floor. And since any update to the floor must be later than the previous floor, either outcome is acceptable β literally both are fine, no cap. β¨
Typically this will be called after calling ktime_get_coarse_real_ts64_mg, and after determining that the resulting coarse-grained timestamp did not effect a change in ctime. Any more recent floor value would effect a change to ctime, so there is no need to retry the atomic64_try_cmpxchg on failure. π
ts will be filled with the latest floor value, regardless of the outcome of the cmpxchg. π
π¨ Note that this is a filesystem specific interface and should be avoided outside of that context. Fr fr, stay in your lane.
π SEE ALSO π
the whole squad is here:
- Kernel file
./kernel/time/timekeeping.c struct tk_fast(9)tk_setup_internals(9)update_fast_timekeeper(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_update_offsets_now(9)random_get_entropy_fallback(9)do_adjtimex(9)hardpps(9)ktime_get_aux(9)ktime_get_aux_ts64(9)
xoxo π source/version ./kernel/time, dated October 2026, page ktime_get_real_ts64_mg(9) β bye bestie! β¨π¦
π¦ 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