From: Vincent Guittot <vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
yong.zhang0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: [PATCH v4 4/5] sched, x86: Remove broken power estimation
Date: Mon, 9 Jul 2012 11:27:05 +0200 [thread overview]
Message-ID: <1341826026-6504-5-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1341826026-6504-1-git-send-email-vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
From: Peter Zijlstra <a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>
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-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>
Link: http://lkml.kernel.org/n/tip-wjjwelpti8f8k7i1pdnzmdr8-Ckxz5ZWcFp/9qxiX1TGQuw@public.gmane.org
---
arch/x86/kernel/cpu/Makefile | 2 +-
arch/x86/kernel/cpu/sched.c | 55 ------------------------------------------
2 files changed, 1 insertion(+), 56 deletions(-)
delete mode 100644 arch/x86/kernel/cpu/sched.c
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 6ab6aa2..c598126 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -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
index a640ae5..0000000
--- a/arch/x86/kernel/cpu/sched.c
+++ /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
--
1.7.9.5
next prev parent reply other threads:[~2012-07-09 9:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 9:27 [PATCH v4 0/5] ARM: topology: set the capacity of each cores for big.LITTLE Vincent Guittot
2012-07-09 9:27 ` [PATCH v4 1/5] ARM: topology: Add arch_scale_freq_power function Vincent Guittot
[not found] ` <1341826026-6504-1-git-send-email-vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-07-09 9:27 ` [PATCH v4 2/5] ARM: topology: factorize the update of sibling masks Vincent Guittot
2012-07-09 9:27 ` [PATCH v4 3/5] ARM: topology: Update cpu_power according to DT information Vincent Guittot
2012-07-09 10:55 ` Shilimkar, Santosh
2012-07-09 11:00 ` Peter Zijlstra
2012-07-09 11:04 ` Shilimkar, Santosh
[not found] ` <CAMQu2gydOEVK_fzmzkdrBwBfOq6eZG=0QfLUfFChWJu9unSn2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-09 12:32 ` Vincent Guittot
2012-07-09 13:00 ` Shilimkar, Santosh
2012-07-09 14:36 ` Vincent Guittot
[not found] ` <CAKfTPtCicLseyA4DnUwNWf7+jOmab4KLo8Yw=Rz1KPya+fE_-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-09 14:37 ` Shilimkar, Santosh
2012-07-09 15:10 ` Vincent Guittot
[not found] ` <CAKfTPtCcxg5PNqjXrz9zYwE-DDAUtdbaUuuGpGqGzOFZrk3rnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-09 15:28 ` Shilimkar, Santosh
[not found] ` <1341826026-6504-4-git-send-email-vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-09-13 13:03 ` Dave Martin
2012-07-09 9:27 ` Vincent Guittot [this message]
2012-07-09 9:27 ` [PATCH v4 5/5] sched: cpu_power: enable ARCH_POWER Vincent Guittot
2012-07-10 11:27 ` [PATCH v4 0/5] ARM: topology: set the capacity of each cores for big.LITTLE Peter Zijlstra
2012-07-10 12:35 ` Vincent Guittot
[not found] ` <CAKfTPtC0BcidJ2ga9c2fdWjrEsfXH48QtSnjv0YOCv7-k3K-Ug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-10 13:42 ` Peter Zijlstra
2012-09-13 9:17 ` Vincent Guittot
[not found] ` <CAKfTPtCpZS=ALAjwqX5Wb0j5HjrMjv87MEefGC2O5_p7ENeY2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-13 12:07 ` Peter Zijlstra
2012-09-13 12:51 ` Vincent Guittot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341826026-6504-5-git-send-email-vincent.guittot@linaro.org \
--to=vincent.guittot-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=namhyung-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=yong.zhang0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).