Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220415091920.956045162@linutronix.de

+1 -1
+1 -1
kernel/time/timekeeping.c
··· 528 528 { 529 529 struct timekeeper *tk = &tk_core.timekeeper; 530 530 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))); 532 532 } 533 533 EXPORT_SYMBOL_GPL(ktime_get_boot_fast_ns); 534 534