aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2014-04-11 05:44:40 -0400
committerIngo Molnar <mingo@kernel.org>2014-05-07 07:33:52 -0400
commitd77b3ed5c9f8ebedf154b52b5e943c461f3d37e6 (patch)
tree65de32de218284304e0e8f2c5456bf2c4a521809 /kernel/sched
parent607b45e9a216e89a63351556e488eea06be0ff48 (diff)
sched: Add a new SD_SHARE_POWERDOMAIN for sched_domain
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. Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: tony.luck@intel.com Cc: fenghua.yu@intel.com Cc: schwidefsky@de.ibm.com Cc: cmetcalf@tilera.com Cc: benh@kernel.crashing.org Cc: preeti@linux.vnet.ibm.com Link: http://lkml.kernel.org/r/1397209481-28542-5-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7e348e238bf1..1c9c3b7b26af 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5261,7 +5261,8 @@ static int sd_degenerate(struct sched_domain *sd)
5261 SD_BALANCE_FORK | 5261 SD_BALANCE_FORK |
5262 SD_BALANCE_EXEC | 5262 SD_BALANCE_EXEC |
5263 SD_SHARE_CPUPOWER | 5263 SD_SHARE_CPUPOWER |
5264 SD_SHARE_PKG_RESOURCES)) { 5264 SD_SHARE_PKG_RESOURCES |
5265 SD_SHARE_POWERDOMAIN)) {
5265 if (sd->groups != sd->groups->next) 5266 if (sd->groups != sd->groups->next)
5266 return 0; 5267 return 0;
5267 } 5268 }
@@ -5292,7 +5293,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
5292 SD_BALANCE_EXEC | 5293 SD_BALANCE_EXEC |
5293 SD_SHARE_CPUPOWER | 5294 SD_SHARE_CPUPOWER |
5294 SD_SHARE_PKG_RESOURCES | 5295 SD_SHARE_PKG_RESOURCES |
5295 SD_PREFER_SIBLING); 5296 SD_PREFER_SIBLING |
5297 SD_SHARE_POWERDOMAIN);
5296 if (nr_node_ids == 1) 5298 if (nr_node_ids == 1)
5297 pflags &= ~SD_SERIALIZE; 5299 pflags &= ~SD_SERIALIZE;
5298 } 5300 }
@@ -5901,6 +5903,7 @@ static int sched_domains_curr_level;
5901 * SD_SHARE_CPUPOWER - describes SMT topologies 5903 * SD_SHARE_CPUPOWER - describes SMT topologies
5902 * SD_SHARE_PKG_RESOURCES - describes shared caches 5904 * SD_SHARE_PKG_RESOURCES - describes shared caches
5903 * SD_NUMA - describes NUMA topologies 5905 * SD_NUMA - describes NUMA topologies
5906 * SD_SHARE_POWERDOMAIN - describes shared power domain
5904 * 5907 *
5905 * Odd one out: 5908 * Odd one out:
5906 * SD_ASYM_PACKING - describes SMT quirks 5909 * SD_ASYM_PACKING - describes SMT quirks
@@ -5909,7 +5912,8 @@ static int sched_domains_curr_level;
5909 (SD_SHARE_CPUPOWER | \ 5912 (SD_SHARE_CPUPOWER | \
5910 SD_SHARE_PKG_RESOURCES | \ 5913 SD_SHARE_PKG_RESOURCES | \
5911 SD_NUMA | \ 5914 SD_NUMA | \
5912 SD_ASYM_PACKING) 5915 SD_ASYM_PACKING | \
5916 SD_SHARE_POWERDOMAIN)
5913 5917
5914static struct sched_domain * 5918static struct sched_domain *
5915sd_init(struct sched_domain_topology_level *tl, int cpu) 5919sd_init(struct sched_domain_topology_level *tl, int cpu)