Re: [PATCH v5 07/14] memory-hotplug: move pgdat_resize_lock into sparse_remove_one_section()

2012-12-25 Thread Tang Chen
On 12/26/2012 11:47 AM, Kamezawa Hiroyuki wrote: > (2012/12/24 21:09), Tang Chen wrote: >> In __remove_section(), we locked pgdat_resize_lock when calling >> sparse_remove_one_section(). This lock will disable irq. But we don't need >> to lock the whole function. If we do some work to free pagetabl

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

2012-12-25 Thread Kamezawa Hiroyuki
(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 Congyang I'm sorry but is it safe to remove pgdat ? All zone cache and zonelists are properly clea

Re: [PATCH v5 07/14] memory-hotplug: move pgdat_resize_lock into sparse_remove_one_section()

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > In __remove_section(), we locked pgdat_resize_lock when calling > sparse_remove_one_section(). This lock will disable irq. But we don't need > to lock the whole function. If we do some work to free pagetables in > free_section_usemap(), we need to call flush_t

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

2012-12-25 Thread Kamezawa Hiroyuki
(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, 1.5G). You will find 4 new directories memory8, memory9, memory10, > and memory11 under the director

Re: [PATCH v5 05/14] memory-hotplug: introduce new function arch_remove_memory() for removing page table depends on architecture

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Wen Congyang > > For removing memory, we need to remove page table. But it depends > on architecture. So the patch introduce arch_remove_memory() for > removing page table. Now it only calls __remove_pages(). > > Note: __remove_pages() for some archte

Re: [PATCH v5 04/14] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Yasuaki Ishimatsu > > When (hot)adding memory into system, /sys/firmware/memmap/X/{end, start, type} > sysfs files are created. But there is no code to remove these files. The patch > implements the function to remove them. > > Note: The code does not

Re: [PATCH v5 06/14] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap

2012-12-25 Thread Tang Chen
On 12/25/2012 04:09 PM, Jianguo Wu wrote: + + if (!cpu_has_pse) { + next = (addr + PAGE_SIZE)& PAGE_MASK; + pmd = pmd_offset(pud, addr); + if (pmd_none(*pmd)) + continue; +

Re: [PATCH v5 03/14] memory-hotplug: remove redundant codes

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Wen Congyang > > offlining memory blocks and checking whether memory blocks are offlined > are very similar. This patch introduces a new function to remove > redundant codes. > > Signed-off-by: Wen Congyang > --- > mm/memory_hotplug.c | 101 > +++

Re: [PATCH v5 08/14] memory-hotplug: Common APIs to support page tables hot-remove

2012-12-25 Thread Tang Chen
On 12/26/2012 11:11 AM, Tang Chen wrote: On 12/26/2012 10:49 AM, Tang Chen wrote: On 12/25/2012 04:17 PM, Jianguo Wu wrote: + +static void __meminit free_pagetable(struct page *page, int order) +{ + struct zone *zone; + bool bootmem = false; + unsigned long magic; + + /* bootmem page has reserv

Re: [PATCH v5 08/14] memory-hotplug: Common APIs to support page tables hot-remove

2012-12-25 Thread Tang Chen
On 12/26/2012 10:49 AM, Tang Chen wrote: On 12/25/2012 04:17 PM, Jianguo Wu wrote: + +static void __meminit free_pagetable(struct page *page, int order) +{ + struct zone *zone; + bool bootmem = false; + unsigned long magic; + + /* bootmem page has reserved flag */ + if (PageReserved(page)) { + _

Re: [PATCH v5 02/14] memory-hotplug: check whether all memory blocks are offlined or not when removing memory

2012-12-25 Thread Kamezawa Hiroyuki
(2012/12/24 21:09), Tang Chen wrote: > From: Yasuaki Ishimatsu > > We remove the memory like this: > 1. lock memory hotplug > 2. offline a memory block > 3. unlock memory hotplug > 4. repeat 1-3 to offline all memory blocks > 5. lock memory hotplug > 6. remove memory(TODO) > 7. unlock memory hotp

Re: [PATCH v5 08/14] memory-hotplug: Common APIs to support page tables hot-remove

2012-12-25 Thread Tang Chen
On 12/25/2012 04:17 PM, Jianguo Wu wrote: + +static void __meminit free_pagetable(struct page *page, int order) +{ + struct zone *zone; + bool bootmem = false; + unsigned long magic; + + /* bootmem page has reserved flag */ + if (PageReserved(page)) { +

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

2012-12-25 Thread Glauber Costa
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, 1.5G). You will find 4 new directories memory8, memory9, memory10, > and memory11 under the dire

Re: [PATCH v5 08/14] memory-hotplug: Common APIs to support page tables hot-remove

2012-12-25 Thread Jianguo Wu
On 2012/12/24 20:09, Tang Chen wrote: > From: Wen Congyang > > When memory is removed, the corresponding pagetables should alse be removed. > This patch introduces some common APIs to support vmemmap pagetable and x86_64 > architecture pagetable removing. > > All pages of virtual mapping in rem

Re: [PATCH v5 06/14] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap

2012-12-25 Thread Jianguo Wu
On 2012/12/24 20:09, Tang Chen wrote: > From: Yasuaki Ishimatsu > > For removing memmap region of sparse-vmemmap which is allocated bootmem, > memmap region of sparse-vmemmap needs to be registered by get_page_bootmem(). > So the patch searches pages of virtual mapping and registers the pages by