From c1e4ed23d2d7d7c142852000af00ba561e11039a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 6 Jan 2004 15:52:48 -0800 Subject: [PATCH] [PATCH] ia32 sched_clock() deadlock fix From: Ingo Molnar , Voyager is getting odd deadlocks due to the taking of xtime_lock() in sched_clock()->get_jiffies_64(). I had this patch queued up to fix a different deadlock, which occurs when we relax the requirement that TSC's be synchronised across CPUs. But it will fix James' deadlock too. --- arch/i386/kernel/timers/timer_tsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index 0030d7989fea3..cafc53150595d 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -140,7 +140,8 @@ unsigned long long sched_clock(void) #ifndef CONFIG_NUMA if (!use_tsc) #endif - return (unsigned long long)get_jiffies_64() * (1000000000 / HZ); + /* no locking but a rare wrong value is not a big deal */ + return jiffies_64 * (1000000000 / HZ); /* Read the Time Stamp Counter */ rdtscll(this_offset); -- 2.53.0