[PATCH v4 6/6] page_alloc: Bootmem limit with movablecore_map

2012-12-19 Thread Tang Chen
This patch make sure bootmem will not allocate memory from areas that may be ZONE_MOVABLE. The map info is from movablecore_map boot option. Signed-off-by: Tang Chen Signed-off-by: Lai Jiangshan Reviewed-by: Wen Congyang Tested-by: Lin Feng --- include/linux/memblock.h |1 + mm

[PATCH v4 4/6] page_alloc: Introduce zone_movable_limit[] to keep movable limit for nodes

2012-12-19 Thread Tang Chen
for each node. Signed-off-by: Tang Chen Signed-off-by: Liu Jiang Reviewed-by: Wen Congyang Reviewed-by: Lai Jiangshan Tested-by: Lin Feng --- mm/page_alloc.c | 79 ++- 1 files changed, 78 insertions(+), 1 deletions(-) diff --git a/mm

[PATCH v4 3/6] ACPI: Restructure movablecore_map with memory info from SRAT.

2012-12-19 Thread Tang Chen
the hotpluggable ranges from SRAT. Otherwise, do nothing. The kernel will use all the memory in all nodes evenly. The idea "getting info from SRAT" was from Liu Jiang . And the idea "do more limit for memblock" was from Wu Jianguo Signed-off-by: Tang Chen Tested-by: Gu Zhe

Re: [PATCH v4 3/6] ACPI: Restructure movablecore_map with memory info from SRAT.

2012-12-19 Thread Tang Chen
On 12/19/2012 04:15 PM, Tang Chen wrote: The Hot Plugable bit in SRAT flags specifys if the memory range could be hotplugged. If user specified movablecore_map=nn[KMG]@ss[KMG], reset movablecore_map.map to the intersection of hotpluggable ranges from SRAT and old movablecore_map.map. Else

Re: [PATCH v2 5/5] page_alloc: Bootmem limit with movablecore_map

2012-12-19 Thread Tang Chen
void __init insert_movablecore_map(unsigned long start_pfn, +void __init insert_movablecore_map(unsigned long start_pfn, unsigned long end_pfn) { int pos, overlap; -- 1.7.6.1 . Thanks, Jianguo Wu On 2012-11-23 18:44, Tang Chen wrote: This patch

Re: [PART5 Patch 1/5] page_alloc: add kernelcore_max_addr

2012-12-20 Thread Tang Chen
Hi Randy, Thank you for your reviewing. :) I think this boot option has been dropped. And we are implementing a new boot option called "movablecore_map" to replace it. Please refer to the following url if you like: https://lkml.org/lkml/2012/12/19/51 Thanks. :) On 12/20/2012 03:26 AM,

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

2012-12-24 Thread Tang Chen
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 hotplug All memory blocks must be offlined before removing

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

2012-12-24 Thread Tang Chen
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 directory /sys/devices/system/memory/. If CONFIG_MEMCG

[PATCH v5 12/14] memory-hotplug: memory_hotplug: clear zone when removing the memory

2012-12-24 Thread Tang Chen
From: Yasuaki Ishimatsu When a memory is added, we update zone's and pgdat's start_pfn and spanned_pages in the function __add_zone(). So we should revert them when the memory is removed. The patch adds a new function __remove_zone() to do this. Signed-off-by: Yasuaki Ishimatsu Signed-off-by:

[PATCH v5 13/14] memory-hotplug: remove sysfs file of node

2012-12-24 Thread Tang Chen
This patch introduces a new function try_offline_node() to remove sysfs file of node when all memory sections of this node are removed. If some memory sections of this node are not removed, this function does nothing. Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- drivers/acpi

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

2012-12-24 Thread Tang Chen
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 free firmware_map_entry which is allocated by

[PATCH v5 11/14] memory-hotplug: Integrated __remove_section() of CONFIG_SPARSEMEM_VMEMMAP.

2012-12-24 Thread Tang Chen
Currently __remove_section for SPARSEMEM_VMEMMAP does nothing. But even if we use SPARSEMEM_VMEMMAP, we can unregister the memory_section. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- mm/memory_hotplug.c | 11 --- 1 files changed, 0

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

2012-12-24 Thread Tang Chen
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 --- mm/memory_hotplug.c | 20 +++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/mm/memory_hotplug.c

[PATCH v5 10/14] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-24 Thread Tang Chen
, and sparc. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Jianguo Wu Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- arch/arm64/mm/mmu.c |3 +++ arch/ia64/mm/discontig.c |4 arch/powerpc/mm/init_64.c |4 arch/s390/mm/vmem.c |4 arch/sparc/mm

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

2012-12-24 Thread Tang Chen
be cleared. In this case, the page used as PT/PMD can be freed. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Jianguo Wu Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- arch/x86/include/asm/pgtable_types.h |1 + arch/x86/mm/init_64.c| 297

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

2012-12-24 Thread Tang Chen
the WARN_ON_ONCE() in smp_call_function_many() will be triggered. Signed-off-by: Tang Chen Signed-off-by: Lai Jiangshan Signed-off-by: Wen Congyang --- mm/memory_hotplug.c |4 mm/sparse.c |5 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mm

[PATCH v5 09/14] memory-hotplug: remove page table of x86_64 architecture

2012-12-24 Thread Tang Chen
This patch searches a page table about the removed memory, and clear page table for x86_64 architecture. Signed-off-by: Wen Congyang Signed-off-by: Jianguo Wu Signed-off-by: Jiang Liu Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c | 10 ++ 1 files changed, 10 insertions(+), 0

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

2012-12-24 Thread Tang Chen
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 get_page_bootmem(). Note:

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

2012-12-24 Thread Tang Chen
block. Patch3: new patch, no logical change, just remove reduntant codes. Patch9: merge the patch from wujianguo into this patch. flush tlb on all cpu after the pagetable is changed. Patch12: new patch, free node_data when a node is offlined. Tang Chen (5): memory-hotplug: move

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

2012-12-24 Thread Tang Chen
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 archtecuture is not implemented (I don't know how

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

2012-12-24 Thread Tang Chen
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 --- 1 files

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

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

Re: [PATCH v4 3/6] ACPI: Restructure movablecore_map with memory info from SRAT.

2012-12-25 Thread Tang Chen
soon. Thanks. :) > Thanks, > Yasuaki Ishimatsu > > 2012/12/19 18:11, Tang Chen wrote: >> The Hot Plugable bit in SRAT flags specifys if the memory range >> could be hotplugged. >> >> If user specified movablecore_map=nn[KMG]@ss[KMG], reset >> movablecore_ma

Re: [PATCH v3 3/5] page_alloc: Introduce zone_movable_limit[] to keep movable limit for nodes

2012-12-12 Thread Tang Chen
On 12/12/2012 08:49 AM, Jiang Liu wrote: This patch introduces a new array zone_movable_limit[] to store the ZONE_MOVABLE limit from movablecore_map boot option for all nodes. The function sanitize_zone_movable_limit() will find out to which node the ranges in movable_map.map[] belongs, and

Re: [PATCH v3 4/5][RESEND] page_alloc: Make movablecore_map has higher priority

2012-12-12 Thread Tang Chen
Hi Simon, Thanks for reviewing. This logic is aimed at make movablecore_map coexist with kernelcore/movablecore. Please see below. :) On 12/12/2012 09:33 AM, Simon Jeons wrote: @@ -4839,9 +4839,17 @@ static void __init find_zone_movable_pfns_for_nodes(void) required_kernelcore

Re: [PATCH v3 3/5] page_alloc: Introduce zone_movable_limit[] to keep movable limit for nodes

2012-12-12 Thread Tang Chen
Hi Simon, On 12/12/2012 05:29 PM, Simon Jeons wrote: Thanks for your clarify. Enable PAE on x86 32bit kernel, 8G memory, movablecore=6.5G Could you please provide more info ? Such as the whole kernel commondline. And did this happen after you applied these patches ? What is the output

Re: [PATCH v3 3/5] page_alloc: Introduce zone_movable_limit[] to keep movable limit for nodes

2012-12-12 Thread Tang Chen
On 12/13/2012 08:28 AM, Simon Jeons wrote: On Wed, 2012-12-12 at 18:32 +0800, Tang Chen wrote: Hi Simon, On 12/12/2012 05:29 PM, Simon Jeons wrote: Thanks for your clarify. Enable PAE on x86 32bit kernel, 8G memory, movablecore=6.5G Could you please provide more info ? Such as the whole

[PATCH 2/2] memory-hotplug: Disable CONFIG_MOVABLE_NODE option by default.

2012-12-14 Thread Tang Chen
This patch set CONFIG_MOVABLE_NODE to "default n" instead of "depends on BROKEN". Signed-off-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu --- mm/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index 2ad51cb..1ed3295 100

