public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH for .39] x86, numa: Fix numa_emulation code with node0 without RAM
@ 2011-03-02 23:18 Yinghai Lu
  2011-03-04 11:04 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Yinghai Lu @ 2011-03-02 23:18 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Tejun Heo,
	David Rientjes
  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.092026] ------------[ cut here ]------------
[    0.096005] kernel BUG at arch/x86/mm/numa_emulation.c:439!
[    0.096005] invalid opcode: 0000 [#1] SMP 
[    0.096005] last sysfs file: 
[    0.096005] CPU 0 
[    0.096005] Modules linked in:
[    0.096005] 
[    0.096005] Pid: 0, comm: swapper Not tainted 2.6.38-rc6-tip-yh-03869-gcb0491d-dirty #684 Sun Microsystems     Sun Fire X4240/Sun Fire X4240
[    0.096005] RIP: 0010:[<ffffffff81cdc65b>]  [<ffffffff81cdc65b>] numa_add_cpu+0x56/0xcf
[    0.096005] RSP: 0000:ffffffff82437ed8  EFLAGS: 00010246
...
[    0.096005] Call Trace:
[    0.096005]  [<ffffffff81cd7931>] identify_cpu+0x2d7/0x2df
[    0.096005]  [<ffffffff827e54fa>] identify_boot_cpu+0x10/0x30
[    0.096005]  [<ffffffff827e5704>] check_bugs+0x9/0x2d
[    0.096005]  [<ffffffff827dceda>] start_kernel+0x3d7/0x3f1
[    0.096005]  [<ffffffff827dc2cc>] x86_64_start_reservations+0x9c/0xa0
[    0.096005]  [<ffffffff827dc4ad>] x86_64_start_kernel+0x1dd/0x1e8
[    0.096005] Code: 74 06 48 8d 04 90 eb 0f 48 c7 c0 30 d9 00 00 48 03 04 d5 90 0f 60 82 8b 00 83 f8 ff 74 0d 0f a3 05 8b 7e 92 00 19 d2 85 d2 75 02 <0f> 0b 48 98 be 00 01 00 00 48 c7 c7 e0 44 60 82 44 8b 2c 85 e0 
[    0.096005] RIP  [<ffffffff81cdc65b>] numa_add_cpu+0x56/0xcf
[    0.096005]  RSP <ffffffff82437ed8>
[    0.096026] ---[ end trace a7919e7f17c0a725 ]---

need to used early_cpu_to_node directly, because numa_cpu_node() will return node0 that is not onlined.

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

diff --git a/arch/x86/mm/numa_emulation.c b/arch/x86/mm/numa_emulation.c
index aeecea9..75b31dc 100644
--- a/arch/x86/mm/numa_emulation.c
+++ b/arch/x86/mm/numa_emulation.c
@@ -417,9 +417,7 @@ void __cpuinit numa_add_cpu(int cpu)
 {
 	int physnid, nid;
 
-	nid = numa_cpu_node(cpu);
-	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));
 
 	physnid = emu_nid_to_phys[nid];

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

* Re: [PATCH for .39] x86, numa: Fix numa_emulation code with node0 without RAM
  2011-03-02 23:18 [PATCH for .39] x86, numa: Fix numa_emulation code with node0 without RAM Yinghai Lu
@ 2011-03-04 11:04 ` Tejun Heo
  2011-03-04 13:51   ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2011-03-04 11:04 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, David Rientjes,
	linux-kernel@vger.kernel.org

On Wed, Mar 02, 2011 at 03:18:29PM -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.092026] ------------[ cut here ]------------
> [    0.096005] kernel BUG at arch/x86/mm/numa_emulation.c:439!
> [    0.096005] invalid opcode: 0000 [#1] SMP 
> [    0.096005] last sysfs file: 
> [    0.096005] CPU 0 
> [    0.096005] Modules linked in:
> [    0.096005] 
> [    0.096005] Pid: 0, comm: swapper Not tainted 2.6.38-rc6-tip-yh-03869-gcb0491d-dirty #684 Sun Microsystems     Sun Fire X4240/Sun Fire X4240
> [    0.096005] RIP: 0010:[<ffffffff81cdc65b>]  [<ffffffff81cdc65b>] numa_add_cpu+0x56/0xcf
> [    0.096005] RSP: 0000:ffffffff82437ed8  EFLAGS: 00010246
> ...
> [    0.096005] Call Trace:
> [    0.096005]  [<ffffffff81cd7931>] identify_cpu+0x2d7/0x2df
> [    0.096005]  [<ffffffff827e54fa>] identify_boot_cpu+0x10/0x30
> [    0.096005]  [<ffffffff827e5704>] check_bugs+0x9/0x2d
> [    0.096005]  [<ffffffff827dceda>] start_kernel+0x3d7/0x3f1
> [    0.096005]  [<ffffffff827dc2cc>] x86_64_start_reservations+0x9c/0xa0
> [    0.096005]  [<ffffffff827dc4ad>] x86_64_start_kernel+0x1dd/0x1e8
> [    0.096005] Code: 74 06 48 8d 04 90 eb 0f 48 c7 c0 30 d9 00 00 48 03 04 d5 90 0f 60 82 8b 00 83 f8 ff 74 0d 0f a3 05 8b 7e 92 00 19 d2 85 d2 75 02 <0f> 0b 48 98 be 00 01 00 00 48 c7 c7 e0 44 60 82 44 8b 2c 85 e0 
> [    0.096005] RIP  [<ffffffff81cdc65b>] numa_add_cpu+0x56/0xcf
> [    0.096005]  RSP <ffffffff82437ed8>
> [    0.096026] ---[ end trace a7919e7f17c0a725 ]---
> 
> need to used early_cpu_to_node directly, because numa_cpu_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

* Re: [PATCH for .39] x86, numa: Fix numa_emulation code with node0 without RAM
  2011-03-04 11:04 ` Tejun Heo
@ 2011-03-04 13:51   ` Tejun Heo
  0 siblings, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2011-03-04 13:51 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, David Rientjes,
	linux-kernel@vger.kernel.org

On Fri, Mar 04, 2011 at 12:04:01PM +0100, Tejun Heo wrote:
> > Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> Acked-by: Tejun Heo <tj@kernel.org>

The Acked-by was for the other patch for .38.  I applied this one to
x86/mm.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2011-03-04 13:51 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:18 [PATCH for .39] x86, numa: Fix numa_emulation code with node0 without RAM Yinghai Lu
2011-03-04 11:04 ` Tejun Heo
2011-03-04 13:51   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox