hrtimer: Fixup unlocked access to wall_to_monotonic
PATCH 1/1 hrtimer: Fixup unlocked access to wall_to_monotonic
commit f4304ab21513b834c8fe3403927c60c2b81a72d7 (HZ free NTP) moved the access to wall_to_monotonic in hrtimer_get_softirq_time() out of the xtime_lock protection.
Move it back into the seq_lock section.
Signed-off-by Thomas Gleixner <[email protected]>
kernel/hrtimer.c +3 -2
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);static void hrtimer_get_softirq_time (struct hrtimer_cpu_base *base) {ktime_t xtim, tomono; -struct timespec xts; +struct timespec xts, tom;unsigned long seq; do {
@@ -145,10 +145,11 @@ #ifdef CONFIG_NO_HZ#else xts = xtime;#endif + tom = wall_to_monotonic; }while (read_seqretry (&xtime_lock, seq)); xtim =timespec_to_ktime (xts); - tomono =timespec_to_ktime (wall_to_monotonic); + tomono =timespec_to_ktime (tom); base->clock_base[CLOCK_REALTIME ].softirq_time = xtim; base->clock_base[CLOCK_MONOTONIC ].softirq_time =ktime_add (xtim, tomono);
Quoted 7 lines · Thomas Gleixner
commit
f4304ab21513b834c8fe3403927c60c2b81a72d7(HZ free NTP) moved the access towall_to_monotonicinhrtimer_get_softirq_time()out of thextime_lockprotection.Move it back into the
seq_locksection.Signed-off-by Thomas Gleixner <[email protected]>
Ek! Thanks Thomas!
Acked-by John Stultz <[email protected]>