Re: [PATCH v5 14/14] memory-hotplug: free node_data when a node is offlined

2012-12-27 Thread Wen Congyang
At 12/26/2012 11:55 AM, Kamezawa Hiroyuki Wrote: > (2012/12/24 21:09), Tang Chen wrote: >> From: Wen Congyang >> >> We call hotadd_new_pgdat() to allocate memory to store node_data. So we >> should free it when removing a node. >> >> Signed-off-by: Wen Con

Re: [PATCH v5 01/14] memory-hotplug: try to offline the memory twice to avoid dependence

2012-12-29 Thread Wen Congyang
At 12/26/2012 11:02 AM, Kamezawa Hiroyuki Wrote: > (2012/12/24 21:09), Tang Chen wrote: >> From: Wen Congyang >> >> memory can't be offlined when CONFIG_MEMCG is selected. >> For example: there is a memory device on node 1. The address range >> is [1G,

Re: [PATCH v5 01/14] memory-hotplug: try to offline the memory twice to avoid dependence

2012-12-29 Thread Wen Congyang
At 12/25/2012 04:35 PM, Glauber Costa Wrote: > On 12/24/2012 04:09 PM, Tang Chen wrote: >> From: Wen Congyang >> >> memory can't be offlined when CONFIG_MEMCG is selected. >> For example: there is a memory device on node 1. The address range >> is [1G,

Re: [PATCH v5 14/14] memory-hotplug: free node_data when a node is offlined

2012-12-29 Thread Wen Congyang
At 12/28/2012 08:28 AM, Kamezawa Hiroyuki Wrote: > (2012/12/27 21:16), Wen Congyang wrote: >> At 12/26/2012 11:55 AM, Kamezawa Hiroyuki Wrote: >>> (2012/12/24 21:09), Tang Chen wrote: >>>> From: Wen Congyang >>>> >>>> We call hotadd_ne

Re: [RFC PATCH v2 4/13] memory-hotplug : remove /sys/firmware/memmap/X sysfs

2012-07-06 Thread Wen Congyang
At 07/06/2012 04:27 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/04 19:01, Wen Congyang wrote: >> At 07/04/2012 01:52 PM, Yasuaki Ishimatsu Wrote: >>> Hi Wen, >>> >>> 2012/07/04 14:08, Wen Congyang wrote: >>>> At 07/04/2012 12:45 PM, Y

Re: [RFC PATCH v3 0/13] memory-hotplug : hot-remove physical memory

2012-07-10 Thread Wen Congyang
ps://lkml.org/lkml/2012/7/5/624 acpi_memory_device_remove() will be called not only when we write 1 to /sys/bus/acpi/devices/PNP0C80:XX/eject. When we unbind it from the driver or remove the module acpi_memhotplug, this function will be called too. I will check whether your patch can work for these

Re: [RFC PATCH v3 0/13] memory-hotplug : hot-remove physical memory

2012-07-10 Thread Wen Congyang
At 07/11/2012 09:52 AM, Wen Congyang Wrote: > At 07/09/2012 06:21 PM, Yasuaki Ishimatsu Wrote: >> This patch series aims to support physical memory hot-remove. >> >> [RFC PATCH v3 1/13] memory-hotplug : rename remove_memory to offline_memory >> [RFC PATCH v3 2/13] me

Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-10 Thread Wen Congyang
David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki I

Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-10 Thread Wen Congyang
At 07/11/2012 01:52 PM, Yasuaki Ishimatsu Wrote: > 2012/07/11 14:06, Wen Congyang wrote: > Hi Wen, > >> At 07/09/2012 06:33 PM, Yasuaki Ishimatsu Wrote: >>> I don't think that all pages of virtual mapping in removed memory can be >>> freed, since page which

Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-11 Thread Wen Congyang
At 07/11/2012 02:48 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/11 15:25, Wen Congyang wrote: >> At 07/11/2012 01:52 PM, Yasuaki Ishimatsu Wrote: >>> 2012/07/11 14:06, Wen Congyang wrote: >>> Hi Wen, >>> >>>> At 07/09/2012 06:33 PM,

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-12 Thread Wen Congyang
ry > - remove physical memory (only return -EBUSY) > - free acpi_memory_device > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: K

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-12 Thread Wen Congyang
ry > - remove physical memory (only return -EBUSY) > - free acpi_memory_device > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: K

