From patchwork Wed Jun 20 15:19:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 9510 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 57A0B23E1B for ; Wed, 20 Jun 2012 15:20:40 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 28CA2A18410 for ; Wed, 20 Jun 2012 15:20:40 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so6361165yhp.11 for ; Wed, 20 Jun 2012 08:20:40 -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=l0+H9FHlXXhcCfKRcRn/FDD89T+4mSWc9cUuZ2hu6iZk8lAvcdi07rTsVBA9pDNcQO TmzWNQDUEJl+FPAvr97NYZMQ34noA46HbfFmFDXeVURCV5cyGMXjTJaMri3n4qaiZOfh VqwYQd3sAuQRsdaQNIbI2E8LUvSOoMQt/6D2MK43bgL/KRAmshlrda2QK+rJRWT1Ckuv 7aykpNE1MUh9LZYexBu3qRo5duuvswrDRT0Y1CS1nhNqihdi27hndaI0eQGZegPh7Wfj I4FkUFjFvMOg/KyQXK5Pr1VBZD3dPPPS/Eeu+24wjl4kTMIkbmS9ovI8RzoAWi2fBz/F vJbQ== Received: by 10.50.163.99 with SMTP id yh3mr4884699igb.53.1340205639544; Wed, 20 Jun 2012 08:20:39 -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 v20csp185160ibb; Wed, 20 Jun 2012 08:20:38 -0700 (PDT) Received: by 10.180.19.138 with SMTP id f10mr12768567wie.18.1340205638292; Wed, 20 Jun 2012 08:20:38 -0700 (PDT) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id o43si29249162wee.151.2012.06.20.08.20.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 08:20:38 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by mail-wg0-f42.google.com with SMTP id ds11so3779797wgb.1 for ; Wed, 20 Jun 2012 08:20:37 -0700 (PDT) Received: by 10.216.226.136 with SMTP id b8mr2850908weq.152.1340205637775; Wed, 20 Jun 2012 08:20:37 -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 gb9sm39525109wib.8.2012.06.20.08.20.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 08:20:36 -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 v3 4/5] sched, x86: Remove broken power estimation Date: Wed, 20 Jun 2012 17:19:21 +0200 Message-Id: <1340205562-7653-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340205562-7653-1-git-send-email-vincent.guittot@linaro.org> References: <1340205562-7653-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQnq/jWmRelp+pkc3Zu0Hf8JbpcEWkVs3Sjf2E2/bJ8Dj0rZtTIt05gSSax8lQi45HgXeJPY 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