[PATCH 1/2] memory-hotplug: Add help info for CONFIG_MOVABLE_NODE option

2012-12-14 Thread Tang Chen
-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu --- mm/Kconfig | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 71259e0..2ad51cb 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -150,6 +150,16 @@ config MOVABLE_NODE depends on X86_64 depends

[PATCH 0/2] Add help info for CONFIG_MOVABLE_NODE and disable is by default

2012-12-14 Thread Tang Chen
The first patch adds help info for CONFIG_MOVABLE_NODE option. The second patch disable this option by default. Tang Chen (2): memory-hotplug: Add help info for CONFIG_MOVABLE_NODE option memory-hotplug: Disable CONFIG_MOVABLE_NODE option by default. mm/Kconfig | 12 +++- 1 file

[PATCH v2 2/2] memory-hotplug: Disable CONFIG_MOVABLE_NODE option by default.

2012-12-16 Thread Tang Chen
This patch set CONFIG_MOVABLE_NODE to "default n" instead of "depends on BROKEN". Signed-off-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu --- mm/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index 491..bbd6bfa 100

[PATCH v2 0/2] Add help info for CONFIG_MOVABLE_NODE and disable is by default

2012-12-16 Thread Tang Chen
The first patch adds help info for CONFIG_MOVABLE_NODE option. The second patch disable this option by default. change log v1 -> v2: Fix spelling comments from Ingo. Tang Chen (2): memory-hotplug: Add help info for CONFIG_MOVABLE_NODE option memory-hotplug: Disable CONFIG_MOVABLE_NODE opt

[PATCH v2 1/2] memory-hotplug: Add help info for CONFIG_MOVABLE_NODE option

2012-12-16 Thread Tang Chen
-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu Acked-by: Ingo Molnar --- mm/Kconfig | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 71259e0..491 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -150,6 +150,16 @@ config MOVABLE_NODE depends

Re: [PART4 Patch v2 2/2] memory_hotplug: allow online/offline memory to result movable node

2012-12-16 Thread Tang Chen
Cc: Yinghai Lu Cc: Rusty Russell Cc: Greg KH Signed-off-by: Lai Jiangshan Signed-off-by: Wen Congyang Signed-off-by: Andrew Morton Signed-off-by: Tang Chen Tested-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-)

Re: mmots: memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap fix

2013-01-11 Thread Tang Chen
Hi Michal, Thank you very much for the nice catch. :) On 01/11/2013 05:56 PM, Michal Hocko wrote: Defconfig for x86_64 complains arch/x86/mm/init_64.c: In function ‘register_page_bootmem_memmap’: arch/x86/mm/init_64.c:1340: error: implicit declaration of function ‘get_page_bootmem’

Re: mmots: memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap fix

2013-01-11 Thread Tang Chen
On 01/11/2013 06:47 PM, Michal Hocko wrote: Darn! And now that I am looking at the patch closer it is too x86 centric so this cannot be in the generic code. I will try to cook something better. Sorry about the noise. It is more complicated than I thought. One would tell it's a mess. The patch

Re: mmots: memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap fix

2013-01-11 Thread Tang Chen
On 01/11/2013 08:12 PM, Michal Hocko wrote: On Fri 11-01-13 20:06:25, Tang Chen wrote: On 01/11/2013 06:47 PM, Michal Hocko wrote: Darn! And now that I am looking at the patch closer it is too x86 centric so this cannot be in the generic code. I will try to cook something better. Sorry about

[PATCH v5 2/5] page_alloc: add movable_memmap kernel parameter

2013-01-14 Thread Tang Chen
. Signed-off-by: Tang Chen Signed-off-by: Lai Jiangshan Reviewed-by: Wen Congyang Tested-by: Lin Feng --- Documentation/kernel-parameters.txt | 17 + include/linux/mm.h | 11 +++ mm/page_alloc.c | 126 +++ 3 files

[PATCH v5 1/5] x86: get pg_data_t's memory from other node

2013-01-14 Thread Tang Chen
. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Lai Jiangshan Signed-off-by: Tang Chen Signed-off-by: Jiang Liu --- arch/x86/mm/numa.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 2d125be..db939b6 100644 --- a/arch/x86/mm

[PATCH v5 5/5] page_alloc: Bootmem limit with movablecore_map

