public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] hrtimer: Fixup unlocked access to wall_to_monotonic
  2007-03-14 20:57 [PATCH] hrtimer: Fixup unlocked access to wall_to_monotonic Thomas Gleixner
@ 2007-03-14 20:55 ` john stultz
  0 siblings, 0 replies; 2+ messages in thread
From: john stultz @ 2007-03-14 20:55 UTC (permalink / raw)
  To: tglx; +Cc: Andrew Morton, LKML, Ingo Molnar

On Wed, 2007-03-14 at 21:57 +0100, Thomas Gleixner wrote:
> 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 <tglx@linutronix.de>

Ek! Thanks Thomas!
Acked-by: John Stultz <johnstul@us.ibm.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] hrtimer: Fixup unlocked access to wall_to_monotonic
@ 2007-03-14 20:57 Thomas Gleixner
  2007-03-14 20:55 ` john stultz
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2007-03-14 20:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, john stultz, Ingo Molnar

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 <tglx@linutronix.de>

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index ec4cb9f..e2053da 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -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);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-14 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-14 20:57 [PATCH] hrtimer: Fixup unlocked access to wall_to_monotonic Thomas Gleixner
2007-03-14 20:55 ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox