Skip to contentSkip to conversation

x86: use the same node_distance for 32 and 64-bit

PATCH In review H Hartley Sweeten 4 participants 7 messages Sep 19, 2011 – Dec 7, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use the same node_distance for 32 and 64-bit

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Remove the #ifdef to fix both issues.

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

---

arch/x86/include/asm/topology.h +0 -2
index c006924..800f77c 100644
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
 	.balance_interval	= 1,					\
 }
 
-#ifdef CONFIG_X86_64
 extern int __node_distance(int, int);
 #define node_distance(a, b) __node_distance(a, b)
-#endif
 
 #else /* !CONFIG_NUMA */
 
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · H Hartley Sweeten

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Quoted 8 lines

Remove the #ifdef to fix both issues.

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

[ I think kernel.org emails are still down, so I sent this to
[email protected] instead. ]

Quoted 16 lines

---

arch/x86/include/asm/topology.h +0 -2
index c006924..800f77c 100644
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
 	.balance_interval	= 1,					\
 }
 
-#ifdef CONFIG_X86_64
 extern int __node_distance(int, int);
 #define node_distance(a, b) __node_distance(a, b)
-#endif
 
 #else /* !CONFIG_NUMA */
 
#2 lore raw
Quoted 18 lines · David Rientjes
Quoted 7 lines · H Hartley Sweeten

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Quoted 8 lines

Remove the #ifdef to fix both issues.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Yinghai Lu <[email protected]>
Quoted 5 lines

[ I think kernel.org emails are still down, so I sent this to
[email protected] instead. ]

Ingo, Peter, I don't think this was merged into any x86 tree yet (and I gave up trying to figure it out, cloning from tesla.tglx.de was going about 2kB/sec).

It was also acked by Tejun Heo <[email protected]> during review.

Quoted 16 lines
Quoted 16 lines

---

arch/x86/include/asm/topology.h +0 -2
index c006924..800f77c 100644
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
 	.balance_interval	= 1,					\
 }
 
-#ifdef CONFIG_X86_64
 extern int __node_distance(int, int);
 #define node_distance(a, b) __node_distance(a, b)
-#endif
 
 #else /* !CONFIG_NUMA */
 
#3 lore raw
Quoted 23 lines · David Rientjes
Quoted 21 lines · David Rientjes
Quoted 7 lines · H Hartley Sweeten

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Quoted 8 lines

Remove the #ifdef to fix both issues.

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

[ I think kernel.org emails are still down, so I sent this to
[email protected] instead. ]

Quoted 8 lines
Quoted 2 lines

Ingo, Peter, I don't think this was merged into any x86 tree yet (and I gave up trying to figure it out, cloning from tesla.tglx.de was going about 2kB/sec).

It was also acked by Tejun Heo <[email protected]> during review.

No objections, could someone please resend it with all acks in place, and with maintainers Cc:-ed? I don't have the original mail in any of my folders.

Thanks,

Ingo

#4 lore raw

PATCH RESEND 1/1 x86: use the same node_distance for 32 and 64-bit

From: H Hartley Sweeten <[email protected]>

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Remove the #ifdef to fix both issues.

---
 arch/x86/include/asm/topology.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/include/asm/topology.h +0 -2
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
 	.balance_interval	= 1,					\
 }
 
-#ifdef CONFIG_X86_64
 extern int __node_distance(int, int);
 #define node_distance(a, b) __node_distance(a, b)
-#endif
 
 #else /* !CONFIG_NUMA */
 
#5 lore raw

[tip:x86/asm] x86: Use the same node_distance for 32 and 64-bit

Commit-ID:  79f1ddd06471b094ae30eb17b33beb9f1234ca93
Gitweb:     http://git.kernel.org/tip/79f1ddd06471b094ae30eb17b33beb9f1234ca93
Author:     H Hartley Sweeten <[email protected]>
AuthorDate: Tue, 6 Dec 2011 12:22:03 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 7 Dec 2011 09:19:10 +0100

x86: Use the same node_distance for 32 and 64-bit

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the
#define causes the default node_distance macro to be used in
asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Remove the #ifdef to fix both issues.

---
 arch/x86/include/asm/topology.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/include/asm/topology.h +0 -2
index c006924..800f77c 100644
@@ -130,10 +130,8 @@ extern void setup_node_to_cpumask_map(void);
 	.balance_interval	= 1,					\
 }
 
-#ifdef CONFIG_X86_64
 extern int __node_distance(int, int);
 #define node_distance(a, b) __node_distance(a, b)
-#endif
 
 #else /* !CONFIG_NUMA */
 
Acked-by on v1 1/1
#6 lore raw
In reply to H Hartley Sweeten
Quoted 7 lines · H Hartley Sweeten

The node_distance function is not x86 64-bit specific. Having the #ifdef around the extern function declaration and the #define causes the default node_distance macro to be used in asm-generic/topology.h. This also causes a sparse warning in arch/x86/mm/numa.c when CONFIG_X86_64 is not set:

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

Quoted 8 lines

Remove the #ifdef to fix both issues.

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

Thank you.

Signature · 1 line
tejun