2013-01-14 Thread Tang Chen
This patch make sure bootmem will not allocate memory from areas that may be ZONE_MOVABLE. The map info is from movablecore_map boot option. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Reviewed-by: Lai Jiangshan Tested-by: Lin Feng --- include/linux/memblock.h |1 + mm/memblock.c

[PATCH v5 3/5] page_alloc: Introduce zone_movable_limit[] to keep movable limit for nodes

2013-01-14 Thread Tang Chen
for each node. change log: Do find_usable_zone_for_movable() to initialize movable_zone so that sanitize_zone_movable_limit() could use it. Reported-by: Wu Jianguo Signed-off-by: Tang Chen Signed-off-by: Liu Jiang Reviewed-by: Wen Congyang Reviewed-by: Lai Jiangshan Tested-by: Lin Feng --- mm

[PATCH v5 0/5] Add movablecore_map boot option

2013-01-14 Thread Tang Chen
LE won't use these addresses. Suggested by Wu Jianguo 3) Add lowmem addresses check, when the system has highmem, make sure ZONE_MOVABLE won't use lowmem. Suggested by Liu Jiang 4) Fix misuse of pfns in movablecore_map.map[] as physical addresses. Tang Chen (4): page_alloc: add mo

[PATCH v5 4/5] page_alloc: Make movablecore_map has higher priority

2013-01-14 Thread Tang Chen
find_usable_zone_for_movable() to free_area_init_nodes() so that sanitize_zone_movable_limit() in patch 3 could use initialized movable_zone. Reported-by: Wu Jianguo Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Reviewed-by: Lai Jiangshan Tested-by: Lin Feng --- mm/page_alloc.c | 28

[BUG Fix Patch 2/6] Bug fix: Do not calculate direct mapping pages when freeing vmemmap pagetables.

2013-01-15 Thread Tang Chen
We only need to update direct_pages_count[level] when we freeing direct mapped pagetables. Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c | 17 +++-- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e829113

[BUG Fix Patch 1/6] Bug fix: Hold spinlock across find|remove /sys/firmware/memmap/X operation.

2013-01-15 Thread Tang Chen
of these two functions need to be careful to hold the lock when using these two functions. The suggestion is from Andrew Morton Signed-off-by: Tang Chen --- drivers/firmware/memmap.c | 25 + 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/firmware

[BUG Fix Patch 3/6] Bug fix: Do not free direct mapping pages twice.

2013-01-15 Thread Tang Chen
Direct mapped pages were freed when they were offlined, or they were not allocated. So we only need to free vmemmap pages, no need to free direct mapped pages. Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git

[BUG Fix Patch 0/6] Bug fix for physical memory hot-remove.

2013-01-15 Thread Tang Chen
Hi Andrew, Here are some bug fix patches for physical hot-remove patches. And there are some new ones reported by others, I'll fix them soon. Thanks. :) Tang Chen (6): Bug fix: Hold spinlock across find|remove /sys/firmware/memmap/X operation. Bug fix: Do not calculate direct mapping

[BUG Fix Patch 4/6] Bug fix: Do not free page split from hugepage one by one.

2013-01-15 Thread Tang Chen
Signed-off-by: Tang Chen Signed-off-by: Wen Congyang --- arch/x86/mm/init_64.c | 80 +++- 1 files changed, 71 insertions(+), 9 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e77d312..ff0206b 100644 --- a/arch/x86/mm/ini

[BUG Fix Patch 6/6] Bug fix: Reuse the storage of /sys/firmware/memmap/X/ allocated by bootmem.

2013-01-15 Thread Tang Chen
the map entries allocated by bootmem when they are removed, and a lock to protect it. And these entries will be reused when the memory is hot-added again. The idea is suggestted by Andrew Morton Signed-off-by: Tang Chen --- drivers/firmware/memmap.c | 103

[BUG Fix Patch 5/6] Bug fix: Fix the wrong comments of map_entries.

2013-01-15 Thread Tang Chen
Now we have a map_entries_lock to protect map_entries list. So we need to update the comments. Signed-off-by: Tang Chen --- drivers/firmware/memmap.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c index 940c4e9

Re: [BUG Fix Patch 1/6] Bug fix: Hold spinlock across find|remove /sys/firmware/memmap/X operation.

