diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2012-04-17 09:49:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-05-09 09:00:55 -0400 |
commit | cb83b629bae0327cf9f44f096adc38d150ceb913 (patch) | |
tree | 13f7da07ee150a97c21aace57eaa817a30df9539 /include/linux/topology.h | |
parent | bd939f45da24e25e08a8f5c993c50b1afada0fef (diff) |
sched/numa: Rewrite the CONFIG_NUMA sched domain support
The current code groups up to 16 nodes in a level and then puts an
ALLNODES domain spanning the entire tree on top of that. This doesn't
reflect the numa topology and esp for the smaller not-fully-connected
machines out there today this might make a difference.
Therefore, build a proper numa topology based on node_distance().
Since there's no fixed numa layers anymore, the static SD_NODE_INIT
and SD_ALLNODES_INIT aren't usable anymore, the new code tries to
construct something similar and scales some values either on the
number of cpus in the domain and/or the node_distance() ratio.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Anton Blanchard <anton@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: linux-alpha@vger.kernel.org
Cc: linux-ia64@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-sh@vger.kernel.org
Cc: Matt Turner <mattst88@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: sparclinux@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86@kernel.org
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Greg Pearson <greg.pearson@hp.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: bob.picco@oracle.com
Cc: chris.mason@oracle.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-r74n3n8hhuc2ynbrnp3vt954@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/topology.h')
-rw-r--r-- | include/linux/topology.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/include/linux/topology.h b/include/linux/topology.h index e26db031303b..4f59bf36f0af 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -70,7 +70,6 @@ int arch_update_cpu_topology(void); | |||
70 | * Below are the 3 major initializers used in building sched_domains: | 70 | * Below are the 3 major initializers used in building sched_domains: |
71 | * SD_SIBLING_INIT, for SMT domains | 71 | * SD_SIBLING_INIT, for SMT domains |
72 | * SD_CPU_INIT, for SMP domains | 72 | * SD_CPU_INIT, for SMP domains |
73 | * SD_NODE_INIT, for NUMA domains | ||
74 | * | 73 | * |
75 | * Any architecture that cares to do any tuning to these values should do so | 74 | * Any architecture that cares to do any tuning to these values should do so |
76 | * by defining their own arch-specific initializer in include/asm/topology.h. | 75 | * by defining their own arch-specific initializer in include/asm/topology.h. |
@@ -176,48 +175,12 @@ int arch_update_cpu_topology(void); | |||
176 | } | 175 | } |
177 | #endif | 176 | #endif |
178 | 177 | ||
179 | /* sched_domains SD_ALLNODES_INIT for NUMA machines */ | ||
180 | #define SD_ALLNODES_INIT (struct sched_domain) { \ | ||
181 | .min_interval = 64, \ | ||
182 | .max_interval = 64*num_online_cpus(), \ | ||
183 | .busy_factor = 128, \ | ||
184 | .imbalance_pct = 133, \ | ||
185 | .cache_nice_tries = 1, \ | ||
186 | .busy_idx = 3, \ | ||
187 | .idle_idx = 3, \ | ||
188 | .flags = 1*SD_LOAD_BALANCE \ | ||
189 | | 1*SD_BALANCE_NEWIDLE \ | ||
190 | | 0*SD_BALANCE_EXEC \ | ||
191 | | 0*SD_BALANCE_FORK \ | ||
192 | | 0*SD_BALANCE_WAKE \ | ||
193 | | 0*SD_WAKE_AFFINE \ | ||
194 | | 0*SD_SHARE_CPUPOWER \ | ||
195 | | 0*SD_POWERSAVINGS_BALANCE \ | ||
196 | | 0*SD_SHARE_PKG_RESOURCES \ | ||
197 | | 1*SD_SERIALIZE \ | ||
198 | | 0*SD_PREFER_SIBLING \ | ||
199 | , \ | ||
200 | .last_balance = jiffies, \ | ||
201 | .balance_interval = 64, \ | ||
202 | } | ||
203 | |||
204 | #ifndef SD_NODES_PER_DOMAIN | ||
205 | #define SD_NODES_PER_DOMAIN 16 | ||
206 | #endif | ||
207 | |||
208 | #ifdef CONFIG_SCHED_BOOK | 178 | #ifdef CONFIG_SCHED_BOOK |
209 | #ifndef SD_BOOK_INIT | 179 | #ifndef SD_BOOK_INIT |
210 | #error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!! | 180 | #error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!! |
211 | #endif | 181 | #endif |
212 | #endif /* CONFIG_SCHED_BOOK */ | 182 | #endif /* CONFIG_SCHED_BOOK */ |
213 | 183 | ||
214 | #ifdef CONFIG_NUMA | ||
215 | #ifndef SD_NODE_INIT | ||
216 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | ||
217 | #endif | ||
218 | |||
219 | #endif /* CONFIG_NUMA */ | ||
220 | |||
221 | #ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID | 184 | #ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID |
222 | DECLARE_PER_CPU(int, numa_node); | 185 | DECLARE_PER_CPU(int, numa_node); |
223 | 186 | ||