From patchwork Fri Apr 11 09:44:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 28251 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8ED9520822 for ; Fri, 11 Apr 2014 09:47:16 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf16601040yha.11 for ; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=2ESbG0USfokPMZxv4dnDd1QqwVACY/euzR5OTTVHh8o=; b=Ny70FjWrJW+1OgTUjSJWZJPnf/ZakFOCaegKjcrCjDoCF/FhSEx5r8iNmfD73Y4yc7 p9seWovrxTa7eOWFlcwhfpAdEDZkVOqhCVih7gjKTrKVnpBnd9ldFmr2i5ceFphobdPo Jer3U2XIdy2n3g+zFhbKQUipfq7sFTIyOoRmrzXYY/8wc9iK2rL0zj5ROq0OqkCdJqe6 iBShqh+oCK8qwfVIa/F9Wahi5fsSxRCyZuvWWXrkUfMwlTYaehTD9fQxSzJ1/wbGUqhn ImyvM00+IedznRBPcdB9PqWvGwxWWVY4Q8sXewA7tRZ/LSvgW2hZu4DunE4V3l3KM0Qv czCw== X-Gm-Message-State: ALoCoQl0Ii4aU8Kqw7/FOWW+vqGX2ElupHr+w88TPVsS4qp61oc4e6K4/GGojk4p5q03pRghG+vy X-Received: by 10.236.118.38 with SMTP id k26mr10624091yhh.35.1397209636346; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.203 with SMTP id w69ls1485331qge.3.gmail; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr15832463vdc.1.1397209636255; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id u5si1202184vdo.58.2014.04.11.02.47.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:47:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jy13so4467506veb.2 for ; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr6153432vch.22.1397209636138; Fri, 11 Apr 2014 02:47:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp42999vcb; Fri, 11 Apr 2014 02:47:15 -0700 (PDT) X-Received: by 10.194.76.10 with SMTP id g10mr1091119wjw.67.1397209634907; Fri, 11 Apr 2014 02:47:14 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id i2si2427305wjx.231.2014.04.11.02.47.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Apr 2014 02:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY36-00050F-Js; Fri, 11 Apr 2014 09:47:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY2d-0000Dx-CS; Fri, 11 Apr 2014 09:46:51 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY2b-0000Di-FT for linux-arm-kernel@merlin.infradead.org; Fri, 11 Apr 2014 09:46:33 +0000 Received: from mail-we0-f178.google.com ([74.125.82.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY2Z-0003bB-QA for linux-arm-kernel@lists.infradead.org; Fri, 11 Apr 2014 09:46:32 +0000 Received: by mail-we0-f178.google.com with SMTP id u56so5083768wes.37 for ; Fri, 11 Apr 2014 02:46:10 -0700 (PDT) X-Received: by 10.180.85.234 with SMTP id k10mr2615890wiz.32.1397209570823; Fri, 11 Apr 2014 02:46:10 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id ct2sm10526013wjb.33.2014.04.11.02.46.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:46:09 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tony.luck@intel.com, fenghua.yu@intel.com, schwidefsky@de.ibm.com, cmetcalf@tilera.com, benh@kernel.crashing.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/5] sched: powerpc: create a dedicated topology table Date: Fri, 11 Apr 2014 11:44:39 +0200 Message-Id: <1397209481-28542-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1397209481-28542-1-git-send-email-vincent.guittot@linaro.org> References: <1397209481-28542-1-git-send-email-vincent.guittot@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140411_024632_005214_B8512307 X-CRM114-Status: GOOD ( 14.30 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.178 listed in list.dnswl.org] Cc: preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org, Vincent Guittot , dietmar.eggemann@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Create a dedicated topology table for handling asymetric feature of powerpc. Signed-off-by: Vincent Guittot Reviewed-by: Preeti U Murthy --- arch/powerpc/kernel/smp.c | 31 +++++++++++++++++++++++-------- include/linux/sched.h | 2 -- kernel/sched/core.c | 6 ------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index ac2621a..c9cade5 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -755,6 +755,28 @@ int setup_profiling_timer(unsigned int multiplier) return 0; } +#ifdef CONFIG_SCHED_SMT +/* cpumask of CPUs with asymetric SMT dependancy */ +static const int powerpc_smt_flags(void) +{ + int flags = SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES; + + if (cpu_has_feature(CPU_FTR_ASYM_SMT)) { + printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n"); + flags |= SD_ASYM_PACKING; + } + return flags; +} +#endif + +static struct sched_domain_topology_level powerpc_topology[] = { +#ifdef CONFIG_SCHED_SMT + { cpu_smt_mask, powerpc_smt_flags, SD_INIT_NAME(SMT) }, +#endif + { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { NULL, }, +}; + void __init smp_cpus_done(unsigned int max_cpus) { cpumask_var_t old_mask; @@ -779,15 +801,8 @@ void __init smp_cpus_done(unsigned int max_cpus) dump_numa_cpu_topology(); -} + set_sched_topology(powerpc_topology); -int arch_sd_sibling_asym_packing(void) -{ - if (cpu_has_feature(CPU_FTR_ASYM_SMT)) { - printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n"); - return SD_ASYM_PACKING; - } - return 0; } #ifdef CONFIG_HOTPLUG_CPU diff --git a/include/linux/sched.h b/include/linux/sched.h index 3161701..7df3ca2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -872,8 +872,6 @@ enum cpu_idle_type { #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ #define SD_NUMA 0x4000 /* cross-node balancing */ -extern int __weak arch_sd_sibiling_asym_packing(void); - #ifdef CONFIG_SCHED_SMT static inline const int cpu_smt_flags(void) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b15b994..3743a6c 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5830,11 +5830,6 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight); } -int __weak arch_sd_sibling_asym_packing(void) -{ - return 0*SD_ASYM_PACKING; -} - /* * Initializers for schedule domains * Non-inlined to reduce accumulated stack pressure in build_sched_domains() @@ -6015,7 +6010,6 @@ sd_init(struct sched_domain_topology_level *tl, int cpu) if (sd->flags & SD_SHARE_CPUPOWER) { sd->imbalance_pct = 110; sd->smt_gain = 1178; /* ~15% */ - sd->flags |= arch_sd_sibling_asym_packing(); } else if (sd->flags & SD_SHARE_PKG_RESOURCES) { sd->imbalance_pct = 117;