2013-01-15 Thread Tang Chen
On 01/16/2013 06:26 AM, Julian Calaby wrote: Hi Tang, One minor point. /* - * Search memmap entry + * firmware_map_find_entry: Search memmap entry. + * @start: Start of the memory range. + * @end: End of the memory range (exclusive). + * @type: Type of the memory range. + * + * This

[PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.

2013-01-22 Thread Tang Chen
will panic the next time memory is hot-added. patch3: the old way of freeing pagetable pages was wrong. We should never split larger pages into small ones. Lai Jiangshan (1): Bug-fix: mempolicy: fix is_valid_nodemask() Tang Chen (3): Bug fix: Do not split pages when freeing

[PATCH Bug fix 5/5] Bug fix: Fix the doc format in drivers/firmware/memmap.c

2013-01-22 Thread Tang Chen
Make the comments in drivers/firmware/memmap.c kernel-doc compliant. Reported-by: Julian Calaby Signed-off-by: Tang Chen --- drivers/firmware/memmap.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c index

[PATCH Bug fix 1/5] Bug fix: consider compound pages when free memmap

2013-01-22 Thread Tang Chen
/0x166 [ 696.960128] RSP [ 697.001768] CR2: ea004000 [ 697.041336] ---[ end trace e7f94e3a34c442d4 ]--- [ 697.096474] Kernel panic - not syncing: Fatal exception Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- mm/sparse.c |2 +- 1 files changed, 1 insertions(+), 1 deletions

[PATCH Bug fix 4/5] Bug fix: Fix section mismatch problem of release_firmware_map_entry().

2013-01-22 Thread Tang Chen
The function release_firmware_map_entry() references the function __meminit firmware_map_find_entry_in_list(). So it should also have __meminit. And since the firmware_map_entry->kobj is initialized with memmap_ktype, the memmap_ktype should also be prefixed by __refdata. Signed-off-by: T

[PATCH Bug fix 3/5] Bug fix: Do not split pages when freeing pagetable pages.

2013-01-22 Thread Tang Chen
This patch will fix the problem based on the above patches. Reported-by: Wen Congyang Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c | 148 +++- 1 files changed, 46 insertions(+), 102 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm

[PATCH Bug fix 2/5] Bug-fix: mempolicy: fix is_valid_nodemask()

2013-01-22 Thread Tang Chen
BLE should be valid zone for policies. is_valid_nodemask() need to be changed to match it. Fix: check all zones, even its zoneid > policy_zone. Use nodes_intersects() instead open code to check it. Reported-by: Wen Congyang Signed-off-by: Lai Jiangshan Signed-off-by: Tang Chen --- mm/mempolicy.c

[PATCH Bug fix 1/5] cpu_hotplug: clear apicid to node when the cpu is hotremoved

2013-01-22 Thread Tang Chen
o-node mapping when the cpu is hotremoved. Cc: Yasuaki Ishimatsu Cc: David Rientjes Cc: Jiang Liu Cc: Minchan Kim Cc: KOSAKI Motohiro Cc: Andrew Morton Cc: Mel Gorman Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Tang Chen Signed-off-by: Wen Cong

[PATCH Bug fix 5/5] Do not use cpu_to_node() to find an offlined cpu's node.

2013-01-22 Thread Tang Chen
. Else, a online cpu on another node will be picked. Cc: Yasuaki Ishimatsu Cc: David Rientjes Cc: Jiang Liu Cc: Minchan Kim Cc: KOSAKI Motohiro Cc: Andrew Morton Cc: Mel Gorman Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Signed-off-by: Tang Chen

[PATCH Bug fix 0/4] Bug fix for movablecore_map boot option.

2013-01-22 Thread Tang Chen
Hi Andrew, patch1 ~ patch3 fix some problems of movablecore_map boot option. And since the name "core" could be confused, patch4 rename this option to movablemem_map. All these patches are based on the latest -mm tree. git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

[PATCH Bug fix 3/4] Bug fix: Remove the unused sanitize_zone_movable_limit() definition.

2013-01-22 Thread Tang Chen
When CONFIG_HAVE_MEMBLOCK_NODE_MAP is not defined, sanitize_zone_movable_limit() is also not used. So remove it. Signed-off-by: Tang Chen --- mm/page_alloc.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cd6f8a6..2bd529e

[PATCH Bug fix 4/4] Rename movablecore_map to movablemem_map.

2013-01-22 Thread Tang Chen
Since "core" could be confused with cpu cores, but here it is memory, so rename the boot option movablecore_map to movablemem_map. Signed-off-by: Tang Chen --- Documentation/kernel-parameters.txt |8 ++-- include/linux/memblock.h|2 +- include/

[PATCH Bug fix 2/4] Bug fix: Fix the doc format.

2013-01-22 Thread Tang Chen
Signed-off-by: Tang Chen --- mm/page_alloc.c | 23 ++- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 00037a3..cd6f8a6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4372,7 +4372,7 @@ static unsigned long

[PATCH Bug fix 0/5] Bug fix for node offline

2013-01-22 Thread Tang Chen
akpm Tang Chen (1): Do not use cpu_to_node() to find an offlined cpu's node. Wen Congyang (4): cpu_hotplug: clear apicid to node when the cpu is hotremoved memory-hotplug: export the function try_offline_node() cpu-hotplug, memory-hotplug: try offline the node when hotremoving a cpu

[PATCH Bug fix 4/5] cpu-hotplug,memory-hotplug: clear cpu_to_node() when offlining the node

2013-01-22 Thread Tang Chen
: KOSAKI Motohiro Cc: Andrew Morton Cc: Mel Gorman Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Tang Chen Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- mm/memory_hotplug.c | 30 +- 1 files changed, 29 insert

[PATCH Bug fix 1/4] Bug fix: Use CONFIG_HAVE_MEMBLOCK_NODE_MAP to protect movablecore_map in memblock_overlaps_region().

2013-01-22 Thread Tang Chen
The definition of struct movablecore_map is protected by CONFIG_HAVE_MEMBLOCK_NODE_MAP but its use in memblock_overlaps_region() is not. So add CONFIG_HAVE_MEMBLOCK_NODE_MAP to protect the use of movablecore_map in memblock_overlaps_region(). Reported-by: Stephen Rothwell Signed-off-by: Tang

[PATCH Bug fix 3/5] cpu-hotplug, memory-hotplug: try offline the node when hotremoving a cpu

2013-01-22 Thread Tang Chen
: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Tang Chen Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- drivers/acpi/processor_driver.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/processor_driver.c

[PATCH Bug fix 2/5] memory-hotplug: export the function try_offline_node()

2013-01-22 Thread Tang Chen
Cc: KOSAKI Motohiro Cc: Andrew Morton Cc: Mel Gorman Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Tang Chen Signed-off-by: Wen Congyang Signed-off-by: Tang Chen --- include/linux/memory_hotplug.h |2 ++ mm/memory_hotplug.c|

Re: linux-next: build warning after merge of the akpm tree

2013-01-22 Thread Tang Chen
x 3/4] Bug fix: Remove the unused sanitize_zone_movable_limit() definition. When CONFIG_HAVE_MEMBLOCK_NODE_MAP is not defined, sanitize_zone_movable_limit() is also not used. So remove it. Signed-off-by: Tang Chen --- mm/page_alloc.c |5 - 1 files changed, 0 insertions(+), 5 deletion

Re: [PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.

2013-01-23 Thread Tang Chen
On 01/23/2013 08:29 PM, Simon Jeons wrote: Hi Tang, I remember your big physical memory hot-remove patchset has already merged by Andrew, but where I can find it? Could you give me git tree address? Hi Simon, You can find all the physical memory hot-remove patches and related bugfix patches

Re: [PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.

2013-01-23 Thread Tang Chen
On 01/24/2013 08:35 AM, Simon Jeons wrote: On Wed, 2013-01-23 at 21:17 +0800, Tang Chen wrote: On 01/23/2013 08:29 PM, Simon Jeons wrote: Hi Tang, I remember your big physical memory hot-remove patchset has already merged by Andrew, but where I can find it? Could you give me git tree address

[PATCH 1/2] cpu_hotplug: Remove __cpuinitdata declaration of __apicid_to_node[].

2013-01-24 Thread Tang Chen
__apicid_to_node[] will be used by acpi_unmap_lsapic() when we do node hotplug. So it is no longer an init data. Do not declare __apicid_to_node[] as a __cpuinitdata, otherwise it will cause section mismatch warning when compiling. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c |2 +- 1

[PATCH 2/2] cpu-hotplug,memory-hotplug: Remove __cpuinit declaration of numa_clear_node().

2013-01-24 Thread Tang Chen
numa_clear_node() will be used by check_and_unmap_cpu_on_node() when we do node hotplug. So it is no longer a __cpuinit function. Do not declare it as a __cpuinit function, otherwise it will cause section mismatch warning when compiling. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c |2

[PATCH 0/2] Fix section mismatch caused by node offline code.

2013-01-24 Thread Tang Chen
Since node offline code uses __apicid_to_node[] and numa_clear_node(), they are no longer init data or function. So do not declare them as __cpuinitdata or __cpuinit. Tang Chen (2): cpu_hotplug: Remove __cpuinitdata declaration of __apicid_to_node[]. cpu-hotplug,memory-hotplug: Remove

[PATCH 1/5] x86: Get pg_data_t's memory from other node

2012-11-19 Thread Tang Chen
Ishimatsu Signed-off-by: Lai Jiangshan Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Tested-by: Lin Feng --- arch/x86/mm/numa.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 2d125be..ae2e76e 100644 --- a/arch/x86/mm

[PATCH 5/5] page_alloc: Bootmem limit with movablecore_map

2012-11-19 Thread Tang Chen
This patch make sure bootmem will not allocate memory from areas that may be ZONE_MOVABLE. The map info is from movablecore_map boot option. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Tested-by: Lin Feng --- include/linux/memblock.h |1 + mm/memblock.c| 43

[PATCH 4/5] page_alloc: Make movablecore_map has higher priority.

2012-11-19 Thread Tang Chen
If kernelcore or movablecore is specified at the same time with movablecore_map, movablecore_map will have higher priority to be satisfied. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Tested-by: Lin Feng --- mm/page_alloc.c | 29 +++-- 1 files changed, 27

[PATCH 3/5] page_alloc: Sanitize zone_movable_pfn.

2012-11-19 Thread Tang Chen
zone_movable_pfn is initialiesd as 0. This patch set its elements to the first pfn of ZONE_MOVABLE of the corresponding node. The map info is from movablecore_map boot option. zone_movable_pfn[nid] == 0 means the node has no ZONE_MOVABLE. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang

[PATCH 2/5] page_alloc: Add movablecore_map boot option.

2012-11-19 Thread Tang Chen
ranges. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Tested-by: Lin Feng --- Documentation/kernel-parameters.txt | 17 include/linux/mm.h | 11 +++ mm/page_alloc.c | 146 +++ 3 files changed, 174 insertions(+), 0

[PATCH 0/5] Add movablecore_map boot option.

2012-11-19 Thread Tang Chen
is specified. 4) This option could be specified at most MAX_NUMNODES times. 5) If kernelcore or movablecore is also specified, movablecore_map will have higher priority to be satisfied. 6) This option has no conflict with memmap option. Tang Chen (4): page_alloc: add movable_memmap kernel parameter

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

2012-12-26 Thread Tang Chen
Hi Kamezawa-san, Thanks for the reviewing. Please see below. :) On 12/26/2012 11:20 AM, Kamezawa Hiroyuki wrote: > (2012/12/24 21:09), Tang Chen wrote: >> From: Wen Congyang >> >> offlining memory blocks and checking whether memory blocks are offlined >> are very sim

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

2012-12-26 Thread Tang Chen
On 12/26/2012 11:30 AM, Kamezawa Hiroyuki wrote: >> @@ -41,6 +42,7 @@ struct firmware_map_entry { >> const char *type; /* type of the memory range */ >> struct list_headlist; /* entry for the linked list */ >> struct kobject kobj; /* kobject for

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

2012-12-26 Thread Tang Chen
On 12/26/2012 11:10 AM, Kamezawa Hiroyuki wrote: > (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. repea

Re: [RFC PATCH 1/3] ACPIHP: introduce a framework for ACPI based system device hotplug

2012-08-02 Thread Tang Chen
ring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result Seems that we need to check the sysfs_create_link()'s return value here, and if it fails, shall we at least give a warning message here ? Thanks. :) > + kfree(name); > + }

[PATCH] Do not change worker's running cpu in cmci_rediscover().

2012-09-27 Thread Tang Chen
/0x70 [ 6155.452019] [] ? gs_change+0x13/0x13 Signed-off-by: Tang Chen Signed-off-by: Miao Xie --- arch/x86/kernel/cpu/mcheck/mce_intel.c | 34 +-- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86

Re: [PATCH v5 0/5] Add movablecore_map boot option

2013-01-16 Thread Tang Chen
On 01/17/2013 06:52 AM, H. Peter Anvin wrote: On 01/16/2013 01:29 PM, Andrew Morton wrote: Yes. If SRAT support is available, all memory which enabled hotpluggable bit are managed by ZONEMOVABLE. But performance degradation may occur by NUMA because we can only allocate anonymous page and

Re: [PATCH v5 0/5] Add movablecore_map boot option

2013-01-18 Thread Tang Chen
On 01/18/2013 03:38 PM, Yasuaki Ishimatsu wrote: 2013/01/18 15:25, H. Peter Anvin wrote: We already do DMI parsing in the kernel... Thank you for giving the infomation. Is your mention /sys/firmware/dmi/entries? If so, my box does not have memory information. My box has only type 0, 1, 2,

Re: linux-next: build failure after merge of the final tree (akpm tree related)

2013-01-20 Thread Tang Chen
Hi Stephen, On 01/21/2013 02:08 PM, Stephen Rothwell wrote: Hi all, After merging the final tree, today's linux-next build (arm defconfig) failed like this: mm/memblock.c: In function 'memblock_find_in_range_node': mm/memblock.c:104:2: error: invalid use of undefined type 'struct

[PATCH v2 1/1] page_alloc: Bootmem limit with movablecore_map

2013-01-20 Thread Tang Chen
This patch make sure bootmem will not allocate memory from areas that may be ZONE_MOVABLE. The map info is from movablecore_map boot option. Signed-off-by: Tang Chen Reviewed-by: Wen Congyang Reviewed-by: Lai Jiangshan Tested-by: Lin Feng --- include/linux/memblock.h |2 + mm/memblock.c

[PATCH v2 1/2] mem-hotplug: Reset node managed pages when hot-adding a new pgdat.

2014-11-10 Thread Tang Chen
_pages() to reset_all_zones_managed_pages() 2. Make reset_node_managed_pages() non-static 3. Call reset_node_managed_pages() in hotadd_new_pgdat() after pgdat is initialized Signed-off-by: Tang Chen Signed-off-by: Yasuaki Ishimatsu --- include/linux/bootmem.h | 1 + mm/bootmem.c| 9 + mm/memory_hotplug.c

[PATCH v2 0/2] Fix node meminfo and zoneinfo corruption.

2014-11-10 Thread Tang Chen
provides the simplest way to fix problem 2. Tang Chen (2): mem-hotplug: Reset node managed pages when hot-adding a new pgdat. mem-hotplug: Reset node present pages when hot-adding a new pgdat. include/linux/bootmem.h | 1 + mm/bootmem.c| 9 + mm/memory_hotplug.c

[PATCH v2 2/2] mem-hotplug: Reset node present pages when hot-adding a new pgdat.

2014-11-10 Thread Tang Chen
. Signed-off-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 8aba12b..26eac61 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1067,6 +1067,

Re: [PATCH v4] KVM: x86: fix access memslots w/o hold srcu read lock

2014-11-10 Thread Tang Chen
Hi Wanpeng, I think I have totally missed this thread. I opened lockdep and RCU debug, and tried on 3.18-rc1. But I didn't get the warning. My steps are: 1. Use numactl to bind a qemu process to node1. 2. Offline all node1 memory. And the qemu process is still running. Would you please tell

[PATCH v3 2/2] mem-hotplug: Reset node present pages when hot-adding a new pgdat.

2014-11-12 Thread Tang Chen
.. spanned 8388608 present 8388608 managed 0 When we online memory on node2: # cat /proc/zoneinfo .. Node 2, zone Movable .. spanned 8388608 present 16777216 managed 8388608 Signed-off-by: Tang Chen Reviewed-by: Yasuaki Ishimatsu Cc

[PATCH 0/2] Fix node meminfo corruption.

2014-11-12 Thread Tang Chen
emUsed: 0 kB .. This patch-set fixes them. Tang Chen (2): mem-hotplug: Reset node managed pages when hot-adding a new pgdat. mem-hotplug: Fix wrong check for zone->pageset initialization in online_pages(). include/linux/bootmem.h | 1 + include/linux/mm.h |

[PATCH v3 1/2] mem-hotplug: Reset node managed pages when hot-adding a new pgdat.

2014-11-12 Thread Tang Chen
_pages() to reset_all_zones_managed_pages() 2. Make reset_node_managed_pages() non-static 3. Call reset_node_managed_pages() in hotadd_new_pgdat() after pgdat is initialized Signed-off-by: Tang Chen Signed-off-by: Yasuaki Ishimatsu Cc: sta...@vger.kernel.org # 3.16+ --- include/linux/bootmem.h | 1 + mm/bootmem.c

<    4   5   6   7   8   9   10   11   12   13   >