All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for.38] x86, numa: Fix numa_emulation code with node0 without RAM
@ 2011-03-02 23:14 Yinghai Lu
  2011-03-04 13:47 ` Tejun Heo
  2011-03-04 14:31 ` [tip:x86/urgent] x86, numa: Fix numa_emulation code with memory-less node0 tip-bot for Yinghai Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Yinghai Lu @ 2011-03-02 23:14 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, David Rientjes,
	Andrew Morton
  Cc: linux-kernel@vger.kernel.org


On one system that does not have RAM on node0.

when numa_emulation is compiled in, and
1. boot system without numa=fake...
2. or boot system with numa=fake=128 to make emulation fail

will get:

[    0.076025] ------------[ cut here ]------------
[    0.080004] kernel BUG at arch/x86/mm/numa_64.c:788!
[    0.080004] invalid opcode: 0000 [#1] SMP 
[    0.080004] last sysfs file: 
[    0.080004] CPU 0 
[    0.080004] Modules linked in:
[    0.080004] 
[    0.080004] Pid: 0, comm: swapper Not tainted 2.6.38-rc6-yh-00212-g3e1f235 #1 Sun Microsystems     Sun Fire X4240/Sun Fire X4240
[    0.080004] RIP: 0010:[<ffffffff81cd1d8c>]  [<ffffffff81cd1d8c>] numa_add_cpu+0x8a/0x156
...
[    0.080004] Call Trace:
[    0.080004]  [<ffffffff81ccd1cd>] identify_cpu+0x2d7/0x2df
[    0.080004]  [<ffffffff827e13e9>] identify_boot_cpu+0x10/0x30
[    0.080004]  [<ffffffff827e15f3>] check_bugs+0x9/0x2d
[    0.080004]  [<ffffffff827d9bcb>] start_kernel+0x3bf/0x3d9
[    0.080004]  [<ffffffff827d92a6>] x86_64_start_reservations+0xb6/0xba
[    0.080004]  [<ffffffff827d93a1>] x86_64_start_kernel+0xf7/0xfe
[    0.080004] Code: 74 06 48 8d 04 90 eb 0f 48 c7 c0 10 d9 00 00 48 03 04 d5 50 e1 5f 82 8b 00 83 f8 ff 74 0d 0f a3 05 7a f9 92 00 19 d2 85 d2 75 02 <0f> 0b 48 98 31 db 48 8b 04 c5 d0 ec 5f 82 48 8b 90 90 af 00 00 

need to used early_cpu_to_node directly, because cpu_to_apicid and apicid_to_node
 will return node0 that is not onlined.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/mm/numa_64.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Index: linux-2.6/arch/x86/mm/numa_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_64.c
+++ linux-2.6/arch/x86/mm/numa_64.c
@@ -780,11 +780,7 @@ void __cpuinit numa_add_cpu(int cpu)
 	int physnid;
 	int nid = NUMA_NO_NODE;
 
-	apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
-	if (apicid != BAD_APICID)
-		nid = apicid_to_node[apicid];
-	if (nid == NUMA_NO_NODE)
-		nid = early_cpu_to_node(cpu);
+	nid = early_cpu_to_node(cpu);
 	BUG_ON(nid == NUMA_NO_NODE || !node_online(nid));
 
 	/*

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for.38] x86, numa: Fix numa_emulation code with node0 without RAM
  2011-03-02 23:14 [PATCH for.38] x86, numa: Fix numa_emulation code with node0 without RAM Yinghai Lu
@ 2011-03-04 13:47 ` Tejun Heo
  2011-03-04 14:31 ` [tip:x86/urgent] x86, numa: Fix numa_emulation code with memory-less node0 tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2011-03-04 13:47 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, David Rientjes,
	Andrew Morton, linux-kernel@vger.kernel.org

On Wed, Mar 02, 2011 at 03:14:58PM -0800, Yinghai Lu wrote:
> 
> On one system that does not have RAM on node0.
> 
> when numa_emulation is compiled in, and
> 1. boot system without numa=fake...
> 2. or boot system with numa=fake=128 to make emulation fail
> 
> will get:
> 
> [    0.076025] ------------[ cut here ]------------
> [    0.080004] kernel BUG at arch/x86/mm/numa_64.c:788!
> [    0.080004] invalid opcode: 0000 [#1] SMP 
> [    0.080004] last sysfs file: 
> [    0.080004] CPU 0 
> [    0.080004] Modules linked in:
> [    0.080004] 
> [    0.080004] Pid: 0, comm: swapper Not tainted 2.6.38-rc6-yh-00212-g3e1f235 #1 Sun Microsystems     Sun Fire X4240/Sun Fire X4240
> [    0.080004] RIP: 0010:[<ffffffff81cd1d8c>]  [<ffffffff81cd1d8c>] numa_add_cpu+0x8a/0x156
> ...
> [    0.080004] Call Trace:
> [    0.080004]  [<ffffffff81ccd1cd>] identify_cpu+0x2d7/0x2df
> [    0.080004]  [<ffffffff827e13e9>] identify_boot_cpu+0x10/0x30
> [    0.080004]  [<ffffffff827e15f3>] check_bugs+0x9/0x2d
> [    0.080004]  [<ffffffff827d9bcb>] start_kernel+0x3bf/0x3d9
> [    0.080004]  [<ffffffff827d92a6>] x86_64_start_reservations+0xb6/0xba
> [    0.080004]  [<ffffffff827d93a1>] x86_64_start_kernel+0xf7/0xfe
> [    0.080004] Code: 74 06 48 8d 04 90 eb 0f 48 c7 c0 10 d9 00 00 48 03 04 d5 50 e1 5f 82 8b 00 83 f8 ff 74 0d 0f a3 05 7a f9 92 00 19 d2 85 d2 75 02 <0f> 0b 48 98 31 db 48 8b 04 c5 d0 ec 5f 82 48 8b 90 90 af 00 00 
> 
> need to used early_cpu_to_node directly, because cpu_to_apicid and apicid_to_node
>  will return node0 that is not onlined.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86, numa: Fix numa_emulation code with memory-less node0
  2011-03-02 23:14 [PATCH for.38] x86, numa: Fix numa_emulation code with node0 without RAM Yinghai Lu
  2011-03-04 13:47 ` Tejun Heo
@ 2011-03-04 14:31 ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Yinghai Lu @ 2011-03-04 14:31 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, tj, tglx, rientjes, mingo

Commit-ID:  3b28cf32cc32594710590685ee478f697ed4f328
Gitweb:     http://git.kernel.org/tip/3b28cf32cc32594710590685ee478f697ed4f328
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 2 Mar 2011 15:14:58 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 4 Mar 2011 15:20:19 +0100

x86, numa: Fix numa_emulation code with memory-less node0

This crash happens on a system that does not have RAM on node0.

When numa_emulation is compiled in, and:

 1. we boot the system without numa=fake...
 2. or we boot the system with numa=fake=128 to make emulation fail

we will get:

[    0.076025] ------------[ cut here ]------------
[    0.080004] kernel BUG at arch/x86/mm/numa_64.c:788!
[    0.080004] invalid opcode: 0000 [#1] SMP
[...]

need to use early_cpu_to_node() directly, because cpu_to_apicid
and apicid_to_node will return node0 that is not onlined.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: David Rientjes <rientjes@google.com>
LKML-Reference: <4D6ECF72.5010308@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/mm/numa_64.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 95ea155..1337c51 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -780,11 +780,7 @@ void __cpuinit numa_add_cpu(int cpu)
 	int physnid;
 	int nid = NUMA_NO_NODE;
 
-	apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
-	if (apicid != BAD_APICID)
-		nid = apicid_to_node[apicid];
-	if (nid == NUMA_NO_NODE)
-		nid = early_cpu_to_node(cpu);
+	nid = early_cpu_to_node(cpu);
 	BUG_ON(nid == NUMA_NO_NODE || !node_online(nid));
 
 	/*

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-04 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 23:14 [PATCH for.38] x86, numa: Fix numa_emulation code with node0 without RAM Yinghai Lu
2011-03-04 13:47 ` Tejun Heo
2011-03-04 14:31 ` [tip:x86/urgent] x86, numa: Fix numa_emulation code with memory-less node0 tip-bot for Yinghai Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.