Re: [Bugme-new] [Bug 36192] New: Kernel panic when boot the 2.6.39+ kernel based off of 2.6.32 kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 30 May 2011 16:54:53 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> On Mon, 30 May 2011 16:29:04 +0900
> KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> SRAT: Node 1 PXM 1 0-a0000
> SRAT: Node 1 PXM 1 100000-c8000000
> SRAT: Node 1 PXM 1 100000000-438000000
> SRAT: Node 3 PXM 3 438000000-838000000
> SRAT: Node 5 PXM 5 838000000-c38000000
> SRAT: Node 7 PXM 7 c38000000-1038000000
> 
> Initmem setup node 1 0000000000000000-0000000438000000
>   NODE_DATA [0000000437fd9000 - 0000000437ffffff]
> Initmem setup node 3 0000000438000000-0000000838000000
>   NODE_DATA [0000000837fd9000 - 0000000837ffffff]
> Initmem setup node 5 0000000838000000-0000000c38000000
>   NODE_DATA [0000000c37fd9000 - 0000000c37ffffff]
> Initmem setup node 7 0000000c38000000-0000001038000000
>   NODE_DATA [0000001037fd7000 - 0000001037ffdfff]
> [ffffea000ec40000-ffffea000edfffff] potential offnode page_structs
> [ffffea001cc40000-ffffea001cdfffff] potential offnode page_structs
> [ffffea002ac40000-ffffea002adfffff] potential offnode page_structs
> ==
> 
> Hmm..there are four nodes 1,3,5,7 but....no memory on node 0 hmm ?
> 

I think I found a reason and this is a possible fix. But need to be tested.
And suggestion for better fix rather than this band-aid is appreciated.

==
>From b95edcf43619312f72895476c3e6ef46079bb05f Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Date: Mon, 30 May 2011 16:49:59 +0900
Subject: [PATCH][BUGFIX] fallbacks at page_cgroup allocation.

Under SPARSEMEM, the page_struct is allocated per section.
Then, pfn_valid() for the whole section is "true" and there are page
structs. But, it's not related to valid range of [start_pfn, end_pfn)
and some page structs may not be initialized collectly because
it's not a valid pages.
(memmap_init_zone() skips a page which is not correct in
 early_node_map[] and page->flags is initialized to be 0.)

In this case, a page->flags can be '0'. Assume a case where
node 0 has no memory....

page_cgroup is allocated onto the node

   - page_to_nid(head of section pfn)

Head's pfn will be valid (struct page exists) but page->flags is 0 and contains
node_id:0. This causes allocation onto NODE_DATA(0) and cause panic.

This patch makes page_cgroup to use alloc_pages_exact() only
when NID is N_NORMAL_MEMORY.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
---
 mm/page_cgroup.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 74ccff6..3b0c8f2 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -134,7 +134,10 @@ static void *__meminit alloc_page_cgroup(size_t size, int nid)
 {
 	void *addr = NULL;
 
-	addr = alloc_pages_exact_nid(nid, size, GFP_KERNEL | __GFP_NOWARN);
+	if (node_state(nid, N_NORMAL_MEMORY))
+		addr = alloc_pages_exact_nid(nid, size, GFP_KERNEL | __GFP_NOWARN);
+	if (!addr)
+		addr = alloc_pages_exact(size, GFP_KERNEL | __GFP_NOWARN);
 	if (addr)
 		return addr;
 
-- 
1.7.4.1




--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]