From patchwork Tue Jun 19 08:28:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 9447 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 1557923E4F for ; Tue, 19 Jun 2012 08:30:21 +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 C067DA184E1 for ; Tue, 19 Jun 2012 08:30:20 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so4787113ggn.11 for ; Tue, 19 Jun 2012 01:30:20 -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=Gza0M8p9cs7BqrGIJ5ENhDy5ZPXUEALHRKiAxrD4TPyq49r8Hena2F1GzaCy8NAQXh kNnwMIdU+G9TN7acLfs3hpxw1JnTRbmItO7yuETOvufbUNisH/iXq8NFV5muXu1lmjye uaVckSBwMPgq8FnT/depLmqPpHlpKO6AW4tFvODzpV9bK01GN+Y1OaWlhBK0zvKuovwe 5hAEtscW/iskgsOWAph4RkwFGVl0/3dF2ToLi9jn4620OyywjipIuuNezG3QmxQ15KwC jkzNJ19bvJZdj514XU5Vkw1tdFFDY6WlLpsXgDwaAgDTuQkEQSJ5F0zCCtc40x4gb2c+ 5Y1Q== Received: by 10.50.193.196 with SMTP id hq4mr304303igc.57.1340094620254; Tue, 19 Jun 2012 01:30:20 -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 v20csp112594ibb; Tue, 19 Jun 2012 01:30:19 -0700 (PDT) Received: by 10.216.212.217 with SMTP id y67mr10189727weo.173.1340094618793; Tue, 19 Jun 2012 01:30:18 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx.google.com with ESMTPS id r7si25776476wix.28.2012.06.19.01.30.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Jun 2012 01:30:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.170 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.212.170; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.170 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by wibhm6 with SMTP id hm6so2404027wib.1 for ; Tue, 19 Jun 2012 01:30:18 -0700 (PDT) Received: by 10.216.213.143 with SMTP id a15mr10678924wep.156.1340094618167; Tue, 19 Jun 2012 01:30:18 -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 d3sm56434001wiz.9.2012.06.19.01.30.16 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Jun 2012 01:30:17 -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 Subject: [PATCH v2 4/5] sched, x86: Remove broken power estimation Date: Tue, 19 Jun 2012 10:28:55 +0200 Message-Id: <1340094536-20873-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340094536-20873-1-git-send-email-vincent.guittot@linaro.org> References: <1340094536-20873-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQk4wNia9YXmEsGaqcGJFjenVTr248JYOHmFex39wC5t0W4QuxJTZzDvh211jbHzJRvrP88b 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