From patchwork Sun Oct 7 07:43:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12035 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1122C23EFF for ; Sun, 7 Oct 2012 07:44:40 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id BABA6A19440 for ; Sun, 7 Oct 2012 07:44:39 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6872053iej.11 for ; Sun, 07 Oct 2012 00:44:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=paBKJAaloTzTnq/urcxJkx3KzFTT7pmg4wn7wgfeLHI=; b=JNk9SyFiWeIeKZSWqYogyom/BOqRpu5813YFXkxPjNhv3WmuLFvBfVyZ6n4iLPVLyT rXTXV2tL+ph3oDK3T30nJ2eiqE1b+9PzSflDnuuv/H+oZr/JiCt9+YnJNQoA0uBy3KiU mrxaEeJXwlJWbrytlfYc7PHun6xpmpOf2BVAv051ZW5TZbJG1h1IFCNxl8wPd7LCuHHn o601YNkzRGnwD73CNIBofUm0AgAom/yttVXo8T4w0Q8dfaw9J5/34tpRSkb8DSS9Dhkd Y0GU8E+9+jpGMz36Rj8VxJWCNZI+ObnVN2/umq58J1vwak/dg8B5uGUFW6rJ2IQwfayc rVAQ== Received: by 10.42.110.130 with SMTP id q2mr10359554icp.53.1349595879513; Sun, 07 Oct 2012 00:44:39 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp39947igc; Sun, 7 Oct 2012 00:44:38 -0700 (PDT) Received: by 10.180.108.45 with SMTP id hh13mr13135771wib.15.1349595878091; Sun, 07 Oct 2012 00:44:38 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id c28si4489996wej.7.2012.10.07.00.44.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Oct 2012 00:44:38 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by mail-wg0-f50.google.com with SMTP id 16so2511086wgi.31 for ; Sun, 07 Oct 2012 00:44:37 -0700 (PDT) Received: by 10.216.141.14 with SMTP id f14mr7996803wej.208.1349595877470; Sun, 07 Oct 2012 00:44:37 -0700 (PDT) Received: from lmenx30s.lme.st.com (pas72-1-88-161-60-229.fbx.proxad.net. [88.161.60.229]) by mx.google.com with ESMTPS id j8sm12495245wiy.9.2012.10.07.00.44.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Oct 2012 00:44:36 -0700 (PDT) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, peterz@infradead.org, mingo@redhat.com, pjt@google.com, linux@arm.linux.org.uk Cc: Vincent Guittot Subject: [RFC 2/6] sched: add a new SD SHARE_POWERLINE flag for sched_domain Date: Sun, 7 Oct 2012 09:43:54 +0200 Message-Id: <1349595838-31274-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349595838-31274-1-git-send-email-vincent.guittot@linaro.org> References: <1349595838-31274-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQl+27wcTI9GltuBQsLX1TOJh9wCuGBh8SXNToFEdKxl6L2Ia4XCENyu5fyc/BnIDq03hBnF This new flag SD SHARE_POWERLINE reflects the sharing of the power rail between the members of a domain. As this is the current assumption of the scheduler, the flag is added to all sched_domain Signed-off-by: Vincent Guittot --- arch/ia64/include/asm/topology.h | 1 + arch/tile/include/asm/topology.h | 1 + include/linux/sched.h | 1 + include/linux/topology.h | 3 +++ kernel/sched/core.c | 5 +++++ 5 files changed, 11 insertions(+) diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index a2496e4..065c720 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -65,6 +65,7 @@ void build_cpu_to_node_map(void); | SD_BALANCE_EXEC \ | SD_BALANCE_FORK \ | SD_WAKE_AFFINE, \ + | arch_sd_share_power_line() \ .last_balance = jiffies, \ .balance_interval = 1, \ .nr_balance_failed = 0, \ diff --git a/arch/tile/include/asm/topology.h b/arch/tile/include/asm/topology.h index 7a7ce39..d39ed0b 100644 --- a/arch/tile/include/asm/topology.h +++ b/arch/tile/include/asm/topology.h @@ -72,6 +72,7 @@ static inline const struct cpumask *cpumask_of_node(int node) | 0*SD_PREFER_LOCAL \ | 0*SD_SHARE_CPUPOWER \ | 0*SD_SHARE_PKG_RESOURCES \ + | arch_sd_share_power_line() \ | 0*SD_SERIALIZE \ , \ .last_balance = jiffies, \ diff --git a/include/linux/sched.h b/include/linux/sched.h index 4786b20..74f2daf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -862,6 +862,7 @@ enum cpu_idle_type { #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ #define SD_PREFER_LOCAL 0x0040 /* Prefer to keep tasks local to this domain */ #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ +#define SD_SHARE_POWERLINE 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/include/linux/topology.h b/include/linux/topology.h index fec12d6..20964ab 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -99,6 +99,7 @@ int arch_update_cpu_topology(void); | 1*SD_WAKE_AFFINE \ | 1*SD_SHARE_CPUPOWER \ | 1*SD_SHARE_PKG_RESOURCES \ + | arch_sd_share_power_line() \ | 0*SD_SERIALIZE \ | 0*SD_PREFER_SIBLING \ | arch_sd_sibling_asym_packing() \ @@ -132,6 +133,7 @@ int arch_update_cpu_topology(void); | 0*SD_PREFER_LOCAL \ | 0*SD_SHARE_CPUPOWER \ | 1*SD_SHARE_PKG_RESOURCES \ + | arch_sd_share_power_line() \ | 0*SD_SERIALIZE \ , \ .last_balance = jiffies, \ @@ -163,6 +165,7 @@ int arch_update_cpu_topology(void); | 0*SD_PREFER_LOCAL \ | 0*SD_SHARE_CPUPOWER \ | 0*SD_SHARE_PKG_RESOURCES \ + | arch_sd_share_power_line() \ | 0*SD_SERIALIZE \ | 1*SD_PREFER_SIBLING \ , \ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d50fbac..dab7908 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6407,6 +6407,11 @@ int __weak arch_sd_sibling_asym_packing(void) return 0*SD_ASYM_PACKING; } +int __weak arch_sd_share_power_line(void) +{ + return 1*SD_SHARE_POWERLINE; +} + /* * Initializers for schedule domains * Non-inlined to reduce accumulated stack pressure in build_sched_domains()