sched/x86: Remove broken power estimation
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 13 Jun 2012 13:24:45 +0000 (15:24 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 24 Jul 2012 11:53:00 +0000 (13:53 +0200)
The x86 sched power implementation has been broken forever and gets in
the way of other stuff, remove it.

[ For archaeological interest, fixing this code would require dealing
  with the cross-cpu calling of these functions and more importantly, we
  need to filter idle time out of the a/m-perf stuff because the ratio
  will go down to 0 when idle, giving a 0 capacity which is not what
  we'd want. ]

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Link: http://lkml.kernel.org/r/1339594110.8980.38.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/Makefile
arch/x86/kernel/cpu/sched.c [deleted file]

index 6ab6aa2fdfdd21ef0192b0eb11a99c1a0531f8ab..c5981267a60cc3a1e1ea023bf14b42f68bd464b7 100644 (file)
@@ -14,7 +14,7 @@ CFLAGS_common.o               := $(nostackp)
 
 obj-y                  := intel_cacheinfo.o scattered.o topology.o
 obj-y                  += proc.o capflags.o powerflags.o common.o
-obj-y                  += vmware.o hypervisor.o sched.o mshyperv.o
+obj-y                  += vmware.o hypervisor.o mshyperv.o
 obj-y                  += rdrand.o
 obj-y                  += match.o
 
diff --git a/arch/x86/kernel/cpu/sched.c b/arch/x86/kernel/cpu/sched.c
deleted file mode 100644 (file)
index a640ae5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <linux/sched.h>
-#include <linux/math64.h>
-#include <linux/percpu.h>
-#include <linux/irqflags.h>
-
-#include <asm/cpufeature.h>
-#include <asm/processor.h>
-
-#ifdef CONFIG_SMP
-
-static DEFINE_PER_CPU(struct aperfmperf, old_perf_sched);
-
-static unsigned long scale_aperfmperf(void)
-{
-       struct aperfmperf val, *old = &__get_cpu_var(old_perf_sched);
-       unsigned long ratio, flags;
-
-       local_irq_save(flags);
-       get_aperfmperf(&val);
-       local_irq_restore(flags);
-
-       ratio = calc_aperfmperf_ratio(old, &val);
-       *old = val;
-
-       return ratio;
-}
-
-unsigned long arch_scale_freq_power(struct sched_domain *sd, int cpu)
-{
-       /*
-        * do aperf/mperf on the cpu level because it includes things
-        * like turbo mode, which are relevant to full cores.
-        */
-       if (boot_cpu_has(X86_FEATURE_APERFMPERF))
-               return scale_aperfmperf();
-
-       /*
-        * maybe have something cpufreq here
-        */
-
-       return default_scale_freq_power(sd, cpu);
-}
-
-unsigned long arch_scale_smt_power(struct sched_domain *sd, int cpu)
-{
-       /*
-        * aperf/mperf already includes the smt gain
-        */
-       if (boot_cpu_has(X86_FEATURE_APERFMPERF))
-               return SCHED_LOAD_SCALE;
-
-       return default_scale_smt_power(sd, cpu);
-}
-
-#endif