Skip to contentSkip to conversation

sparc64: Fix numa distance values

PATCH In review Nitin Gupta 2 participants 3 messages Oct 29, 2015 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: Fix numa distance values

Orabug: 21896119

Use machine descriptor (MD) to get node latency values instead of just using default values.

Testing:
On an T5-8 system with:
- total nodes = 8
- self latencies = 0x26d18
- latency to other nodes = 0x3a598
=> latency ratio = ~1.5

output of numactl --hardware

- before fix:

node distances:
node 0 1 2 3 4 5 6 7

  0:  10  20  20  20  20  20  20  20
  1:  20  10  20  20  20  20  20  20
  2:  20  20  10  20  20  20  20  20
  3:  20  20  20  10  20  20  20  20
  4:  20  20  20  20  10  20  20  20
  5:  20  20  20  20  20  10  20  20
  6:  20  20  20  20  20  20  10  20
  7:  20  20  20  20  20  20  20  10

- after fix:

node distances:
node 0 1 2 3 4 5 6 7

  0:  10  15  15  15  15  15  15  15
  1:  15  10  15  15  15  15  15  15
  2:  15  15  10  15  15  15  15  15
  3:  15  15  15  10  15  15  15  15
  4:  15  15  15  15  10  15  15  15
  5:  15  15  15  15  15  10  15  15
  6:  15  15  15  15  15  15  10  15
  7:  15  15  15  15  15  15  15  10
---
 arch/sparc/include/asm/topology_64.h |    3 +
 arch/sparc/mm/init_64.c              |   70 +++++++++++++++++++++++++++++++++-
 2 files changed, 72 insertions(+), 1 deletions(-)
arch/sparc/include/asm/topology_64.h +3 -0
index 01d1704..ed3dfdd 100644
@@ -31,6 +31,9 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
 	 cpu_all_mask : \
 	 cpumask_of_node(pcibus_to_node(bus)))
 
+extern int __node_distance(int, int);
+#define node_distance(a, b) __node_distance(a, b)
+
 #else /* CONFIG_NUMA */
 
 #include <asm-generic/topology.h>
arch/sparc/mm/init_64.c +68 -1

95 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

Small nit.

arch/sparc/include/asm/topology_64.h static inline int pcibus_to_node(struct pci_bus *pbus) · line 34

Quoted 9 lines
arch/sparc/include/asm/topology_64.h +1 -0
index 01d1704..ed3dfdd 100644
@@ -31,6 +31,9 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
 	 cpu_all_mask : \
 	 cpumask_of_node(pcibus_to_node(bus)))
 
+extern int __node_distance(int, int);

We have dropped using "extern" for function prototypes.

arch/sparc/include/asm/topology_64.h static inline int pcibus_to_node(struct pci_bus *pbus) · line 35

Quoted 1 line
arch/sparc/include/asm/topology_64.h +1 -0
+#define node_distance(a, b) __node_distance(a, b)

And had this be written as:
#define node_distance node_distance
int node_distance(int, int);

Then there had been no need for the leadign underscores.

But as I said - only nits.

Sam

#2 lore raw
Quoted 10 lines · Sam Ravnborg

Small nit.

Quoted 8 lines
arch/sparc/include/asm/topology_64.h +0 -0
index 01d1704..ed3dfdd 100644
@@ -31,6 +31,9 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
  	 cpu_all_mask : \
  	 cpumask_of_node(pcibus_to_node(bus)))
 
Quoted 3 lines

arch/sparc/include/asm/topology_64.h static inline int pcibus_to_node(struct pci_bus *pbus) · line 34

Quoted 1 line
arch/sparc/include/asm/topology_64.h +1 -0
+extern int __node_distance(int, int);

We have dropped using "extern" for function prototypes.

ok, dropped extern here.

Quoted 4 lines

arch/sparc/include/asm/topology_64.h static inline int pcibus_to_node(struct pci_bus *pbus) · line 35

Quoted 1 line
arch/sparc/include/asm/topology_64.h +1 -0
+#define node_distance(a, b) __node_distance(a, b)

And had this be written as:
#define node_distance node_distance

underscores here to separate macro name from function name seems to be clearer and would also avoid confusing cross-referencing tools.

Quoted 8 lines

int node_distance(int, int);

Then there had been no need for the leadign underscores.

But as I said - only nits.

Sam

Thanks for the review.
Nitin