From patchwork Wed Mar 19 16:22:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26598 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 15AE1203C3 for ; Wed, 19 Mar 2014 16:25:50 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf21466941pdb.0 for ; Wed, 19 Mar 2014 09:25:50 -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=mpDBmViWBBlt9jv92soQU5hRAG+OH7uuuP11PpVX200=; b=OyECvMN+KbANqKsx6PVIK8mTfJi4+bJmUYjdtl+Sa2wKipXtqPKiD7/6lpfc8rr6Es fvvQqH8f9Sx31dLVlgmsVf6JRaoNIRBmpmdnGG9KYbGUzKWGWpd8ivQ456+d0t+PWviu QI7dn74bVjE6fJ/ZVEoPFY08B1kD8jjX0gXbbVj/A2C9TYlK4raL8JqpVmfwrg8PQhjr O38efwqe+KaAPJ6TEYyWEtUXqbUmrZVwGoUNTML3fZCa5r4iN+PnpUyIHZNUVmIPz2pX DIJaXP1MQic7/vN0IompyenfleQ3YzO8Q43gFYZW3YPeQxffME7Q9f3r6hGr/m3uJYjr gsRg== X-Gm-Message-State: ALoCoQkB7OrPSZr5itCRaNtJCBx5Je3Wd5WhOkqLPrzXoUeEsUPTerYk457oGExbk1ODYHs6d2Ml X-Received: by 10.66.150.106 with SMTP id uh10mr14796403pab.13.1395246350289; Wed, 19 Mar 2014 09:25:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.12 with SMTP id t12ls2617289qge.1.gmail; Wed, 19 Mar 2014 09:25:50 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr26135851vdb.3.1395246350065; Wed, 19 Mar 2014 09:25:50 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id tm8si3652267vdc.26.2014.03.19.09.25.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:25:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.171; Received: by mail-ve0-f171.google.com with SMTP id cz12so9051831veb.2 for ; Wed, 19 Mar 2014 09:25:50 -0700 (PDT) X-Received: by 10.220.162.196 with SMTP id w4mr46187vcx.58.1395246349979; Wed, 19 Mar 2014 09:25:49 -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 i9csp314533vck; Wed, 19 Mar 2014 09:25:49 -0700 (PDT) X-Received: by 10.66.123.5 with SMTP id lw5mr40563110pab.83.1395246348208; Wed, 19 Mar 2014 09:25:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si22183657pbn.136.2014.03.19.09.25.47; Wed, 19 Mar 2014 09:25: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 S934247AbaCSQZ1 (ORCPT + 26 others); Wed, 19 Mar 2014 12:25:27 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37523 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934019AbaCSQYP (ORCPT ); Wed, 19 Mar 2014 12:24:15 -0400 Received: by mail-wi0-f176.google.com with SMTP id hr14so5239075wib.9 for ; Wed, 19 Mar 2014 09:24:14 -0700 (PDT) X-Received: by 10.180.89.136 with SMTP id bo8mr19983102wib.52.1395246253926; Wed, 19 Mar 2014 09:24:13 -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.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:24:12 -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 v3 4/6] sched: add a new SD_SHARE_POWERDOMAIN for sched_domain Date: Wed, 19 Mar 2014 17:22:43 +0100 Message-Id: <1395246165-31150-5-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.128.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: , A new flag SD_SHARE_POWERDOMAIN is created to reflect whether groups of CPUs in a sched_domain level can or not reach different power state. As an example, the flag should be cleared at CPU level if groups of cores can be power gated independently. This information can be used in the load balance decision or to add load balancing level between group of CPUs that can power gate independantly. This flag is part of the topology flags that can be set by arch. Signed-off-by: Vincent Guittot --- include/linux/sched.h | 1 + kernel/sched/core.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 6479de4..7048369 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -861,6 +861,7 @@ enum cpu_idle_type { #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ +#define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */ #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 0b51ee3..29b0c90 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5298,7 +5298,8 @@ static int sd_degenerate(struct sched_domain *sd) SD_BALANCE_FORK | SD_BALANCE_EXEC | SD_SHARE_CPUPOWER | - SD_SHARE_PKG_RESOURCES)) { + SD_SHARE_PKG_RESOURCES | + SD_SHARE_POWERDOMAIN)) { if (sd->groups != sd->groups->next) return 0; } @@ -5329,7 +5330,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) SD_BALANCE_EXEC | SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES | - SD_PREFER_SIBLING); + SD_PREFER_SIBLING | + SD_SHARE_POWERDOMAIN); if (nr_node_ids == 1) pflags &= ~SD_SERIALIZE; } @@ -5938,6 +5940,7 @@ static int sched_domains_curr_level; * SD_SHARE_CPUPOWER - describes SMT topologies * SD_SHARE_PKG_RESOURCES - describes shared caches * SD_NUMA - describes NUMA topologies + * SD_SHARE_POWERDOMAIN - describes shared power domain * * Odd one out: * SD_ASYM_PACKING - describes SMT quirks @@ -5946,7 +5949,8 @@ static int sched_domains_curr_level; (SD_SHARE_CPUPOWER | \ SD_SHARE_PKG_RESOURCES | \ SD_NUMA | \ - SD_ASYM_PACKING) + SD_ASYM_PACKING | \ + SD_SHARE_POWERDOMAIN) static struct sched_domain * sd_init(struct sched_domain_topology_level *tl, int cpu)