From patchwork Mon Jul 9 09:27:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 9896 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5059F23E1B for ; Mon, 9 Jul 2012 09:27:58 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 09D12A180D2 for ; Mon, 9 Jul 2012 09:27:57 +0000 (UTC) Received: by ggnf1 with SMTP id f1so10540473ggn.11 for ; Mon, 09 Jul 2012 02:27:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=gv6R7UhR0T4PGBJxU1AFolLcPgFgjubPtRwsBCP5xKQ=; b=ObOBeVdlpxindKF2XMKktZo0BiizvDAJJ071Ce1V4rrobyhpIbN/UHrkvctKvqbQjz +4nMQMfPTvnWdsEW5TKZySjAIX2S97sDa7voRgp5vbGJ+itu5R1nl1blzzi3AIne9q2I GNhu2auMKeDLMDpBk9lao4MZgH9hIoUR+guorGM0boSvVGQU+01j7STXIplw/F375x19 kVOiZSANVG7Lg/hzOtRZnFmWA2ouUbAg5EvYGjI3LRelCqT55s4cl4harb0wu0f6apKz khVmtIFX2aUNy0Jwx0hLR+Fit+nDU5pEILjWCybNCkRiFKfX/yx7zF2qFB0fHhD2HEVh xS8A== Received: by 10.50.57.167 with SMTP id j7mr7674660igq.53.1341826077352; Mon, 09 Jul 2012 02:27:57 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp33303ibb; Mon, 9 Jul 2012 02:27:53 -0700 (PDT) Received: by 10.180.79.229 with SMTP id m5mr27917021wix.13.1341826073002; Mon, 09 Jul 2012 02:27:53 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id o11si37083772wel.65.2012.07.09.02.27.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 02:27:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by wibhr14 with SMTP id hr14so2215259wib.13 for ; Mon, 09 Jul 2012 02:27:52 -0700 (PDT) Received: by 10.180.100.131 with SMTP id ey3mr27885190wib.15.1341826072505; Mon, 09 Jul 2012 02:27:52 -0700 (PDT) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPS id j6sm33557246wiy.4.2012.07.09.02.27.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 02:27:51 -0700 (PDT) From: Vincent Guittot To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, devicetree-discuss@lists.ozlabs.org Cc: linux@arm.linux.org.uk, a.p.zijlstra@chello.nl, grant.likely@secretlab.ca, rob.herring@calxeda.com, yong.zhang0@gmail.com, namhyung@kernel.org, jean.pihet@newoldbits.com Subject: [PATCH v4 4/5] sched, x86: Remove broken power estimation Date: Mon, 9 Jul 2012 11:27:05 +0200 Message-Id: <1341826026-6504-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1341826026-6504-1-git-send-email-vincent.guittot@linaro.org> References: <1341826026-6504-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQkg72ZXenrA1M0UPJwG/v8o6RtmEhgWN1GLBxr0CE7R/JXW/q7CI0N31Syz99cvTnOR8D0N From: Peter Zijlstra 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 Link: http://lkml.kernel.org/n/tip-wjjwelpti8f8k7i1pdnzmdr8@git.kernel.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 -#include -#include -#include - -#include -#include - -#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