Skip to contentSkip to conversation

arch/x86/mm/numa.c: quiet sparse noise when CONFIG_X86_64 is not set

PATCH In review H Hartley Sweeten 3 participants 4 messages Sep 9, 2011 – Sep 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/mm/numa.c: quiet sparse noise when CONFIG_X86_64 is not set

If CONFIG_X86_64 is not set the function __node_distance is not declared in <asm/topology.h>. This results in the following sparse noise.

warning: symbol '__node_distance' was not declared. Should it be static?

Fix this by putting an #ifdef around the function.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Yinghai Lu <[email protected]>
Cc David Rientjes <[email protected]>

---

arch/x86/mm/numa.c +2 -0
index fbeaaf4..11c60a7 100644
@@ -455,6 +455,7 @@ void __init numa_set_distance(int from, int to, int distance)
 	numa_distance[from * numa_distance_cnt + to] = distance;
 }
 
+#ifdef CONFIG_X86_64
 int __node_distance(int from, int to)
 {
 	if (from >= numa_distance_cnt || to >= numa_distance_cnt)
@@ -462,6 +463,7 @@ int __node_distance(int from, int to)
 	return numa_distance[from * numa_distance_cnt + to];
 }
 EXPORT_SYMBOL(__node_distance);
+#endif
 
 /*
  * Sanity check to catch more bad NUMA configurations (they are amazingly
#1 lore raw
Quoted 14 lines · H Hartley Sweeten
arch/x86/mm/numa.c +1 -0
index fbeaaf4..11c60a7 100644
@@ -455,6 +455,7 @@ void __init numa_set_distance(int from, int to, int distance)
 	numa_distance[from * numa_distance_cnt + to] = distance;
 }
 
+#ifdef CONFIG_X86_64
 int __node_distance(int from, int to)
 {
 	if (from >= numa_distance_cnt || to >= numa_distance_cnt)

arch/x86/mm/numa.c int __node_distance(int from, int to) · line 469

Quoted 7 lines
arch/x86/mm/numa.c +1 -0
@@ -462,6 +463,7 @@ int __node_distance(int from, int to)
 	return numa_distance[from * numa_distance_cnt + to];
 }
 EXPORT_SYMBOL(__node_distance);
+#endif
 
 /*
  * Sanity check to catch more bad NUMA configurations (they are amazingly

What is 64-bit specific about this function? Shouldn't we be defining it to be node_distance for all of x86?

#2 lore raw

Hello,

Quoted 20 lines · David Rientjes
Quoted 18 lines · H Hartley Sweeten
arch/x86/mm/numa.c +2 -0
index fbeaaf4..11c60a7 100644
@@ -455,6 +455,7 @@ void __init numa_set_distance(int from, int to, int distance)
 	numa_distance[from * numa_distance_cnt + to] = distance;
 }
 
+#ifdef CONFIG_X86_64
 int __node_distance(int from, int to)
 {
 	if (from >= numa_distance_cnt || to >= numa_distance_cnt)
@@ -462,6 +463,7 @@ int __node_distance(int from, int to)
 	return numa_distance[from * numa_distance_cnt + to];
 }
 EXPORT_SYMBOL(__node_distance);
+#endif
 
Quoted 6 lines

arch/x86/mm/numa.c int __node_distance(int from, int to) · line 469

Quoted 3 lines
arch/x86/mm/numa.c +0 -0
 /*
  * Sanity check to catch more bad NUMA configurations (they are amazingly

What is 64-bit specific about this function? Shouldn't we be defining it to be node_distance for all of x86?

Yeap, that's a remnant of the old separate code paths, which wasn't discovered because asm-generic/topology.h defines fallback node_distance() automatically. We should drop #ifdef from arch/x86/include/asm/topology.h::node_distance(). Hartley, can you please send a patch to do that?

Thanks.

Signature · 1 line
tejun
#3 lore raw
Quoted 30 lines · Tejun Heo

Hello,

Quoted 20 lines · David Rientjes
Quoted 18 lines · H Hartley Sweeten
arch/x86/mm/numa.c +2 -0
index fbeaaf4..11c60a7 100644
@@ -455,6 +455,7 @@ void __init numa_set_distance(int from, int to, int distance)
 	numa_distance[from * numa_distance_cnt + to] = distance;
 }
 
+#ifdef CONFIG_X86_64
 int __node_distance(int from, int to)
 {
 	if (from >= numa_distance_cnt || to >= numa_distance_cnt)
@@ -462,6 +463,7 @@ int __node_distance(int from, int to)
 	return numa_distance[from * numa_distance_cnt + to];
 }
 EXPORT_SYMBOL(__node_distance);
+#endif
 
Quoted 6 lines

arch/x86/mm/numa.c int __node_distance(int from, int to) · line 469

Quoted 3 lines
arch/x86/mm/numa.c +0 -0
 /*
  * Sanity check to catch more bad NUMA configurations (they are amazingly

What is 64-bit specific about this function? Shouldn't we be defining it to be node_distance for all of x86?

Quoted 5 lines

Yeap, that's a remnant of the old separate code paths, which wasn't discovered because asm-generic/topology.h defines fallback node_distance() automatically. We should drop #ifdef from arch/x86/include/asm/topology.h::node_distance(). Hartley, can you please send a patch to do that?

Tejun,

I just posted the new patch, "x86: use the same node distance for 32 and 64-bit".

Thanks,
Hartley