[PATCH 2.5] cpufreq: update system-wide loops_per_jiffy only on UP

Dominik Brodowski (linux@brodo.de)
Sat, 21 Dec 2002 18:41:09 +0100


loops_per_jiffy should only be updated on UP systems - on SMP the CPUs might
have different such values when frequency scaling is active. On SMP it's
safest to use the default value calculated during the boot process.

Dominik

diff -ruN linux-original/kernel/cpufreq.c linux/kernel/cpufreq.c
--- linux-original/kernel/cpufreq.c 2002-12-21 14:53:52.000000000 +0100
+++ linux/kernel/cpufreq.c 2002-12-21 18:20:53.000000000 +0100
@@ -936,17 +936,23 @@
* adjust_jiffies - adjust the system "loops_per_jiffy"
*
* This function alters the system "loops_per_jiffy" for the clock
- * speed change. Note that loops_per_jiffy is only updated if all
- * CPUs are affected - else there is a need for per-CPU loops_per_jiffy
- * values which are provided by various architectures.
+ * speed change. Note that loops_per_jiffy cannot be updated on SMP
+ * systems as each CPU might be scaled differently. So, use the arch
+ * per-CPU loops_per_jiffy value wherever possible.
*/
+#ifndef CONFIG_SMP
static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
{
if ((val == CPUFREQ_PRECHANGE && ci->old < ci->new) ||
(val == CPUFREQ_POSTCHANGE && ci->old > ci->new))
- if (ci->cpu == CPUFREQ_ALL_CPUS)
- loops_per_jiffy = cpufreq_scale(loops_per_jiffy, ci->old, ci->new);
+ loops_per_jiffy = cpufreq_scale(loops_per_jiffy, ci->old, ci->new);
}
+#else
+static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
+{
+ return;
+}
+#endif


/**

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/