Re: [RFC PATCH v3 5/13] memory-hotplug : does not release memory region in PAGES_PER_SECTION chunks

2012-07-12 Thread Wen Congyang
gt; should not be called in PAGES_PER_SECTION chunks. The patch fixes it. > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI

Re: [RFC PATCH v3 4/13] memory-hotplug : remove /sys/firmware/memmap/X sysfs

2012-07-13 Thread Wen Congyang
start, start + size - 1, "System RAM"); firmware_map_remove() is in meminit section, so remove_memory() should be in ref section. Thanks Wen Congyang > + unlock_memory_hotplug(); > + return 0; > > } > EXPORT_SYMBOL_GPL(remove_memory); > Index: linux-

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-13 Thread Wen Congyang
ry > - remove physical memory (only return -EBUSY) > - free acpi_memory_device > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: K

Re: [RFC PATCH v3 4/13] memory-hotplug : remove /sys/firmware/memmap/X sysfs

2012-07-15 Thread Wen Congyang
@type: Type of the memory range. > + * > + * removes a firmware mapping entry. > + * > + * Returns 0 on success, or -EINVAL if no entry. > + **/ > +int __meminit firmware_map_remove(u64 start, u64 end, const char *type) > +{ > + struct firmware_map_entry *entry; > + >

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-16 Thread Wen Congyang
At 07/17/2012 09:54 AM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/17 10:44, Yasuaki Ishimatsu wrote: >> Hi Wen, >> >> 2012/07/13 12:35, Wen Congyang wrote: >>> At 07/09/2012 06:24 PM, Yasuaki Ishimatsu Wrote: >>>> acpi_memory_device_remo

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-16 Thread Wen Congyang
At 07/17/2012 11:08 AM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/17 11:32, Wen Congyang wrote: >> At 07/17/2012 09:54 AM, Yasuaki Ishimatsu Wrote: >>> Hi Wen, >>> >>> 2012/07/17 10:44, Yasuaki Ishimatsu wrote: >>>> Hi Wen, >>>&

Re: [RFC PATCH v3 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-16 Thread Wen Congyang
At 07/17/2012 12:51 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/17 12:32, Wen Congyang wrote: >> At 07/17/2012 11:08 AM, Yasuaki Ishimatsu Wrote: >>> Hi Wen, >>> >>> 2012/07/17 11:32, Wen Congyang wrote: >>>> At 07/17/2012 09:54 AM, Y

Re: [PATCH v4 3/13] memory-hotplug : check whether memory is present or not

2012-07-18 Thread Wen Congyang
enjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > > --- > include/linux/mmzone.h | 21 + > mm/memory_ho

Re: [RFC PATCH v4 4/13] memory-hotplug : remove /sys/firmware/memmap/X sysfs

2012-07-18 Thread Wen Congyang
map_entry(struct kobject *kobj) > +{ > + struct firmware_map_entry *entry = to_memmap_entry(kobj); > + struct page *page; > + > + page = virt_to_page(entry); > + if (PageSlab(page) || PageCompound(page)) > + kfree(entry); IIRC, this func

Re: [PATCH v4 3/13] memory-hotplug : check whether memory is present or not

2012-07-18 Thread Wen Congyang
enjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > > --- > include/linux/mmzone.h | 21 + > mm/memory_ho

Re: [RFC PATCH v4 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-18 Thread Wen Congyang
ameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > > --- > arch/x86/mm/init_64.c | 121 > ++ > include/linux/mm.h|2 > mm/memory_hot

Re: [RFC PATCH v4 2/13] memory-hotplug : add physical memory hotplug code to acpi_memory_device_remove

2012-07-19 Thread Wen Congyang
CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > > --- > drivers/acpi/acpi_memhotplug.c | 27 ++- > drivers/base/memory.c | 39 +++ > include/linu

Re: [RFC PATCH v4 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-19 Thread Wen Congyang
ameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > > --- > arch/x86/mm/init_64.c | 121 > ++ > include/linux/mm.h|2 > mm/memory_hot

Re: [RFC PATCH v4 11/13] memory-hotplug : free memmap of sparse-vmemmap

2012-07-19 Thread Wen Congyang
At 07/19/2012 05:45 PM, Wen Congyang Wrote: > At 07/18/2012 06:16 PM, Yasuaki Ishimatsu Wrote: >> All pages of virtual mapping in removed memory cannot be freed, since some >> pages >> used as PGD/PUD includes not only removed memory but also other memory. So >> the &

[RFC PATCH 0/8] memory-hotplug : hot-remove physical memory(clear page table)

2012-07-20 Thread Wen Congyang
ply ishimatsu's patch series first before applying this patch series. Wen Congyang (8): memory-hotplug: store the node id in acpi_memory_device memory-hotplug: offline memory only when it is onlined memory-hotplug: call remove_memory() to cleanup when removing memory device memory

[PATCH 0/8] remove memory info from list before freeing it

2012-07-20 Thread Wen Congyang
We free info, but we forget to remove it from the list. It will cause unexpected problem when we access the list next time. Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b

[RFC PATCH 1/8] memory-hotplug: store the node id in acpi_memory_device

2012-07-20 Thread Wen Congyang
Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 5cafd6b..db8de39 100644 --- a/drivers

[RFC PATCH 2/8] memory-hotplug: offline memory only when it is onlined

2012-07-20 Thread Wen Congyang
Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index db8de39..712e767 100644 --- a/drivers/acpi

[RFC PATCH 3/8] memory-hotplug: call remove_memory() to cleanup when removing memory device

2012-07-20 Thread Wen Congyang
Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |7 ++- 1 files changed, 6 insertions

[RFC PATCH 4/8] memory-hotplug: export the function acpi_bus_remove()

2012-07-20 Thread Wen Congyang
CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/scan.c |3 ++- include/acpi/acpi_bus.h |1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/scan.c b

[RFC PATCH 5/8] memory-hotplug: call acpi_bus_remove() to remove memory device

2012-07-20 Thread Wen Congyang
Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 58e4e63..431a17c 100644 --- a/drivers/acpi/acpi_memhotplug.c

[RFC PATCH 6/8] memory-hotplug: introduce new function arch_remove_memory()

2012-07-20 Thread Wen Congyang
CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- arch/ia64/mm/init.c| 16 arch/powerpc/mm/mem.c | 14 ++ arch/s390/mm/init.c|8 arch/sh/mm/init.c | 15 +++

[RFC PATCH 7/8] x86: make __split_large_page() generally avialable

2012-07-20 Thread Wen Congyang
s CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- arch/x86/include/asm/pgtable_types.h |1 + arch/x86/mm/pagea

[RFC PATCH 8/8] memory-hotplug: implement arch_remove_memory()

2012-07-20 Thread Wen Congyang
: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- arch/x86/mm/init_64.c | 159 - 1 files changed, 156 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 78b94bc..d78f352 100644 --- a

Re: [RFC PATCH 6/8] memory-hotplug: introduce new function arch_remove_memory()

2012-07-20 Thread Wen Congyang
At 07/20/2012 04:21 PM, Yasuaki Ishimatsu Wrote: > 2012/07/20 16:12, Wen Congyang wrote: >> We don't call __add_pages() directly in the function add_memory() >> because some other architecture related thins needs to be done >> before or after calling __add_page

Re: [RFC PATCH 0/8] memory-hotplug : hot-remove physical memory(clear page table)

2012-07-23 Thread Wen Congyang
At 07/20/2012 03:31 PM, Yasuaki Ishimatsu Wrote: > [Hi Wen, > > Good news!! I was waiting for this patch to come. > Applying the patches, can we hot-remove physical memory completely? If all functions success, I guess so. Thanks Wen Congyang > > Thanks, > Yasuaki Ishimat

Re: [RFC PATCH v4 12/13] memory-hotplug : add node_device_release

2012-07-26 Thread Wen Congyang
device_release() > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki

[RFC PATCH v5 00/19] memory-hotplug: hot-remove physical memory

2012-07-27 Thread Wen Congyang
add_early/hotplug [RFC PATCH v2 4/13] * add release_firmware_map_entry() for freeing firmware_map_entry [RFC PATCH v2 6/13] * add release_memory_block() for freeing memory_block [RFC PATCH v2 11/13] * fix wrong arguments of free_pages() Wen Congyang (5): memory-hotplug: implemen

[RFC PATCH 0/19] firmware_map : unify argument of firmware_map_add_early/hotplug

2012-07-27 Thread Wen Congyang
From: Yasuaki Ishimatsu There are two ways to create /sys/firmware/memmap/X sysfs: - firmware_map_add_early When the system starts, it is calledd from e820_reserve_resources() - firmware_map_add_hotplug When the memory is hot plugged, it is called from add_memory() But these functio

[PATCH 0.5/19] remove memory info from list before freeing it

2012-07-27 Thread Wen Congyang
We free info, but we forget to remove it from the list. It will cause unexpected problem when we access the list next time. Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b

[RFC PATCH v5 01/19] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()

2012-07-27 Thread Wen Congyang
CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |2 +- drivers/base/memory.c |9 +++--

[RFC PATCH v5 02/19] memory-hotplug: implement offline_memory()

2012-07-27 Thread Wen Congyang
ng Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu CC: Vasilis Liaskovitis Signed-off-by: Wen Congyang --- drivers/base/memory.c | 31 +++

[RFC PATCH v5 03/19] memory-hotplug: store the node id in acpi_memory_device

2012-07-27 Thread Wen Congyang
CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang Reviewed-by: Yasuaki Ishimatsu --- drivers/acpi/acpi_memhotplug.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 8957ed9

[RFC PATCH v5 04/19] memory-hotplug: offline and remove memory when removing the memory device

2012-07-27 Thread Wen Congyang
CC: KOSAKI Motohiro Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c | 42 +-- drivers/base/memory.c | 39 + include/linux/memory.h |5 include/li

[RFC PATCH v5 05/19] memory-hotplug: check whether memory is present or not

2012-07-27 Thread Wen Congyang
Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- include/linux/mmzone.h | 19 +++ mm/memory_hotplug.c| 13 + 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/include/linux/mmzone.h

[RFC PATCH v5 06/19] memory-hotplug: export the function acpi_bus_remove()

2012-07-27 Thread Wen Congyang
CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/scan.c |3 ++- include/acpi/acpi_bus.h |1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/scan.c b

[RFC PATCH v5 07/19] memory-hotplug: call acpi_bus_remove() to remove memory device

2012-07-27 Thread Wen Congyang
Motohiro CC: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/acpi/acpi_memhotplug.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index ed37fc2..755cc31 100644 --- a/drivers/acpi/acpi_memhotplug.c

[RFC PATCH v5 08/19] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-07-27 Thread Wen Congyang
free memory which is allocated by bootmem. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- drivers

[RFC PATCH v5 09/19] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks

2012-07-27 Thread Wen Congyang
fixes it. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- arch/powerpc/platforms/pseries/hotplug-memory.c | 13

[RFC PATCH v5 10/19] memory-hotplug: add memory_block_release

2012-07-27 Thread Wen Congyang
ce_release(). So the patch implements memory_block_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- dr

[RFC PATCH v5 11/19] memory-hotplug: remove_memory calls __remove_pages

2012-07-27 Thread Wen Congyang
: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- arch/powerpc/platforms/pseries/hotplug-memory.c |5 + include/linux/memory_hotplug.h |3 +-- mm/memory_hotplug.c | 18 +++--- 3 files changed, 13 insertions

[RFC PATCH v5 12/19] memory-hotplug: introduce new function arch_remove_memory()

2012-07-27 Thread Wen Congyang
n for s390 is not implemented(I don't know how to implement it for s390). CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu Signed-off-by: We

[RFC PATCH v5 13/19] memory-hotplug: check page type in get_page_bootmem

2012-07-27 Thread Wen Congyang
aul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplu

[RFC PATCH v5 14/19] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap

2012-07-27 Thread Wen Congyang
Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- include/linux/memory_hotplug.h |9 - mm/memory_hotplug.c|8 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/include/linux

[RFC PATCH v5 15/19] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap

2012-07-27 Thread Wen Congyang
: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- arch/x86/mm/init_64.c | 52 include

[RFC PATCH v5 16/19] memory-hotplug: free memmap of sparse-vmemmap

2012-07-27 Thread Wen Congyang
__remove_section() of CONFIG_SPARSEMEM_VMEMMAP is deleted. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- arch/x86

[RFC PATCH v5 17/19] memory_hotplug: clear zone when the memory is removed

2012-07-27 Thread Wen Congyang
Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 181 +++ 1 files changed, 181 insert

[RFC PATCH v5 18/19] memory-hotplug: add node_device_release

2012-07-27 Thread Wen Congyang
Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Wen Congyang --- drivers/base/node.c |8 1 files changed, 8 insertions(+), 0 deletions(-) di

[RFC PATCH v5 19/19] memory-hotplug: remove sysfs file of node

2012-07-27 Thread Wen Congyang
: KOSAKI Motohiro CC: Wen Congyang Signed-off-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 5ac035f..5681968 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c

Re: [RFC PATCH v5 05/19] memory-hotplug: check whether memory is present or not

2012-07-29 Thread Wen Congyang
At 07/28/2012 04:17 AM, Tony Luck Wrote: > On Fri, Jul 27, 2012 at 3:28 AM, Wen Congyang wrote: >> +static inline int pfns_present(unsigned long pfn, unsigned long nr_pages) >> +{ >> + int i; >> + for (i = 0; i < nr_pages; i++) { >> +

Re: [RFC PATCH v5 19/19] memory-hotplug: remove sysfs file of node

2012-07-29 Thread Wen Congyang
At 07/27/2012 06:45 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/27 19:36, Wen Congyang wrote: >> From: Yasuaki Ishimatsu >> >> The patch adds node_set_offline() and unregister_one_node() to >> remove_memory() >> for removing sysfs file of node. >

Re: [RFC PATCH v5 19/19] memory-hotplug: remove sysfs file of node

2012-07-29 Thread Wen Congyang
At 07/27/2012 06:45 PM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/07/27 19:36, Wen Congyang wrote: >> From: Yasuaki Ishimatsu >> >> The patch adds node_set_offline() and unregister_one_node() to >> remove_memory() >> for removing sysfs file of node. >

Re: [RFC PATCH v5 12/19] memory-hotplug: introduce new function arch_remove_memory()

2012-07-30 Thread Wen Congyang
At 07/30/2012 06:23 PM, Heiko Carstens Wrote: > On Fri, Jul 27, 2012 at 06:32:15PM +0800, Wen Congyang wrote: >> We don't call __add_pages() directly in the function add_memory() >> because some other architecture related things need to be done >> before or after ca

Re: [RFC PATCH v5 12/19] memory-hotplug: introduce new function arch_remove_memory()

2012-07-31 Thread Wen Congyang
At 07/31/2012 08:40 PM, Gerald Schaefer Wrote: > On Mon, 30 Jul 2012 18:35:37 +0800 > Wen Congyang wrote: > >> At 07/30/2012 06:23 PM, Heiko Carstens Wrote: >>> On Fri, Jul 27, 2012 at 06:32:15PM +0800, Wen Congyang wrote: >>>> We don't call __add_pa

Re: [RFC PATCH v5 12/19] memory-hotplug: introduce new function arch_remove_memory()

2012-07-31 Thread Wen Congyang
At 08/01/2012 10:44 AM, jencce zhou Wrote: > 2012/7/27 Wen Congyang : >> We don't call __add_pages() directly in the function add_memory() >> because some other architecture related things need to be done >> before or after calling __add_pages(). So we should i

Re: [RFC PATCH v5 16/19] memory-hotplug: free memmap of sparse-vmemmap

2012-07-31 Thread Wen Congyang
At 07/31/2012 08:22 PM, Gerald Schaefer Wrote: > On Fri, 27 Jul 2012 18:34:38 +0800 > Wen Congyang wrote: > >> From: Yasuaki Ishimatsu >> >> All pages of virtual mapping in removed memory cannot be freed, since >> some pages used as PGD/PUD includes not only

Re: [RFC PATCH V6 15/19] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap

2012-08-06 Thread Wen Congyang
ristoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > --- > arch/ia64/mm/discontig.c |6 > arch/powerpc/mm/init_64.c |6 > arch/s390/mm/vmem.c|

Re: [RFC PATCH V6 16/19] memory-hotplug: free memmap of sparse-vmemmap

2012-08-06 Thread Wen Congyang
At 08/03/2012 03:49 PM, we...@cn.fujitsu.com Wrote: > From: Wen Congyang This line is wrong. This patch is from Yasuaki Ishimatsu > > All pages of virtual mapping in removed memory cannot be freed, since some > pages > used as PGD/PUD includes not only removed memory but al

Re: [RFC PATCH V6 13/19] memory-hotplug: check page type in get_page_bootmem

2012-08-06 Thread Wen Congyang
> CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > CC: Andrew Morton > CC: KOSAKI Motohiro > CC: Wen Congyang > Signed-off-by: Yasuaki Ishimatsu > --- > m

Re: [RFC v8 PATCH 04/20] memory-hotplug: offline and remove memory when removing the memory device

2012-09-02 Thread Wen Congyang
The memory might become online by other task, even if you offine it. >> + * So we check whether the cpu has been onlined or not. > > I think you meant "memory", not "cpu". Yes. I will fix it. Thanks Wen Congyang > > Actually, "check whether

Re: [RFC v8 PATCH 08/20] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-09-02 Thread Wen Congyang
const char *type) >> +{ >> +struct firmware_map_entry *entry; >> + >> + entry = find_firmware_map_entry(start, end - 1, type); >> +if (!entry) >> +return -EINVAL; >> + >> +firmware_map_remove_entry(entry)

Re: [RFC v8 PATCH 08/20] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-09-03 Thread Wen Congyang
(u64 start, u64 end, >> return 0; >> } >> >> +/** >> + * firmware_map_remove_entry() - Does the real work to remove a firmware >> + * memmap entry. >> + * @entry: removed entry. >> + **/ >> +static inline void firmware_map_remove_entry(s

Re: [RFC v8 PATCH 13/20] memory-hotplug: check page type in get_page_bootmem

2012-09-03 Thread Wen Congyang
t to fix? The function get_page_bootmem() may be called to the same page more than once, but I don't find any problem about current implementation. Thanks Wen Congyang > >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -95,10 +95,17 @@ static void release_m

Re: [RFC v8 PATCH 08/20] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-09-04 Thread Wen Congyang
At 09/05/2012 07:16 AM, Andrew Morton Wrote: > On Mon, 03 Sep 2012 13:51:10 +0800 > Wen Congyang wrote: > >>>> +static void release_firmware_map_entry(struct kobject *kobj) >>>> +{ >>>> + struct firmware_map_entry *entry = to_memmap_entry(kobj); &

Re: [RFC v9 PATCH 20/21] memory-hotplug: clear hwpoisoned flag when onlining pages

2012-09-06 Thread Wen Congyang
At 09/06/2012 03:27 PM, andywu106建国 Wrote: > 2012/9/5 >> >> From: Wen Congyang >> >> hwpoisoned may set when we offline a page by the sysfs interface >> /sys/devices/system/memory/soft_offline_page or >> /sys/devices/system/memory/hard_offline_page. If we

Re: [RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-09-09 Thread Wen Congyang
uest, can we hot-remove memory on > kvm guest? > > http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg01389.html Yes, if we apply this patchset, we can test hot-remove memory on kvm guest. But that patchset doesn't implement _PS3, so there is some restriction. Thanks Wen Cong

Re: [RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-09-10 Thread Wen Congyang
doesn't want > the offline memory is in *self-refresh* state. Power saving? Do you need _PSx support? Thanks Wen Congyang > > Any comments are appreciated. > > Thanks, > Jerry > > 2012/9/10 Vasilis Liaskovitis > >> Hi, >> >> On Mon,

Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not

2012-09-10 Thread Wen Congyang
At 09/11/2012 10:24 AM, Yasuaki Ishimatsu Wrote: > Hi Wen, > > 2012/09/11 11:15, Wen Congyang wrote: >> Hi, ishimatsu >> >> At 09/05/2012 05:25 PM, we...@cn.fujitsu.com Wrote: >>> From: Yasuaki Ishimatsu >>> >>> If system supports memory h

Re: [RFC v9 PATCH 05/21] memory-hotplug: check whether memory is present or not

2012-09-10 Thread Wen Congyang
change_state() to hotremoving memory, I think this patch can be removed. What do you think? Thanks Wen Congyang > > CC: David Rientjes > CC: Jiang Liu > CC: Len Brown > CC: Benjamin Herrenschmidt > CC: Paul Mackerras > CC: Christoph Lameter > Cc: Minchan Kim > C

Re: [RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-09-10 Thread Wen Congyang
When system resume, I just need to > enable it again. > > Hi Wen, > > I am sorry for that I doesn't know the "_PSx support" means. Maybe I > needn't it. Hmm, arm doesn't support ACPI, so please ignore it. Thanks Wen Congyang > > Thanks, > Jerr

Re: [RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-09-11 Thread Wen Congyang
At 09/10/2012 09:52 PM, Vasilis Liaskovitis Wrote: > Hi, > > On Mon, Sep 10, 2012 at 10:01:44AM +0800, Wen Congyang wrote: >> At 09/10/2012 09:46 AM, Yasuaki Ishimatsu Wrote: >>> Hi Wen, >>> >>> 2012/09/01 5:49, Andrew Morton wrote: >&

Re: [RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-09-18 Thread Wen Congyang
At 09/13/2012 01:18 AM, Vasilis Liaskovitis Wrote: > Hi, > > On Wed, Sep 12, 2012 at 01:20:28PM +0800, Wen Congyang wrote: >>> >>> On Mon, Sep 10, 2012 at 10:01:44AM +0800, Wen Congyang wrote: >>>> At 09/10/2012 09:46 AM, Yasuaki Ishimatsu Wrote: >>

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

2012-09-26 Thread Wen Congyang
eric_file_aio_write+0x1a0/0x3c0 > [ 232.120013] [] ? __sb_start_write+0x6b/0x130 > [ 232.120013] [] ? generic_file_aio_write+0x7e/0x100 > [ 232.120013] [] ? do_sync_write+0x94/0xd0 > [ 232.120013] [] ? vfs_write+0xaa/0x160 > [ 232.120013] [] ? sys_write+0x47/0x90 > [ 232.120

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

2012-09-26 Thread Wen Congyang
with SCI (qemu) eject > - attempt to hot-readd same memory > > When the pages are re-onlined on hot-readd, I get a bad_page state for many > pages e.g. Can you provide your config file? Thanks Wen Congyang > > [ 59.611278] init_memory_mapping: [mem 0x8000-0x9fff] >

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

2012-09-26 Thread Wen Congyang
ing information: 1. config file 2. qemu's command line You said you did OSPM-eject. Do you mean write 1 to /sys/bus/acpi/devices/PNP0C80:XX/eject? Thanks Wen Congyang > > [ 170.566995] Slab corruption (Not tainted): Acpi-State > start=88009fc1e548, len=80 > [ 1

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

2012-09-27 Thread Wen Congyang
with SCI (qemu) eject > - attempt to hot-readd same memory > > When the pages are re-onlined on hot-readd, I get a bad_page state for many > pages e.g. I have reproduced this problem, and I investigate it now. Thanks Wen Congyang > > [ 59.611278] init_memory_mapping: [mem

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

2012-09-27 Thread Wen Congyang
> > Patch 20/21 deals with a similar scenario, but only for __PG_HWPOISON flag. > Did i miss any other patch for this? Please try the following patch: >From a38ec678e0a9b48b252f457d7910b7527049dc43 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Thu, 27 Sep 2012 17:27:57 +0800

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

2012-09-27 Thread Wen Congyang
At 09/27/2012 06:35 PM, Vasilis Liaskovitis Wrote: > On Thu, Sep 27, 2012 at 02:37:14PM +0800, Wen Congyang wrote: >> Hi Vasilis Liaskovitis >> >> At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote: >>> Hi, >>> >>> I am testing 3.6.0-rc7 with this v9

Re: [PATCH 8/10] memory-hotplug : remove page table of x86_64 architecture

2012-10-07 Thread Wen Congyang
phys_pmd_remove(pmd, addr, end); >> +unmap_low_page(pmd); >> +__flush_tlb_all(); >> +} >> +__flush_tlb_all(); > > This doesn't flush the other CPUs doesn't it? How to flush the other CPU's tlb? use on_each_cpu() to run __flush_tlb_all() on each online cpu? Thanks Wen Congyang > > -Andi > ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 0/10] memory-hotplug: hot-remove physical memory

2012-10-07 Thread Wen Congyang
offline every non primary memory > block. 2nd iterate: > offline primary (i.e. first added) memory block. It may work. > OK, I will try it. Thanks Wen Congyang ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

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

2012-10-08 Thread Wen Congyang
At 09/27/2012 12:46 AM, Vasilis Liaskovitis Wrote: > Hi, > > I am testing 3.6.0-rc7 with this v9 patchset plus more recent fixes > [1],[2],[3] > Running in a guest (qemu+seabios from [4]). > CONFIG_SLAB=y > CONFIG_DEBUG_SLAB=y > > After succesfull hot-add and online, I am doing a hot-remove wit

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

2012-10-09 Thread Wen Congyang
ne, I am doing a hot-remove with "echo 1 > > /sys/bus/acpi/devices/PNP/eject" > When I do the OSPM-eject, I often get slab corruption in "acpi-state" cache, > or in other caches The following patch can fix this problem: https://lkml.org/lkml/2012/7/12/186 Thanks Wen

Re: [PATCH 5/10] memory-hotplug : memory-hotplug: check page type in get_page_bootmem

2012-10-18 Thread Wen Congyang
>> CC: David Rientjes >>> CC: Jiang Liu >>> CC: Len Brown >>> CC: Christoph Lameter >>> Cc: Minchan Kim >>> CC: Andrew Morton >>> CC: KOSAKI Motohiro >>> CC: Wen Congyang >>> Signe

Re: [PATCH 1/10] memory-hotplug : check whether memory is offline or not when removing memory

2012-10-19 Thread Wen Congyang
s whether memory is offline or not. > > You don't explain WHY we need the check. This patch is no necessary now, because the newest kernel has checked it. Thanks Wen Congyang > > >> CC: David Rientjes >> CC: Jiang Liu >> CC: Len Brown >> CC: Chr

Re: [PATCH 1/10] memory-hotplug : check whether memory is offline or not when removing memory

2012-10-19 Thread Wen Congyang
At 2012/10/19 18:44, Wen Congyang Wrote: At 10/06/2012 03:27 AM, KOSAKI Motohiro Wrote: On Thu, Oct 4, 2012 at 10:25 PM, Yasuaki Ishimatsu wrote: When calling remove_memory(), the memory should be offline. If the function is used to online memory, kernel panic may occur. So the patch checks

Re: [PATCH 1/10] memory-hotplug : check whether memory is offline or not when removing memory

2012-10-19 Thread Wen Congyang
t >> hold >> the lock in the whole operation. So we should check whether all memory >> sections >> are offlined before step6. > > You should describe the race scenario in the patch description. OK? > OK Thanks Wen Congyang ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 8/10] memory-hotplug : remove page table of x86_64 architecture

2012-10-22 Thread Wen Congyang
> - __split_large_page((pte_t *)pud, addr, (pte_t *)pmd); > + __split_large_page((pte_t *)pud, > +(unsigned long)__va(addr), > +(pte_t *)pmd); > >

Re: [PATCH 8/10] memory-hotplug : remove page table of x86_64 architecture

2012-10-23 Thread Wen Congyang
At 10/23/2012 03:09 PM, wujianguo Wrote: > On 2012-10-22 15:11, Wen Congyang wrote: >> Hi, Wu >> >> Sorry for late reply. >> >> At 10/09/2012 04:26 PM, wujianguo Wrote: >>> Hi Congyang, >>> I think we should also free pages which are used by

  1   2   >