[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080509060609.GB9840@osiris.boeblingen.de.ibm.com>
Date: Fri, 9 May 2008 08:06:09 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Whitcroft <apw@...dowen.org>,
Dave Hansen <haveblue@...ibm.com>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH] memory_hotplug: always initialize pageblock bitmap.
From: Heiko Carstens <heiko.carstens@...ibm.com>
Trying to online a new memory section that was added via memory hotplug
sometimes results in crashes when the new pages are added via
__free_page. Reason for that is that the pageblock bitmap isn't
initialized and hence contains random stuff.
That means that get_pageblock_migratetype() returns also random stuff
and therefore
list_add(&page->lru,
&zone->free_area[order].free_list[migratetype]);
in __free_one_page() tries to do a list_add to something that isn't
even necessarily a list.
This is only an issue for memory sections that get added after boot
time since all previously present memory sections allocate their
pageblock bitmaps via the bootmem allocator which in turn initializes
just everything it returns.
Cc: Andy Whitcroft <apw@...dowen.org>
Cc: Dave Hansen <haveblue@...ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@...ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>
---
mm/sparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/mm/sparse.c
===================================================================
--- linux-2.6.orig/mm/sparse.c
+++ linux-2.6/mm/sparse.c
@@ -244,7 +244,7 @@ unsigned long usemap_size(void)
#ifdef CONFIG_MEMORY_HOTPLUG
static unsigned long *__kmalloc_section_usemap(void)
{
- return kmalloc(usemap_size(), GFP_KERNEL);
+ return kzalloc(usemap_size(), GFP_KERNEL);
}
#endif /* CONFIG_MEMORY_HOTPLUG */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists