mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.5] cpufreq: update system-wide loops_per_jiffy only on UP
@ 2002-12-21 17:41 Dominik Brodowski
  0 siblings, 0 replies; only message in thread
From: Dominik Brodowski @ 2002-12-21 17:41 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, cpufreq

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
 
 
 /**


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-21 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-21 17:41 [PATCH 2.5] cpufreq: update system-wide loops_per_jiffy only on UP Dominik Brodowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome