From patchwork Tue Mar 18 17:56:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26504 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D518E202FA for ; Tue, 18 Mar 2014 17:58:53 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf19149750yha.3 for ; Tue, 18 Mar 2014 10:58:53 -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=HGJv4d36tggcchYdF4t3gOKR4mAXyWtRB7a4blzU6Uw=; b=WJOdKDH4kDlWRultGzCF3wN15YiGnTKbwPKYS/UZuXgHfzUIRXKYQtnC3X3wTqNPJM cdZCdYkB614t0smG1XEDhMjFRQ8gFGFYHn6Tb61HtqFPTDxeQn3O7W98GuLMByVCrNgH pA1KHk9vGJiMrz22AyiRsz62Z3VP2FQ6iBGVYywN2jsKfWtm0L1KLTZ87qhsQ4NQE5zj sZ4GUywMaiE9Xd4MGTKK/VF9D+IcBZAhcHow/5pNQ9XwfzxFLl1dKC9fLziY2p1yL0Rb XMuHJZjgYA3Bc2XCpxu2Wl1F2c7X7FP8+9sgbp55XTgvKXgI7jT2mmHXujKURt/3R5LG RmsQ== X-Gm-Message-State: ALoCoQmjK12AaVJAVRVmfDrUPFFlXHQNKrVcb7+CoX9kdXWwb5HSFdqrG6dFmCaWXunck755lkbO X-Received: by 10.58.127.66 with SMTP id ne2mr2567943veb.27.1395165533566; Tue, 18 Mar 2014 10:58:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.9 with SMTP id k9ls1294387qgk.20.gmail; Tue, 18 Mar 2014 10:58:53 -0700 (PDT) X-Received: by 10.58.238.35 with SMTP id vh3mr25557813vec.16.1395165533358; Tue, 18 Mar 2014 10:58:53 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id g4si6715121vch.148.2014.03.18.10.58.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:58:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so7642669vcb.2 for ; Tue, 18 Mar 2014 10:58:53 -0700 (PDT) X-Received: by 10.52.241.106 with SMTP id wh10mr22022402vdc.16.1395165533266; Tue, 18 Mar 2014 10:58:53 -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 i9csp232487vck; Tue, 18 Mar 2014 10:58:52 -0700 (PDT) X-Received: by 10.68.34.225 with SMTP id c1mr35166442pbj.116.1395165532206; Tue, 18 Mar 2014 10:58:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si11002780pbo.92.2014.03.18.10.58.50; Tue, 18 Mar 2014 10:58:50 -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 S1757449AbaCRR5t (ORCPT + 26 others); Tue, 18 Mar 2014 13:57:49 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:37691 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757381AbaCRR5p (ORCPT ); Tue, 18 Mar 2014 13:57:45 -0400 Received: by mail-we0-f174.google.com with SMTP id t60so6118832wes.19 for ; Tue, 18 Mar 2014 10:57:44 -0700 (PDT) X-Received: by 10.194.241.132 with SMTP id wi4mr24765179wjc.14.1395165464557; Tue, 18 Mar 2014 10:57:44 -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.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:57:43 -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 6/7] sched: ARM: create a dedicated scheduler topology table Date: Tue, 18 Mar 2014 18:56:48 +0100 Message-Id: <1395165409-18055-7-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.171 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); }