Skip to content

Commit 7122bee

Browse files
svaidympe
authored andcommitted
powerpc: fix numa distance for form0 device tree
The following commit breaks numa distance setup for old powerpc systems that use form0 encoding in device tree. commit 41eab6f powerpc/numa: Use form 1 affinity to setup node distance Device tree node /rtas/ibm,associativity-reference-points would index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or form1 encoding detected by ibm,architecture-vec-5 property. All modern systems use form1 and current kernel code is correct. However, on older systems with form0 encoding, the numa distance will get hard coded as LOCAL_DISTANCE for all nodes. This causes task scheduling anomaly since scheduler will skip building numa level domain (topmost domain with all cpus) if all numa distances are same. (value of 'level' in sched_init_numa() will remain 0) Prior to the above commit: ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE) Restoring compatible behavior with this patch for old powerpc systems with device tree where numa distance are encoded as form0. Signed-off-by: Vaidyanathan Srinivasan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 517b731 commit 7122bee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ int __node_distance(int a, int b)
201201
int distance = LOCAL_DISTANCE;
202202

203203
if (!form1_affinity)
204-
return distance;
204+
return ((a == b) ? LOCAL_DISTANCE : REMOTE_DISTANCE);
205205

206206
for (i = 0; i < distance_ref_points_depth; i++) {
207207
if (distance_lookup_table[a][i] == distance_lookup_table[b][i])

0 commit comments

Comments
 (0)