From: Yinghai Lu <yinghai@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH -v4 1/2] nobootmem, x86: Fix 32bit numa system without RAM on Node0
Date: Wed, 31 Mar 2010 20:44:09 -0700 [thread overview]
Message-ID: <4BB41689.9090502@kernel.org> (raw)
In-Reply-To: <ca9eedfe-479e-4ccf-9663-66afcd2bbd69@email.android.com>
on one system without RAM on nod0, got following dump with 32bit numa kernel
early_node_map[4] active PFN ranges
1: 0x00000010 -> 0x00000099
1: 0x00000100 -> 0x0007da00
1: 0x0007e800 -> 0x0007ffa0
1: 0x0007ffae -> 0x0007ffb0
...
Subtract (29 early reservations)
#000 [0000001000 - 0000002000]
#001 [0000089000 - 000008f000]
#002 [0000091000 - 0000093500]
...
#027 [007cbfef40 - 007e800000]
#028 [007e9ca000 - 007ff95000]
(0 free memory ranges)
Initializing HighMem for node 0 (00000000:00000000)
Initializing HighMem for node 1 (00000000:00000000)
Memory: 0k/2096832k available (6662k kernel code, 2096300k reserved, 4829k data, 484k init, 0k highmem)
...
Checking if this processor honours the WP bit even in supervisor mode...Ok.
swapper: page allocation failure. order:0, mode:0x0
Pid: 0, comm: swapper Not tainted 2.6.34-rc3-tip-03818-g4b1ea6c-dirty #35
Call Trace:
[<4087a5dc>] ? printk+0xf/0x11
[<40286728>] __alloc_pages_nodemask+0x417/0x487
[<402a9ce1>] new_slab+0xe2/0x1fe
[<402aa5b2>] kmem_cache_open+0x185/0x358
[<402abbc0>] T.954+0x1c/0x60
[<40d52a29>] kmem_cache_init+0x24/0x113
[<40d39738>] start_kernel+0x166/0x2e4
[<40d3940e>] ? unknown_bootoption+0x0/0x18e
[<40d390ce>] i386_start_kernel+0xce/0xd5
Mem-Info:
Node 1 DMA per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
Node 1 Normal per-cpu:
CPU 0: hi: 0, btch: 1 usd: 0
active_anon:0 inactive_anon:0 isolated_anon:0
active_file:0 inactive_file:0 isolated_file:0
unevictable:0 dirty:0 writeback:0 unstable:0
free:0 slab_reclaimable:0 slab_unreclaimable:0
mapped:0 shmem:0 pagetables:0 bounce:0
When 32bit numa is used, free_all_bootmem() will still only go over with
node id 0.
If node 0 doesn't have RAM installed, We need to go with node1
because early_node_map still use 1 for all ranges, and ram from node1
become low ram.
Try to use MAX_NUMNODES like 64 numa does.
Note: BOOTMEM path has the same problem.
this bug exist before We have NO_BOOTMEM support.
-v3: add more comments, and fix bootmem path too.
-v4: seperate bootmem path fix
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
mm/bootmem.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -303,7 +303,14 @@ unsigned long __init free_all_bootmem_no
unsigned long __init free_all_bootmem(void)
{
#ifdef CONFIG_NO_BOOTMEM
- return free_all_memory_core_early(NODE_DATA(0)->node_id);
+ /*
+ * We need to use MAX_NUMNODES instead of NODE_DATA(0)->node_id
+ * because in some case like Node0 doesnt have RAM installed
+ * low ram will be on Node1
+ * Use MAX_NUMNODES will make sure all ranges in early_node_map[]
+ * will be used instead of only Node0 related
+ */
+ return free_all_memory_core_early(MAX_NUMNODES);
#else
return free_all_bootmem_core(NODE_DATA(0)->bdata);
#endif
next prev parent reply other threads:[~2010-04-01 3:48 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 4:49 Config NO_BOOTMEM breaks my amd64 box James Morris
2010-03-31 6:26 ` H. Peter Anvin
2010-03-31 6:47 ` James Morris
2010-03-31 16:25 ` Yinghai Lu
2010-03-31 18:59 ` Ingo Molnar
2010-03-31 20:57 ` Dave Airlie
2010-03-31 21:02 ` Linus Torvalds
2010-03-31 21:40 ` Ingo Molnar
2010-03-31 21:47 ` Ingo Molnar
2010-03-31 21:14 ` Dave Airlie
2010-03-31 22:02 ` Yinghai Lu
2010-03-31 22:28 ` H. Peter Anvin
2010-03-31 22:58 ` James Morris
2010-03-31 23:02 ` Ingo Molnar
2010-03-31 23:35 ` H. Peter Anvin
2010-03-31 23:43 ` James Morris
2010-03-31 23:48 ` H. Peter Anvin
2010-04-01 1:00 ` James Morris
2010-04-01 12:52 ` Ingo Molnar
2010-04-08 6:32 ` Ingo Molnar
2010-04-08 7:00 ` Yinghai
2010-04-08 7:27 ` Ingo Molnar
2010-04-09 2:43 ` Dave Airlie
2010-04-08 8:05 ` James Morris
2010-04-08 8:22 ` Ingo Molnar
2010-03-31 22:05 ` Yinghai Lu
2010-03-31 22:13 ` Ingo Molnar
2010-03-31 22:16 ` Yinghai Lu
2010-03-31 22:41 ` Ingo Molnar
2010-03-31 22:47 ` Yinghai Lu
2010-03-31 22:56 ` Ingo Molnar
2010-04-01 0:01 ` Johannes Weiner
2010-03-31 23:34 ` H. Peter Anvin
2010-03-31 23:54 ` Yinghai Lu
2010-04-01 0:35 ` H. Peter Anvin
2010-04-01 1:07 ` Yinghai Lu
2010-04-01 2:02 ` [PATCH -v3] nobootmem/bootmem, x86: Fix 32bit numa system without RAM on Node0 Yinghai Lu
2010-04-01 3:18 ` H. Peter Anvin
2010-04-01 3:30 ` Yinghai Lu
2010-04-01 3:44 ` Yinghai Lu [this message]
2010-04-01 3:45 ` [PATCH -v4 2/2] bootmem, " Yinghai Lu
2010-04-01 22:57 ` [tip:x86/urgent] bootmem, x86: Fix 32bit numa system without RAM on node 0 tip-bot for Yinghai Lu
2010-04-01 22:57 ` [tip:x86/urgent] nobootmem, " tip-bot for Yinghai Lu
2010-03-31 10:51 ` Config NO_BOOTMEM breaks my amd64 box Stefan Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BB41689.9090502@kernel.org \
--to=yinghai@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.