From patchwork Wed Mar 19 16:22:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 3851141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8A8E7BF540 for ; Wed, 19 Mar 2014 16:26:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9FD420394 for ; Wed, 19 Mar 2014 16:26:49 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DFD620131 for ; Wed, 19 Mar 2014 16:26:48 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQJJ9-0006nu-GM; Wed, 19 Mar 2014 16:25:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQJIo-0000OG-U8; Wed, 19 Mar 2014 16:25:15 +0000 Received: from mail-we0-f180.google.com ([74.125.82.180]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQJIB-0000FC-RM for linux-arm-kernel@lists.infradead.org; Wed, 19 Mar 2014 16:24:44 +0000 Received: by mail-we0-f180.google.com with SMTP id p61so7171091wes.39 for ; Wed, 19 Mar 2014 09:24: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:from:to:cc:subject:date:message-id:in-reply-to :references; bh=szIMOPInrH+Ex4aqeZl2YrJ95Mv+XDNZqoyPvoNeAKY=; b=gzh8D0R0stRAFj4bVeRLiPbp2HH1o2AJjB3m+vfMnF9MckuYJKQd9vegmgLFPTbmXv /1mwbfWAQIVII1SrHArmFIrVVNTZeY/s5B0DVk79Z6ryKgn0awCEyQeKeQ/uccwJc3bL EgIkurnbsK7rbvFnadfR2UbId+ihcnjJr1zHxcPENPxH4QMXZfpH/kuNpCSLhRdxH801 twknaAegaf61tiuqFaTc3idFE/pSmLKJRxtGSDm2x23An00+BE/tHOpfoC+r7NQt2rk2 znePkAi/dV+J9nf5iWaG9yH3PRXeHsk3JJI3T0E0yI3Q0pKwjSZ3KaS1ha1x5j+5e5PJ L4nw== X-Gm-Message-State: ALoCoQm5DlarhQ5s5v+PgQ+fal8X6l59VuelF8embR9WJOE+vtemv7G/dn9KG+3oeDZQ2R/Py65E X-Received: by 10.180.11.36 with SMTP id n4mr20158498wib.4.1395246256043; Wed, 19 Mar 2014 09:24:16 -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.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:24:15 -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 5/6] sched: ARM: create a dedicated scheduler topology table Date: Wed, 19 Mar 2014 17:22:44 +0100 Message-Id: <1395246165-31150-6-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_122436_354207_06D74BC8 X-CRM114-Status: GOOD ( 12.53 ) X-Spam-Score: -2.6 (--) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }