Skip to content

Commit eff4849

Browse files
committed
timekeeping: Annotate ktime_get_boot_fast_ns() with data_race()
Accessing timekeeper::offset_boot in ktime_get_boot_fast_ns() is an intended data race as the reader side cannot synchronize with a writer and there is no space in struct tk_read_base of the NMI safe timekeeper. Mark it so. Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 62c1256 commit eff4849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/timekeeping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ u64 notrace ktime_get_boot_fast_ns(void)
528528
{
529529
struct timekeeper *tk = &tk_core.timekeeper;
530530

531-
return (ktime_get_mono_fast_ns() + ktime_to_ns(tk->offs_boot));
531+
return (ktime_get_mono_fast_ns() + ktime_to_ns(data_race(tk->offs_boot)));
532532
}
533533
EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns);
534534

0 commit comments

Comments
 (0)