lkml.org 
[lkml]   [2008]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] sparsemem vmemmap: initialize memmap.
From: Heiko Carstens <heiko.carstens@de.ibm.com>

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;
}

\
 
 \ /
  Last update: 2008-05-09 08:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site