Thread (61 messages) 61 messages, 6 authors, 2012-10-09

Re: [RFC v9 PATCH 00/21] memory-hotplug: hot-remove physical memory

From: Vasilis Liaskovitis <hidden>
Date: 2012-09-27 11:02:13
Also in: linux-acpi, linux-mm, linux-s390, linux-sh, lkml, sparclinux

On Thu, Sep 27, 2012 at 06:06:30PM +0800, Wen Congyang wrote:
Please try the following patch:
From a38ec678e0a9b48b252f457d7910b7527049dc43 Mon Sep 17 00:00:00 2001
From: Wen Congyang <redacted>
Date: Thu, 27 Sep 2012 17:27:57 +0800
Subject: [PATCH] clear the memory to store page information
this solves the hot re-add problem for me.
thanks for the quick solution.

- Vasilis
quoted hunk ↗ jump to hunk
---
 mm/sparse.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/mm/sparse.c b/mm/sparse.c
index ab9d755..36dda08 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -639,7 +639,6 @@ static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
 got_map_page:
 	ret = (struct page *)pfn_to_kaddr(page_to_pfn(page));
 got_map_ptr:
-	memset(ret, 0, memmap_size);
 
 	return ret;
 }
@@ -761,6 +760,8 @@ int __meminit sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
 		goto out;
 	}
 
+	memset(memmap, 0, sizeof(struct page) * nr_pages);
+
 	ms->section_mem_map |= SECTION_MARKED_PRESENT;
 
 	ret = sparse_init_one_section(ms, section_nr, memmap, usemap);
-- 
1.7.1

Thanks
Wen Congyang

> 
> thanks,
> 
> - Vasilis
> 
> [1] https://lkml.org/lkml/2012/9/6/635
> [2] https://lkml.org/lkml/2012/9/11/542
> [3] https://lkml.org/lkml/2012/9/20/37
> [4] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/98691
> 
> 
> 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help