From patchwork Tue Mar 18 17:56:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 26505 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1FF9A202FA for ; Tue, 18 Mar 2014 17:58:57 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf18053809veb.1 for ; Tue, 18 Mar 2014 10:58:56 -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=zdYoACXtQ5PgjOvZ23h4LerPeaHmxPdkKQ/7Dox0RsA=; b=MFqwvgSuccxi0RoxeqHE/L1AMYVQZx3FhoKEsmMoA16DuaSuk7S5IjQSqSQjlZIpz4 339XBfi1OY5Dc3MbAetpRj7SF+YNshSXM44HG6poLahE/apTJUz0YQOip0IQn8YFVHtE hYfVvqpVPOHulSz9xtaSimwnwk8df0FyPCWFJbVzffTdKFzDUmx5iiUGRcah7m/yz5q2 YB9p5+EYeeFMErN5xi75cCMOOj7k9Fdatdktoq9DcnXpq9i3Nswuyt/TEGXym2mtP0++ tvJxnQJjD0CdgT3yET+n3Kn3TWwB3VnJPCU8AUx5YlvjI1UCUjANQLTc+kpZbvTTd1nw Avog== X-Gm-Message-State: ALoCoQl+LajqVIf4rW8Hc/msSSlsi+F8cCta2ZJaP6S+a8/sIrrHWe2uG3JjrBJ7jy+o432LMEvF X-Received: by 10.236.94.48 with SMTP id m36mr5370539yhf.47.1395165536885; Tue, 18 Mar 2014 10:58:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.165 with SMTP id e34ls2187469qgf.29.gmail; Tue, 18 Mar 2014 10:58:56 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr26013999vco.18.1395165536791; Tue, 18 Mar 2014 10:58:56 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id ja11si5080940vec.28.2014.03.18.10.58.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:58:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jx11so7571682veb.3 for ; Tue, 18 Mar 2014 10:58:56 -0700 (PDT) X-Received: by 10.52.104.33 with SMTP id gb1mr2010404vdb.45.1395165536706; Tue, 18 Mar 2014 10:58:56 -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 i9csp232490vck; Tue, 18 Mar 2014 10:58:56 -0700 (PDT) X-Received: by 10.68.237.133 with SMTP id vc5mr34134954pbc.92.1395165535732; Tue, 18 Mar 2014 10:58:55 -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.52; Tue, 18 Mar 2014 10:58:52 -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 S932351AbaCRR6M (ORCPT + 26 others); Tue, 18 Mar 2014 13:58:12 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:60608 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757383AbaCRR5n (ORCPT ); Tue, 18 Mar 2014 13:57:43 -0400 Received: by mail-wi0-f171.google.com with SMTP id hn9so4050397wib.16 for ; Tue, 18 Mar 2014 10:57:42 -0700 (PDT) X-Received: by 10.194.82.35 with SMTP id f3mr24754791wjy.36.1395165462289; Tue, 18 Mar 2014 10:57:42 -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.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 10:57:41 -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 5/7] sched: add a new SD_SHARE_POWERDOMAIN for sched_domain Date: Tue, 18 Mar 2014 18:56:47 +0100 Message-Id: <1395165409-18055-6-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.128.172 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 to add load balancing level between group of CPUs than can power gate independantly. The default behavior of the scheduler is to spread tasks across CPUs and groups of CPUs so the flag is set into all sched_domains. 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 | 9 ++++++--- 2 files changed, 7 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..224ec3b 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; } @@ -5946,7 +5948,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)