From patchwork Fri Apr 11 09:44:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 3967131 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 DB601BFF02 for ; Fri, 11 Apr 2014 09:49:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0FDB207ED for ; Fri, 11 Apr 2014 09:49:08 +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 0BED6207E8 for ; Fri, 11 Apr 2014 09:49:08 +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 1WYY3i-0005Lh-Fg; Fri, 11 Apr 2014 09:47:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY3Z-0000J7-AW; Fri, 11 Apr 2014 09:47:33 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY2f-0000E3-1P for linux-arm-kernel@merlin.infradead.org; Fri, 11 Apr 2014 09:46:51 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYY2c-0003bC-PN for linux-arm-kernel@lists.infradead.org; Fri, 11 Apr 2014 09:46:35 +0000 Received: by mail-we0-f177.google.com with SMTP id u57so4931761wes.8 for ; Fri, 11 Apr 2014 02:46:12 -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=tE6+sJe4xJvO56F7Azf5UkHLcinUvQLY/C4XC+sKdJA=; b=GtE4b+dXMKUTJ9iEGv/01itygpQpembdC+oi8eE2qCB3s29QngBd0x4+OK9m08Qy8J SeFyaU047GqPAhs+o5G6xR/yn+SMK97LjlxNle7ro4eUupbgaWNaCM6D8borAi/8SQds Yza8+0/EYKh9rbw2j4FIZ472HC5j/Af+gXnAJXHO8XF2Ibzkes6eaiFugE7MRXJ494/y LzWR2u9PaNW8EUqS4lqmXjX8kC8iokZIikCSQtfUSO8GuMjWJIMiBzAq+2VLmhuHwh/H wXSm3RfARPViWffIITtNwtjVYDoDyYGbYk59YQWDSAb7W7PNRRp0CfmPRIz7hNmipIIv 5Rdg== X-Gm-Message-State: ALoCoQlKk6Z4IVJXIt+bYExO8UyGl6q2C8duPiZexmoS5a3HhheyCfF1s5l4+DY/UDIVBDtLojnV X-Received: by 10.194.191.133 with SMTP id gy5mr20237236wjc.34.1397209572740; Fri, 11 Apr 2014 02:46:12 -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 ct2sm10526013wjb.33.2014.04.11.02.46.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 02:46:11 -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, cmetcalf@tilera.com, benh@kernel.crashing.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 4/5] sched: add a new SD_SHARE_POWERDOMAIN for sched_domain Date: Fri, 11 Apr 2014 11:44:40 +0200 Message-Id: <1397209481-28542-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1397209481-28542-1-git-send-email-vincent.guittot@linaro.org> References: <1397209481-28542-1-git-send-email-vincent.guittot@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140411_024634_965804_DCAFCD8B X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: -0.7 (/) 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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 7df3ca2..18464cb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -865,6 +865,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 3743a6c..a30b0b4 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5295,7 +5295,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; } @@ -5326,7 +5327,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; } @@ -5935,6 +5937,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 @@ -5943,7 +5946,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)