From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757536Ab0BEU6X (ORCPT ); Fri, 5 Feb 2010 15:58:23 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:41751 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757495Ab0BEU6V (ORCPT ); Fri, 5 Feb 2010 15:58:21 -0500 Subject: [PATCHv4 1/2] sched: enable ARCH_POWER From: Joel Schopp To: Peter Zijlstra Cc: ego@in.ibm.com, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , linux-kernel@vger.kernel.org, benh@kernel.crashing.org, jschopp@austin.ibm.com In-Reply-To: <1264720833.9660.21.camel@jschopp-laptop> References: <1264017638.5717.121.camel@jschopp-laptop> <1264017764.5717.127.camel@jschopp-laptop> <1264548486.12239.55.camel@jschopp-laptop> <1264720833.9660.21.camel@jschopp-laptop> Content-Type: text/plain; charset="UTF-8" Date: Fri, 05 Feb 2010 14:57:52 -0600 Message-ID: <1265403472.6089.40.camel@jschopp-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable the scheduler feature that allows use of arch_scale_smt_power. Stub out the broken x86 implementation. Signed-off-by: Joel Schopp --- Index: linux-2.6.git/kernel/sched_features.h =================================================================== --- linux-2.6.git.orig/kernel/sched_features.h +++ linux-2.6.git/kernel/sched_features.h @@ -102,7 +102,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, 1) /* * Use arch dependent cpu power functions */ -SCHED_FEAT(ARCH_POWER, 0) +SCHED_FEAT(ARCH_POWER, 1) SCHED_FEAT(HRTICK, 0) SCHED_FEAT(DOUBLE_TICK, 0) Index: linux-2.6.git/arch/x86/kernel/cpu/sched.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/cpu/sched.c +++ linux-2.6.git/arch/x86/kernel/cpu/sched.c @@ -44,11 +44,9 @@ unsigned long arch_scale_freq_power(stru unsigned long arch_scale_smt_power(struct sched_domain *sd, int cpu) { /* - * aperf/mperf already includes the smt gain + * aperf/mperf already includes the smt gain, but represents capacity + * as 0 when idle. So for now just return default. */ - if (boot_cpu_has(X86_FEATURE_APERFMPERF)) - return SCHED_LOAD_SCALE; - return default_scale_smt_power(sd, cpu); } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e1.ny.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 35655B7D15 for ; Sat, 6 Feb 2010 07:58:12 +1100 (EST) Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by e1.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o15KsW3O012163 for ; Fri, 5 Feb 2010 15:54:32 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o15Kw88i080030 for ; Fri, 5 Feb 2010 15:58:08 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o15KvsOl027711 for ; Fri, 5 Feb 2010 13:57:55 -0700 Subject: [PATCHv4 1/2] sched: enable ARCH_POWER From: Joel Schopp To: Peter Zijlstra In-Reply-To: <1264720833.9660.21.camel@jschopp-laptop> References: <1264017638.5717.121.camel@jschopp-laptop> <1264017764.5717.127.camel@jschopp-laptop> <1264548486.12239.55.camel@jschopp-laptop> <1264720833.9660.21.camel@jschopp-laptop> Content-Type: text/plain; charset="UTF-8" Date: Fri, 05 Feb 2010 14:57:52 -0600 Message-ID: <1265403472.6089.40.camel@jschopp-laptop> Mime-Version: 1.0 Cc: ego@in.ibm.com, linux-kernel@vger.kernel.org, Ingo Molnar , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Enable the scheduler feature that allows use of arch_scale_smt_power. Stub out the broken x86 implementation. Signed-off-by: Joel Schopp --- Index: linux-2.6.git/kernel/sched_features.h =================================================================== --- linux-2.6.git.orig/kernel/sched_features.h +++ linux-2.6.git/kernel/sched_features.h @@ -102,7 +102,7 @@ SCHED_FEAT(CACHE_HOT_BUDDY, 1) /* * Use arch dependent cpu power functions */ -SCHED_FEAT(ARCH_POWER, 0) +SCHED_FEAT(ARCH_POWER, 1) SCHED_FEAT(HRTICK, 0) SCHED_FEAT(DOUBLE_TICK, 0) Index: linux-2.6.git/arch/x86/kernel/cpu/sched.c =================================================================== --- linux-2.6.git.orig/arch/x86/kernel/cpu/sched.c +++ linux-2.6.git/arch/x86/kernel/cpu/sched.c @@ -44,11 +44,9 @@ unsigned long arch_scale_freq_power(stru unsigned long arch_scale_smt_power(struct sched_domain *sd, int cpu) { /* - * aperf/mperf already includes the smt gain + * aperf/mperf already includes the smt gain, but represents capacity + * as 0 when idle. So for now just return default. */ - if (boot_cpu_has(X86_FEATURE_APERFMPERF)) - return SCHED_LOAD_SCALE; - return default_scale_smt_power(sd, cpu); }