From patchwork Tue Mar 18 17:56:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26508 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D2018202FA for ; Tue, 18 Mar 2014 17:59:22 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kq14sf19001682pab.6 for ; Tue, 18 Mar 2014 10:59:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=590yEcmJiwA/rCT1f5vBa6VYXwwMA+xNCjMdy2GZdjk=; b=Y/sUPtbB1IPwr9/7VgjLHntD3l94bFzbHVDVZG8xXCo/Ca5PuMnkRAUzhAGmlmPFJY uJK7GkTtVIyM7ZB4riXw/qQAGHzCAWHv6L3wd/ItiV25+MlJxyunw9C2rlKVpZ8EgGDg 9m5WK3ZWR+iJVYuh0k2LlgofsHQh9Dx9tjCkReIg2ud0zpL+bRlkipetDd0xQh/YDITR LPw1ujirlx6YB5T7iSMEp6ZGjQ2DAGGdGOLe9QzgTWRE90nRgz3Uccy75wPFevG4Yklk eZFTCPkbO0RATp+WzOITU16SMW+or00s4r+V4O0SXdzv2mfb1TZ/1EuVeyXXW1bcmjk+ W8ew== X-Gm-Message-State: ALoCoQns61LNuqgTk8z7erh6Z1wnoA25pjJjuafebpAF/RKqhSsHiAcf/qy6YvmyNVmLcGmQKkzq X-Received: by 10.66.66.109 with SMTP id e13mr12308925pat.1.1395165562073; Tue, 18 Mar 2014 10:59:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.181 with SMTP id h50ls2102498qgh.15.gmail; Tue, 18 Mar 2014 10:59:21 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr26342597vcb.16.1395165561953; Tue, 18 Mar 2014 10:59:21 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id pd4si3759318veb.213.2014.03.18.10.59.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:59:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so7979620vcb.28 for ; Tue, 18 Mar 2014 10:59:21 -0700 (PDT) X-Received: by 10.220.99.72 with SMTP id t8mr26075980vcn.10.1395165560986; Tue, 18 Mar 2014 10:59:20 -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 i9csp232530vck; Tue, 18 Mar 2014 10:59:20 -0700 (PDT) X-Received: by 10.66.240.103 with SMTP id vz7mr34496510pac.37.1395165560012; Tue, 18 Mar 2014 10:59:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si11007648pbc.38.2014.03.18.10.59.19; Tue, 18 Mar 2014 10:59:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756170AbaCRR7I (ORCPT + 26 others); Tue, 18 Mar 2014 13:59:08 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:46903 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756902AbaCRR5l (ORCPT ); Tue, 18 Mar 2014 13:57:41 -0400 Received: by mail-wg0-f42.google.com with SMTP id y10so6151359wgg.13 for ; Tue, 18 Mar 2014 10:57:40 -0700 (PDT) X-Received: by 10.194.201.73 with SMTP id jy9mr3348406wjc.51.1395165460047; Tue, 18 Mar 2014 10:57:40 -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 pm2sm43784795wic.0.2014.03.18.10.57.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:57:38 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, 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 Cc: linaro-kernel@lists.linaro.org, Vincent Guittot Subject: [PATCH v2 4/7] sched: powerpc: create a dedicated topology table Date: Tue, 18 Mar 2014 18:56:46 +0100 Message-Id: <1395165409-18055-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org> References: <1395165409-18055-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.169 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;