linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scheduler: fix x86 regression in native_sched_clock
@ 2007-12-07  1:19 Stefano Brivio
  2007-12-07  5:29 ` Nick Piggin
                   ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Stefano Brivio @ 2007-12-07  1:19 UTC (permalink / raw)
  To: Ingo Molnar, Robert Love
  Cc: linux-kernel, Dave Jones, Rafael J. Wysocki, Michael Buesch,
	Thomas Gleixner, Andrew Morton, Len Brown

This patch fixes a regression introduced by:

commit bb29ab26863c022743143f27956cc0ca362f258c
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Jul 9 18:51:59 2007 +0200

This caused the jiffies counter to leap back and forth on cpufreq changes
on my x86 box. I'd say that we can't always assume that TSC does "small
errors" only, when marked unstable. On cpufreq changes these errors can be
huge.

The original bug report can be found here:
http://bugzilla.kernel.org/show_bug.cgi?id=9475


Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>

---

diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index 9ebc0da..d29cd9c 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -98,13 +98,8 @@ unsigned long long native_sched_clock(void)
 
 	/*
 	 * Fall back to jiffies if there's no TSC available:
-	 * ( But note that we still use it if the TSC is marked
-	 *   unstable. We do this because unlike Time Of Day,
-	 *   the scheduler clock tolerates small errors and it's
-	 *   very important for it to be as fast as the platform
-	 *   can achive it. )
 	 */
-	if (unlikely(!tsc_enabled && !tsc_unstable))
+	if (unlikely(!tsc_enabled))
 		/* No locking but a rare wrong value is not a big deal: */
 		return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
 

-- 
Ciao
Stefano

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

end of thread, other threads:[~2007-12-12 10:45 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-07  1:19 [PATCH] scheduler: fix x86 regression in native_sched_clock Stefano Brivio
2007-12-07  5:29 ` Nick Piggin
2007-12-07  5:51 ` Thomas Gleixner
2007-12-07  7:18   ` Guillaume Chazarain
2007-12-07  8:02     ` Guillaume Chazarain
2007-12-07  8:51       ` Ingo Molnar
2007-12-07  9:29         ` Guillaume Chazarain
2007-12-07  9:59           ` Ingo Molnar
2007-12-07 13:55       ` [patch] x86: scale cyc_2_nsec according to CPU frequency Ingo Molnar
2007-12-07 14:27         ` Guillaume Chazarain
2007-12-07 14:52           ` Ingo Molnar
2007-12-08 15:57             ` Arjan van de Ven
2007-12-08 19:16               ` Ingo Molnar
2007-12-08 20:18                 ` Arjan van de Ven
2007-12-07 10:37   ` [PATCH] scheduler: fix x86 regression in native_sched_clock Andi Kleen
2007-12-07  8:45 ` Ingo Molnar
2007-12-07 10:32   ` Andrew Morton
2007-12-07 10:40     ` Ingo Molnar
2007-12-07 11:07       ` Ingo Molnar
2007-12-07 11:09       ` Andrew Morton
2007-12-07 11:12         ` Ingo Molnar
2007-12-07 11:13   ` Nick Piggin
2007-12-07 11:17     ` Ingo Molnar
2007-12-07 16:48       ` Nick Piggin
2007-12-08  0:50         ` Nick Piggin
2007-12-08  0:57           ` Nick Piggin
2007-12-08  8:52             ` Ingo Molnar
2007-12-08 23:37               ` Guillaume Chazarain
2007-12-12  4:42               ` Nick Piggin
2007-12-12 10:44                 ` Ingo Molnar
2007-12-07 11:18     ` Guillaume Chazarain
2007-12-07 11:57       ` Guillaume Chazarain
2007-12-07 11:23     ` stefano.brivio
2007-12-07 12:11       ` Ingo Molnar
2007-12-07 12:25       ` Ingo Molnar
2007-12-07 12:35         ` Ingo Molnar
2007-12-07 12:40           ` Ingo Molnar
2007-12-07 14:54             ` Ingo Molnar
2007-12-07 16:46               ` Guillaume Chazarain
2007-12-07 17:57                 ` Ingo Molnar
2007-12-08 15:06                   ` Mark Lord
2007-12-08 15:13                     ` Ingo Molnar
2007-12-08 15:27                       ` Michael Buesch
2007-12-08 15:33                         ` Ingo Molnar
2007-12-08 15:36                           ` Michael Buesch
2007-12-08 15:41                             ` Ingo Molnar
2007-12-07 11:24     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).