]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched_clock() fix
authorAndrew Morton <akpm@osdl.org>
Tue, 18 Nov 2003 16:14:51 +0000 (08:14 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 18 Nov 2003 16:14:51 +0000 (08:14 -0800)
From: Thomas Schlicter

sched_clock() will try to use the TSC even if the system is not using the TSC
as a time source.  It causes bad scheduling decisions and poor interactivity.

The problem was exhibited by the patch which uses ACPI PM as a time source,
but could also happen if the system is using the PIT.

arch/i386/kernel/timers/timer_tsc.c

index e87ec7a48edf231b1a1e7e68843450115b81727c..be9a2a533dd1e0dfad25032dc2833147fdfff386 100644 (file)
@@ -139,7 +139,7 @@ unsigned long long sched_clock(void)
         * synchronized across all CPUs.
         */
 #ifndef CONFIG_NUMA
-       if (unlikely(!cpu_has_tsc))
+       if (!use_tsc)
 #endif
                return (unsigned long long)jiffies * (1000000000 / HZ);