Skip to contentSkip to conversation

s390/numa: set node distance to LOCAL_DISTANCE

PATCH In review Alexander Gordeev 2 participants 2 messages Aug 4, 2020 – Aug 5, 2020 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Alexander Gordeev

author maintainer
#1 lore raw

PATCH v2 1/3 s390/numa: set node distance to LOCAL_DISTANCE

The node distance is hardcoded to 0, which causes a trouble for some user-level applications. In particular, "libnuma" expects the distance of a node to itself as LOCAL_DISTANCE. This update removes the offending node distance override.

Cc <[email protected]> # v5.6+
Cc Heiko Carstens <[email protected]>
Fixes 701dc81e7412 ("s390/mm: remove fake numa support")
---
 arch/s390/include/asm/topology.h | 6 ------
 1 file changed, 6 deletions(-)
arch/s390/include/asm/topology.h +0 -6
index fbb5075..3a0ac0c 100644
@@ -86,12 +86,6 @@ static inline const struct cpumask *cpumask_of_node(int node)
 
 #define pcibus_to_node(bus) __pcibus_to_node(bus)
 
-#define node_distance(a, b) __node_distance(a, b)
-static inline int __node_distance(int a, int b)
-{
-	return 0;
-}
-
 #else /* !CONFIG_NUMA */
 
 #define numa_node_id numa_node_id
Signature · 1 line
1.8.3.1
maintainer
#2 lore raw
Quoted 5 lines · Alexander Gordeev

The node distance is hardcoded to 0, which causes a trouble for some user-level applications. In particular, "libnuma" expects the distance of a node to itself as LOCAL_DISTANCE. This update removes the offending node distance override.

Quoted 7 lines
Cc <[email protected]> # v5.6+
Cc Heiko Carstens <[email protected]>
Fixes 701dc81e7412 ("s390/mm: remove fake numa support")
---
 arch/s390/include/asm/topology.h | 6 ------
 1 file changed, 6 deletions(-)

It would have been nice if the Fixes tag would be correct, since then there would be hardly any backport necessary. But unfortunately this is broken since we support numa.

Older code had this:

int __node_distance(int a, int b)

{
	return mode->distance ? mode->distance(a, b) : 0;
}

EXPORT_SYMBOL(__node_distance);

And the distance function was only set for the emulation mode, but not the default ("plain") mode.

I'll change that in the commit message.