From: Yinghai Lu <yinghai@kernel.org>
To: Zeno Davatz <zdavatz@gmail.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
Damien Wyart <damien.wyart@free.fr>,
Catalin Marinas <catalin.marinas@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"x86@kernel.org" <x86@kernel.org>,
"mingo@elte.hu" <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: kmemleak, cpu usage jump out of nowhere
Date: Fri, 16 Jul 2010 11:27:36 -0700 [thread overview]
Message-ID: <4C40A498.5060208@kernel.org> (raw)
In-Reply-To: <AANLkTimxDBusBSkL0I2g9tsj4gLHaqVFArqcfixfzePh@mail.gmail.com>
it seems that you are using 32bit kernel. please check if this one help.
Thanks
Yinghai
Subject: [PATCH -v3] x86,mm: fix 32bit numa sparsemem
Borislav Petkov <borislav.petkov@amd.com> reported his 32bit numa has problem:
[ 0.000000] Reserving total of 4c00 pages for numa KVA remap
[ 0.000000] kva_start_pfn ~ 32800 max_low_pfn ~ 375fe
[ 0.000000] max_pfn = 238000
[ 0.000000] 8202MB HIGHMEM available.
[ 0.000000] 885MB LOWMEM available.
[ 0.000000] mapped low ram: 0 - 375fe000
[ 0.000000] low ram: 0 - 375fe000
[ 0.000000] alloc (nid=8 100000 - 7ee00000) (1000000 - ffffffff) 1000 1000 => 34e7000
[ 0.000000] alloc (nid=8 100000 - 7ee00000) (1000000 - ffffffff) 200 40 => 34c9d80
[ 0.000000] alloc (nid=0 100000 - 7ee00000) (1000000 - ffffffffffffffff) 180 40 => 34e6140
[ 0.000000] alloc (nid=1 80000000 - c7e60000) (1000000 - ffffffffffffffff) 240 40 => 80000000
[ 0.000000] BUG: unable to handle kernel paging request at 40000000
[ 0.000000] IP: [<c2c8cff1>] __alloc_memory_core_early+0x147/0x1d6
[ 0.000000] *pdpt = 0000000000000000 *pde = f000ff53f000ff00
...
[ 0.000000] Call Trace:
[ 0.000000] [<c2c8b4f8>] ? __alloc_bootmem_node+0x216/0x22f
[ 0.000000] [<c2c90c9b>] ? sparse_early_usemaps_alloc_node+0x5a/0x10b
[ 0.000000] [<c2c9149e>] ? sparse_init+0x1dc/0x499
[ 0.000000] [<c2c79118>] ? paging_init+0x168/0x1df
[ 0.000000] [<c2c780ff>] ? native_pagetable_setup_start+0xef/0x1bb
looks like it allocate much high address for bootmem.
try to cut limit with get_max_mapped()
-v3: make alloc_bootmem_node could fallback to other node.
just like old alloc_bootmem_node did
need this patch for 2.6.34 and 2.6.35
Reported-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: stable@kernel.org
---
mm/bootmem.c | 24 ++++++++++++++++++++----
mm/page_alloc.c | 3 +++
2 files changed, 23 insertions(+), 4 deletions(-)
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c
+++ linux-2.6/mm/page_alloc.c
@@ -3634,6 +3634,9 @@ void * __init __alloc_memory_core_early(
int i;
void *ptr;
+ if (limit > get_max_mapped())
+ limit = get_max_mapped();
+
/* need to go over early_node_map to find out good range for node */
for_each_active_range_index_in_nid(i, nid) {
u64 addr;
Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -833,15 +833,24 @@ static void * __init ___alloc_bootmem_no
void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
unsigned long align, unsigned long goal)
{
+ void *ptr;
+
if (WARN_ON_ONCE(slab_is_available()))
return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
#ifdef CONFIG_NO_BOOTMEM
- return __alloc_memory_core_early(pgdat->node_id, size, align,
+ ptr = __alloc_memory_core_early(pgdat->node_id, size, align,
+ goal, -1ULL);
+ if (ptr)
+ return ptr;
+
+ ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
goal, -1ULL);
#else
- return ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
+ ptr = ___alloc_bootmem_node(pgdat->bdata, size, align, goal, 0);
#endif
+
+ return ptr;
}
void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
@@ -977,14 +986,21 @@ void * __init __alloc_bootmem_low(unsign
void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
unsigned long align, unsigned long goal)
{
+ void *ptr;
+
if (WARN_ON_ONCE(slab_is_available()))
return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
#ifdef CONFIG_NO_BOOTMEM
- return __alloc_memory_core_early(pgdat->node_id, size, align,
+ ptr = __alloc_memory_core_early(pgdat->node_id, size, align,
+ goal, ARCH_LOW_ADDRESS_LIMIT);
+ if (ptr)
+ return ptr;
+ ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align,
goal, ARCH_LOW_ADDRESS_LIMIT);
#else
- return ___alloc_bootmem_node(pgdat->bdata, size, align,
+ ptr = ___alloc_bootmem_node(pgdat->bdata, size, align,
goal, ARCH_LOW_ADDRESS_LIMIT);
#endif
+ return ptr;
}
next prev parent reply other threads:[~2010-07-16 18:32 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 6:12 kmemleak, cpu usage jump out of nowhere Zeno Davatz
2010-07-14 8:05 ` Pekka Enberg
2010-07-14 8:27 ` Zeno Davatz
2010-07-14 9:47 ` Catalin Marinas
2010-07-14 9:55 ` Pekka Enberg
2010-07-14 10:00 ` Zeno Davatz
2010-07-15 14:58 ` Catalin Marinas
2010-07-15 15:15 ` Zeno Davatz
2010-07-15 15:54 ` Pekka Enberg
2010-07-15 16:28 ` Damien Wyart
2010-07-15 19:16 ` Damien Wyart
2010-07-15 19:50 ` Pekka Enberg
2010-07-15 20:00 ` Damien Wyart
2010-07-15 20:38 ` Zeno Davatz
2010-07-15 20:50 ` Pekka Enberg
2010-07-15 20:57 ` Zeno Davatz
2010-07-16 7:12 ` Zeno Davatz
2010-07-16 7:29 ` Zeno Davatz
2010-07-16 7:37 ` Zeno Davatz
2010-07-16 7:50 ` Pekka Enberg
2010-07-16 9:17 ` Zeno Davatz
2010-07-16 9:32 ` Pekka Enberg
2010-07-16 9:42 ` Zeno Davatz
2010-07-16 9:47 ` Zeno Davatz
2010-07-16 18:27 ` Yinghai Lu [this message]
2010-07-16 20:29 ` Zeno Davatz
2010-07-16 20:59 ` Yinghai Lu
2010-07-17 8:46 ` Zeno Davatz
2010-07-15 20:52 ` Pekka Enberg
2010-08-03 9:05 ` Peter Zijlstra
2010-08-03 9:11 ` Zeno Davatz
2010-08-03 9:15 ` damien.wyart
2010-08-03 9:18 ` Zeno Davatz
2010-08-20 9:32 ` Damien Wyart
2010-08-20 9:40 ` Peter Zijlstra
2010-07-14 8:31 ` Damien Wyart
2010-07-14 8:34 ` Zeno Davatz
2010-07-14 8:38 ` Pekka Enberg
2010-07-14 8:54 ` Zeno Davatz
2010-07-14 8:57 ` Pekka Enberg
2010-07-14 9:57 ` Catalin Marinas
2010-07-14 10:04 ` Zeno Davatz
2010-07-14 11:54 ` Catalin Marinas
2010-07-14 11:59 ` Zeno Davatz
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=4C40A498.5060208@kernel.org \
--to=yinghai@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=damien.wyart@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=x86@kernel.org \
--cc=zdavatz@gmail.com \
/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.