diff options
author | Anton Blanchard <anton@samba.org> | 2010-04-07 11:33:44 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-04-28 02:22:33 -0400 |
commit | 4b83c330b4d38e869111bda6e9077d4f61ed974a (patch) | |
tree | c85d12aaea6be5dd26caa1b99ffa6adcaa50bc05 /arch/powerpc/mm | |
parent | dbc9632a8c25c6efcc1ca3f3a2177c855b6e053e (diff) |
powerpc/numa: Add form 1 NUMA affinity
Firmware changed the way it represents memory and cpu affinity on POWER7.
Unfortunately the old method now caps the topology to work around issues
with legacy operating systems. For Linux to get the correct topology we
need to use the new form 1 affinity information.
We set the form 1 field in the client architecture, and if we see "1" in the
ibm,associativity-form property firmware supports form 1 affinity and
we should look at the first field in the ibm,associativity-reference-points
array. If not we use the second field as we always have.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/numa.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 64c00227b997..eaa7633515b7 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -242,10 +242,11 @@ EXPORT_SYMBOL_GPL(of_node_to_nid); | |||
242 | */ | 242 | */ |
243 | static int __init find_min_common_depth(void) | 243 | static int __init find_min_common_depth(void) |
244 | { | 244 | { |
245 | int depth; | 245 | int depth, index; |
246 | const unsigned int *ref_points; | 246 | const unsigned int *ref_points; |
247 | struct device_node *rtas_root; | 247 | struct device_node *rtas_root; |
248 | unsigned int len; | 248 | unsigned int len; |
249 | struct device_node *options; | ||
249 | 250 | ||
250 | rtas_root = of_find_node_by_path("/rtas"); | 251 | rtas_root = of_find_node_by_path("/rtas"); |
251 | 252 | ||
@@ -258,11 +259,23 @@ static int __init find_min_common_depth(void) | |||
258 | * configuration (should be all 0's) and the second is for a normal | 259 | * configuration (should be all 0's) and the second is for a normal |
259 | * NUMA configuration. | 260 | * NUMA configuration. |
260 | */ | 261 | */ |
262 | index = 1; | ||
261 | ref_points = of_get_property(rtas_root, | 263 | ref_points = of_get_property(rtas_root, |
262 | "ibm,associativity-reference-points", &len); | 264 | "ibm,associativity-reference-points", &len); |
263 | 265 | ||
266 | /* | ||
267 | * For type 1 affinity information we want the first field | ||
268 | */ | ||
269 | options = of_find_node_by_path("/options"); | ||
270 | if (options) { | ||
271 | const char *str; | ||
272 | str = of_get_property(options, "ibm,associativity-form", NULL); | ||
273 | if (str && !strcmp(str, "1")) | ||
274 | index = 0; | ||
275 | } | ||
276 | |||
264 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { | 277 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { |
265 | depth = ref_points[1]; | 278 | depth = ref_points[index]; |
266 | } else { | 279 | } else { |
267 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); | 280 | dbg("NUMA: ibm,associativity-reference-points not found.\n"); |
268 | depth = -1; | 281 | depth = -1; |