Commit d0821d8b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sched_clock() fix

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.
parent 5c38b5da
...@@ -139,7 +139,7 @@ unsigned long long sched_clock(void) ...@@ -139,7 +139,7 @@ unsigned long long sched_clock(void)
* synchronized across all CPUs. * synchronized across all CPUs.
*/ */
#ifndef CONFIG_NUMA #ifndef CONFIG_NUMA
if (unlikely(!cpu_has_tsc)) if (!use_tsc)
#endif #endif
return (unsigned long long)jiffies * (1000000000 / HZ); return (unsigned long long)jiffies * (1000000000 / HZ);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment