linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory_hotplug: always initialize pageblock bitmap.
@ 2008-05-09  6:06 Heiko Carstens, Heiko Carstens
  2008-05-09  6:39 ` KAMEZAWA Hiroyuki
  0 siblings, 1 reply; 9+ messages in thread
From: Heiko Carstens, Heiko Carstens @ 2008-05-09  6:06 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Whitcroft, Dave Hansen, Gerald Schaefer, linux-kernel, linux-mm

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@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2008-05-14  0:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-09  6:06 [PATCH] memory_hotplug: always initialize pageblock bitmap Heiko Carstens, Heiko Carstens
2008-05-09  6:39 ` KAMEZAWA Hiroyuki
2008-05-09  6:45   ` Heiko Carstens
2008-05-10 12:45   ` Heiko Carstens
2008-05-12  1:55     ` KAMEZAWA Hiroyuki
2008-05-12  9:19       ` KAMEZAWA Hiroyuki
2008-05-13 11:58         ` Heiko Carstens, Heiko Carstens
2008-05-13 18:52           ` Heiko Carstens
2008-05-14  0:52             ` KAMEZAWA Hiroyuki

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