From patchwork Wed Mar 5 07:18:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 25736 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A70D720540 for ; Wed, 5 Mar 2014 07:19:27 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf2304243oag.6 for ; Tue, 04 Mar 2014 23:19:27 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=b0So010PTP+9DHLbNRRjz8ljeAA5oHWArsMBQ0Gpr40=; b=hCmWel/1NqRDvVCoGRJxDArAeuXf1AdMOrLpO2aJSFac6e1tPFpvjV7hXpeab3Uw7F tWbwTOa5TkpIO1D25HbCv4BAghIRP9kUmiHri/Fm8S/3E0K/uyDVaV9YN3M5nQm8+CzN j2jI85/UiSAY9aYmqpM7CDK1NIHl7p3w0oCsxt+dScrxYo9pEkbUHAf4ypEOrwmLtBu9 7PTmqSWZXe0vOLr+ZyuaXa4CtrycPvbCne0qa4VFQ2pntlp16haIYynFBNLxKkGRy0+d i4SZpNNQfqdFE2swlbrEQrAAeTykeJ+JIGJejvggtovqQ2/xe9Ak/yoBW8hPQy5g2DCc ABlw== X-Gm-Message-State: ALoCoQkuKQHvODUIdL9+mid1d9d9tBHxD8PBGaZ0UOsXrADbLEyAGhtS8jKTDIFPLahI02MQooZ5 X-Received: by 10.182.60.195 with SMTP id j3mr615496obr.17.1394003967213; Tue, 04 Mar 2014 23:19:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.72 with SMTP id e66ls166704qge.67.gmail; Tue, 04 Mar 2014 23:19:27 -0800 (PST) X-Received: by 10.58.178.238 with SMTP id db14mr3227013vec.25.1394003967032; Tue, 04 Mar 2014 23:19:27 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id wt4si460619vcb.40.2014.03.04.23.19.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 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.178; Received: by mail-ve0-f178.google.com with SMTP id jw12so633385veb.37 for ; Tue, 04 Mar 2014 23:19:27 -0800 (PST) X-Received: by 10.58.91.101 with SMTP id cd5mr3233169veb.5.1394003966957; Tue, 04 Mar 2014 23:19:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.130.193 with SMTP id u1csp183759vcs; Tue, 4 Mar 2014 23:19:26 -0800 (PST) X-Received: by 10.69.2.2 with SMTP id bk2mr4836912pbd.75.1394003966052; Tue, 04 Mar 2014 23:19:26 -0800 (PST) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id xz2si1395649pbb.359.2014.03.04.23.19.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id v10so693967pde.1 for ; Tue, 04 Mar 2014 23:19:25 -0800 (PST) X-Received: by 10.66.20.10 with SMTP id j10mr4976366pae.11.1394003965592; Tue, 04 Mar 2014 23:19:25 -0800 (PST) Received: from lmenb30s.lme.st.com (z88l218.static.ctm.net. [202.175.88.218]) by mx.google.com with ESMTPSA id zc6sm9364621pab.18.2014.03.04.23.19.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 23:19:24 -0800 (PST) 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 Cc: dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org, Vincent Guittot Subject: [RFC 6/6] sched: ARM: create a dedicated scheduler topology table Date: Wed, 5 Mar 2014 15:18:26 +0800 Message-Id: <1394003906-11630-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394003906-11630-1-git-send-email-vincent.guittot@linaro.org> References: <1394003906-11630-1-git-send-email-vincent.guittot@linaro.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.178 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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..ae8ffbc 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 struct sched_domain_topology_level arm_topology[] = { +#ifdef CONFIG_SCHED_MC + { cpu_corepower_mask, SD_SHARE_PKG_RESOURCES | SD_SHARE_POWERDOMAIN, SD_INIT_NAME(GMC) }, + { cpu_coregroup_mask, SD_SHARE_PKG_RESOURCES, SD_INIT_NAME(MC) }, +#endif + { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { NULL, }, +}; + +static void __init set_sched_topology(void) +{ + sched_domain_topology = arm_topology; +} + /* * 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(); }