linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sparsemem vmemmap: initialize memmap.
@ 2008-05-09  6:38 Heiko Carstens, Heiko Carstens
  2008-05-09 10:31 ` Andy Whitcroft
  2008-05-09 16:25 ` Christoph Lameter
  0 siblings, 2 replies; 5+ messages in thread
From: Heiko Carstens, Heiko Carstens @ 2008-05-09  6:38 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andy Whitcroft, Christoph Lameter, Gerald Schaefer, linux-kernel,
	linux-mm

Trying to online a new memory section that was added via memory hotplug
results in lots of messages of pages in bad page state.
Reason is that the alloacted virtual memmap isn't initialized.
This is only an issue for memory sections that get added after boot
time since for all other memmaps the bootmem allocator was used which
returns only initialized memory.

I noticed this on s390 which has its private vmemmap_populate function
without using callbacks to the common code. But as far as I can see the
generic code has the same bug, so fix it just once.

Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 mm/sparse-vmemmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/mm/sparse-vmemmap.c
===================================================================
--- linux-2.6.orig/mm/sparse-vmemmap.c
+++ linux-2.6/mm/sparse-vmemmap.c
@@ -154,6 +154,6 @@ struct page * __meminit sparse_mem_map_p
 	int error = vmemmap_populate(map, PAGES_PER_SECTION, nid);
 	if (error)
 		return NULL;
-
+	memset(map, 0, PAGES_PER_SECTION * sizeof(struct page));
 	return map;
 }

--
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] 5+ messages in thread

end of thread, other threads:[~2008-05-09 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09  6:38 [PATCH] sparsemem vmemmap: initialize memmap Heiko Carstens, Heiko Carstens
2008-05-09 10:31 ` Andy Whitcroft
2008-05-09 11:34   ` Heiko Carstens
2008-05-09 16:25 ` Christoph Lameter
2008-05-09 17:01   ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).