From patchwork Wed Mar 19 16:22:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26599 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E4CE4203C3 for ; Wed, 19 Mar 2014 16:25:57 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id gq1sf32920751obb.3 for ; Wed, 19 Mar 2014 09:25:57 -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=5anDWTZq5Cgoa7jpR0+W+m21LmUYB4MGgp9clRzhUhE=; b=csgpxvcPOWmFm/LyVhYO0xUJqlawuMSkmTwWPyVJJ4Mk4+RZkhHENtnzeUW4W7zcCG Kju1cz0vP3FID7gwZLv5veM9oh/BFuAa42gCnzQb77ea1A3L7j5LLBUC1+S+lZYR7O1D RPgfEphzFIddK7xJK2KrqYZfS3KEIDBQINkfLnIrGuqPEaCrVWbPcqCXnNM/VtFwgJdp lpsvquzHxdAPoq5KWQDuiN80ZBFKQZISRprHpuKZdcaTnF76x2nlESIQy1aOCt1XTR3c X6gS50ZfBQ8Sqbdactganm+F+BK3zoSbggrvZTf8WHDUooVjiS3paoxdv/51I23sxhtS IISQ== X-Gm-Message-State: ALoCoQnG11WxeFr9zg6Fukik4CfK4bGBjhfk9rpN/tF2ckLfimH4JYRW5UDwqW5eK6QZ1McVK2bW X-Received: by 10.50.114.134 with SMTP id jg6mr11224026igb.2.1395246357454; Wed, 19 Mar 2014 09:25:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.142 with SMTP id a14ls2648946qgf.31.gmail; Wed, 19 Mar 2014 09:25:57 -0700 (PDT) X-Received: by 10.220.50.74 with SMTP id y10mr54867vcf.50.1395246357285; Wed, 19 Mar 2014 09:25:57 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id u5si3638084vdo.112.2014.03.19.09.25.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:25:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so9213579vcb.5 for ; Wed, 19 Mar 2014 09:25:57 -0700 (PDT) X-Received: by 10.58.185.145 with SMTP id fc17mr31576556vec.14.1395246357165; Wed, 19 Mar 2014 09:25:57 -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.78.9 with SMTP id i9csp314548vck; Wed, 19 Mar 2014 09:25:56 -0700 (PDT) X-Received: by 10.180.106.167 with SMTP id gv7mr20937989wib.40.1395246355730; Wed, 19 Mar 2014 09:25:55 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id cb8si10657824wib.78.2014.03.19.09.25.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Mar 2014 09:25:55 -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 1WQJIb-0006Vd-Ev; Wed, 19 Mar 2014 16:25:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQJIR-0000LU-OW; Wed, 19 Mar 2014 16:24:51 +0000 Received: from mail-wg0-f52.google.com ([74.125.82.52]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQJI9-0000F5-Hc for linux-arm-kernel@lists.infradead.org; Wed, 19 Mar 2014 16:24:42 +0000 Received: by mail-wg0-f52.google.com with SMTP id k14so7211128wgh.23 for ; Wed, 19 Mar 2014 09:24:11 -0700 (PDT) X-Received: by 10.180.72.230 with SMTP id g6mr3457956wiv.1.1395246251724; Wed, 19 Mar 2014 09:24:11 -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 j8sm57174788wjn.13.2014.03.19.09.24.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:24:10 -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, james.hogan@imgtec.com, cmetcalf@tilera.com, benh@kernel.crashing.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 3/6] sched: powerpc: create a dedicated topology table Date: Wed, 19 Mar 2014 17:22:42 +0100 Message-Id: <1395246165-31150-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395246165-31150-1-git-send-email-vincent.guittot@linaro.org> References: <1395246165-31150-1-git-send-email-vincent.guittot@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140319_122433_934413_B0EBB0B7 X-CRM114-Status: GOOD ( 14.04 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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.220.174 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 4db592a..6479de4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -868,8 +868,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 f2bfa76..0b51ee3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5833,11 +5833,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() @@ -6018,7 +6013,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;