Skip to content

Commit

Permalink
[PATCH] hrtimer: fix up unlocked access to wall_to_monotonic
Browse files Browse the repository at this point in the history
commit f4304ab (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 <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Mar 17, 2007
1 parent c6ca97d commit ad28d94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -145,10 +145,11 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
#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);
Expand Down

0 comments on commit ad28d94

Please sign in to comment.