From patchwork Fri Apr 11 09:44:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 28252 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 1D05C20822 for ; Fri, 11 Apr 2014 09:47:19 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id gq1sf23652277obb.7 for ; Fri, 11 Apr 2014 02:47:19 -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=UQWhqNmTNPXPyVn45EyvvLnPedfBmr7yr4zuXWe/59g=; b=Taloov2GgnlGRp6hd8OUKfq8fv3PTO2+iqXTXgEr4n4SucOXUYRXZYS9AZjjYDsaf4 05C8CqM8THylaGr1sBnBNLK3nswBEh9CcExLucoqC2Bt/zqvGQYLHWB7TaiFpzvn5AYm 3ZRPWQFl7N32MFkYqJV5w7BF9UpfPTC9074Gz1IsKrJB6TStE6PEd3q7BETt8AoxXTm6 61LVN8fysX5/mCxTa9zo+RF/bADqvGlMYSwqpePeonApV5sA0JbonHOx6vbNm3aimW8z oJSMnsu9PL77HQWbjATYA32kQGhc3j+ZCTDpPsUboSKuZt28AJyJ8g36s4GfvJErXUH6 iDyQ== X-Gm-Message-State: ALoCoQnELO10SalmqM/+MSdd5faa+BEDtXcJn1vcrLOjAHR1SCUSb5huJzNsfCahDVn4AGhwUsWz X-Received: by 10.182.216.200 with SMTP id os8mr11236087obc.0.1397209639645; Fri, 11 Apr 2014 02:47:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.144 with SMTP id 16ls922618qgt.62.gmail; Fri, 11 Apr 2014 02:47:19 -0700 (PDT) X-Received: by 10.52.3.129 with SMTP id c1mr19231vdc.37.1397209639515; Fri, 11 Apr 2014 02:47:19 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id x18si1199170vcf.207.2014.04.11.02.47.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:47:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so4568922veb.33 for ; Fri, 11 Apr 2014 02:47:19 -0700 (PDT) X-Received: by 10.221.74.200 with SMTP id yx8mr18952440vcb.3.1397209639417; Fri, 11 Apr 2014 02:47:19 -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 ib8csp43001vcb; Fri, 11 Apr 2014 02:47:19 -0700 (PDT) X-Received: by 10.68.203.135 with SMTP id kq7mr25954043pbc.85.1397209638655; Fri, 11 Apr 2014 02:47:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gr5si1489380pac.278.2014.04.11.02.47.17; Fri, 11 Apr 2014 02:47:17 -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 S1756380AbaDKJq6 (ORCPT + 26 others); Fri, 11 Apr 2014 05:46:58 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:39835 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755732AbaDKJqQ (ORCPT ); Fri, 11 Apr 2014 05:46:16 -0400 Received: by mail-wg0-f51.google.com with SMTP id k14so5184918wgh.10 for ; Fri, 11 Apr 2014 02:46:14 -0700 (PDT) X-Received: by 10.180.211.239 with SMTP id nf15mr2562893wic.9.1397209574642; Fri, 11 Apr 2014 02:46:14 -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.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:46:13 -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 Cc: dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org, Vincent Guittot Subject: [PATCH v4 5/5] sched: ARM: create a dedicated scheduler topology table Date: Fri, 11 Apr 2014 11:44:41 +0200 Message-Id: <1397209481-28542-6-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> 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.128.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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Create a dedicated topology table for ARM which will create new level to differentiate CPUs that can or not powergate independantly from others. The patch gives an example of how to add domain that will take advantage of SD_SHARE_POWERDOMAIN. Signed-off-by: Vincent Guittot --- arch/arm/kernel/topology.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index 0bc94b1..71e1fec 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -185,6 +185,15 @@ const struct cpumask *cpu_coregroup_mask(int cpu) return &cpu_topology[cpu].core_sibling; } +/* + * The current assumption is that we can power gate each core independently. + * This will be superseded by DT binding once available. + */ +const struct cpumask *cpu_corepower_mask(int cpu) +{ + return &cpu_topology[cpu].thread_sibling; +} + static void update_siblings_masks(unsigned int cpuid) { struct cputopo_arm *cpu_topo, *cpuid_topo = &cpu_topology[cpuid]; @@ -266,6 +275,20 @@ void store_cpu_topology(unsigned int cpuid) cpu_topology[cpuid].socket_id, mpidr); } +static inline const int cpu_corepower_flags(void) +{ + return SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN; +} + +static struct sched_domain_topology_level arm_topology[] = { +#ifdef CONFIG_SCHED_MC + { cpu_corepower_mask, cpu_corepower_flags, SD_INIT_NAME(GMC) }, + { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, +#endif + { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { NULL, }, +}; + /* * init_cpu_topology is called at boot when only one cpu is running * which prevent simultaneous write access to cpu_topology array @@ -289,4 +312,7 @@ void __init init_cpu_topology(void) smp_wmb(); parse_dt_topology(); + + /* Set scheduler topology descriptor */ + set_sched_topology(arm_topology); }