aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2012-05-31 08:47:33 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-06 10:52:26 -0400
commitc1174876874dcf8986806e4dad3d7d07af20b439 (patch)
tree7e2ea14ba9421bddd63e1810716f1929c753e28b /include/linux/sched.h
parent7f1b43936f0ecad14770634c021cf4a929aec74d (diff)
sched: Fix domain iteration
Weird topologies can lead to asymmetric domain setups. This needs further consideration since these setups are typically non-minimal too. For now, make it work by adding an extra mask selecting which CPUs are allowed to iterate up. The topology that triggered it is the one from David Rientjes: 10 20 20 30 20 10 20 20 20 20 10 20 30 20 20 10 resulting in boxes that wouldn't even boot. Reported-by: David Rientjes <rientjes@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-3p86l9cuaqnxz7uxsojmz5rm@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6029d8c54476..ac321d753470 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -876,6 +876,8 @@ struct sched_group_power {
876 * Number of busy cpus in this group. 876 * Number of busy cpus in this group.
877 */ 877 */
878 atomic_t nr_busy_cpus; 878 atomic_t nr_busy_cpus;
879
880 unsigned long cpumask[0]; /* iteration mask */
879}; 881};
880 882
881struct sched_group { 883struct sched_group {
@@ -900,6 +902,15 @@ static inline struct cpumask *sched_group_cpus(struct sched_group *sg)
900 return to_cpumask(sg->cpumask); 902 return to_cpumask(sg->cpumask);
901} 903}
902 904
905/*
906 * cpumask masking which cpus in the group are allowed to iterate up the domain
907 * tree.
908 */
909static inline struct cpumask *sched_group_mask(struct sched_group *sg)
910{
911 return to_cpumask(sg->sgp->cpumask);
912}
913
903/** 914/**
904 * group_first_cpu - Returns the first cpu in the cpumask of a sched_group. 915 * group_first_cpu - Returns the first cpu in the cpumask of a sched_group.
905 * @group: The group whose first cpu is to be returned. 916 * @group: The group whose first cpu is to be returned.