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: 26596 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EBB3B203C3 for ; Wed, 19 Mar 2014 16:24:51 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf48283772ykr.2 for ; Wed, 19 Mar 2014 09:24:51 -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=P9XaZ3hExYFI6LrBgDx7S2lfeEt22FFZrYDFYEpDI37ho2j5UiybKI+Mra/LObt2R4 mHVHoGx9yMmzjF3jcafkFfUJxrKzr2yq2My/PhrQEazz6MD6Sfj/i/39pNEco1m57yZA zFxzOTPNmmeOA6QXKsN7awgEU7KHN3hIZ8JkLKv+nM8AvA1DwNVu06CQgvT6jCsPI8oU 0ecUJRel8jfzbYDy+CE0Z7Xpk2WBic0wjpRJrnWsRStkkunRuKjmqqpfPAGk2ZMOwjkw UNQBGcXo3n3oULsfc9qSMK6VMjooffjAFDCzivw1UAFXWKHMEFYEjxy4u5z+sImk8Rve N9RA== X-Gm-Message-State: ALoCoQlKiXVh4mzSsuTiIrkM7nUL9YLpG3r7aEWQbEzLmD7hA5qgPNkCzYqWpDfTDwDhfYmRIKdH X-Received: by 10.236.125.6 with SMTP id y6mr7802372yhh.3.1395246291482; Wed, 19 Mar 2014 09:24:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.113 with SMTP id p104ls2718728qga.41.gmail; Wed, 19 Mar 2014 09:24:51 -0700 (PDT) X-Received: by 10.52.26.161 with SMTP id m1mr15126425vdg.24.1395246291366; Wed, 19 Mar 2014 09:24:51 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id sh5si3640337vdc.176.2014.03.19.09.24.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:24:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if17so9327463vcb.36 for ; Wed, 19 Mar 2014 09:24:51 -0700 (PDT) X-Received: by 10.220.69.133 with SMTP id z5mr52447vci.49.1395246291274; Wed, 19 Mar 2014 09:24:51 -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 i9csp314453vck; Wed, 19 Mar 2014 09:24:50 -0700 (PDT) X-Received: by 10.67.3.97 with SMTP id bv1mr41433437pad.54.1395246289865; Wed, 19 Mar 2014 09:24:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si22098082pbc.268.2014.03.19.09.24.47; Wed, 19 Mar 2014 09:24:47 -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 S934190AbaCSQYY (ORCPT + 26 others); Wed, 19 Mar 2014 12:24:24 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:42642 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934076AbaCSQYR (ORCPT ); Wed, 19 Mar 2014 12:24:17 -0400 Received: by mail-we0-f179.google.com with SMTP id x48so7175006wes.38 for ; Wed, 19 Mar 2014 09:24:16 -0700 (PDT) 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 Cc: dietmar.eggemann@arm.com, preeti@linux.vnet.ibm.com, linaro-kernel@lists.linaro.org, Vincent Guittot 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> 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.177 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); }