[PATCH 01/21] acpi: Print Hot-Pluggable Field in SRAT.

2013-07-19 Thread Tang Chen
The Hot-Pluggable field in SRAT suggests if the memory could be hotplugged while the system is running. Print it as well when parsing SRAT will help users to know which memory is hotpluggable. Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- arch/x86/mm/srat.c | 11 +++ 1 files

[PATCH 21/21] doc, page_alloc, acpi, mem-hotplug: Add doc for movablecore=acpi boot option.

2013-07-19 Thread Tang Chen
Since we modify movablecore boot option to support "movablecore=acpi", this patch adds doc for it. Signed-off-by: Tang Chen --- Documentation/kernel-parameters.txt | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/Documentation/kernel-paramet

[PATCH 12/21] x86, acpi: Try to find if SRAT is overrided earlier.

2013-07-19 Thread Tang Chen
early_ioremap() can only map at most 256KB at one time. So we use a loop to map the whole initrd file, and map only 256KB one time. Signed-off-by: Tang Chen --- arch/x86/kernel/setup.c|9 ++ drivers/acpi/osl.c | 55 include

[PATCH 07/21] x86, acpi: Initialize ACPI root table list earlier.

2013-07-19 Thread Tang Chen
tep 1 earlier, right after memblock is ready. When memblock_x86_fill() is called to fulfill memblock.memory[], memblock is able to allocate memory. This patch introduces a new function acpi_root_table_init() to do step 1, and call this function right after memblock_x86_fill() is called. Signed-off-by:

[PATCH 18/21] x86, numa: Synchronize nid info in memblock.reserve with numa_meminfo.

2013-07-19 Thread Tang Chen
SRAT and fulfill nume_meminfo, synchronize the nid info to memblock.reserve[] immediately. Signed-off-by: Tang Chen Signed-off-by: Vasilis Liaskovitis --- arch/x86/mm/numa.c | 50 ++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a

[PATCH 16/21] x86, memblock, mem-hotplug: Free hotpluggable memory reserved by memblock.

2013-07-19 Thread Tang Chen
We reserved hotpluggable memory in memblock at early time. And when memory initialization is done, we have to free it to buddy system. This patch free memory reserved by memblock with flag MEMBLK_HOTPLUGGABLE. Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- include/linux/memblock.h

[PATCH 13/21] x86, acpi: Try to find SRAT in firmware earlier.

2013-07-19 Thread Tang Chen
SRAT. Signed-off-by: Tang Chen --- drivers/acpi/acpica/tbxface.c | 34 ++ drivers/acpi/osl.c| 24 include/acpi/acpixf.h |4 include/linux/acpi.h |4 mm/memory_hotplug.c |

[PATCH 11/21] x86: get pg_data_t's memory from other node

2013-07-19 Thread Tang Chen
fails. Otherwise, the system could failed to boot. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Lai Jiangshan Signed-off-by: Tang Chen Signed-off-by: Jiang Liu Reviewed-by: Wanpeng Li --- arch/x86/mm/numa.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/n

[PATCH 14/21] x86, acpi, numa: Reserve hotpluggable memory at early time.

2013-07-19 Thread Tang Chen
es in different nodes together. PXM is the Proximity num provided by SRAT, used to map nid. At such an early time, we don't have nid, so we reserve PXM in memblock to prevent merging of different nodes' memory. Signed-off-by: Tang Chen --- drivers/acpi

[PATCH 08/21] x86, acpi: Also initialize signature and length when parsing root table.

2013-07-19 Thread Tang Chen
time. Signed-off-by: Tang Chen --- drivers/acpi/acpica/tbutils.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 9d68ffc..37cc5e4 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b

[PATCH 17/21] page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using SRAT.

2013-07-19 Thread Tang Chen
to enable this functionality. For those who don't use memory hotplug or who don't want to lose their NUMA performance, just don't specify anything. The kernel will work as before. Suggested-by: Kamezawa Hiroyuki Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- arch/x86/kernel/setup.c

[PATCH 05/21] acpi: Introduce acpi_invalid_table() to check if a table is invalid.

2013-07-19 Thread Tang Chen
in the subsequent patches. Signed-off-by: Tang Chen --- drivers/acpi/osl.c | 82 1 files changed, 57 insertions(+), 25 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 91d9f54..4531920 100644 --- a/drivers/acpi/osl.c

[PATCH 09/21] x86: Make get_ramdisk_{image|size}() global.

2013-07-19 Thread Tang Chen
In the following patches, we need to call get_ramdisk_{image|size}() to get initrd file's address and size. So make these two functions global. Signed-off-by: Tang Chen --- arch/x86/include/asm/setup.h |3 +++ arch/x86/kernel/setup.c |4 ++-- 2 files changed, 5 insertions(

[PATCH 15/21] x86, acpi, numa: Don't reserve memory on nodes the kernel resides in.

2013-07-19 Thread Tang Chen
f the memory in that node is hotpluggable, we don't reserve it. Signed-off-by: Tang Chen --- drivers/acpi/osl.c | 40 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 02a39e2..dfbe6ba 10

[PATCH 10/21] earlycpio.c: Fix the confusing comment of find_cpio_data().

2013-07-19 Thread Tang Chen
)nptr - (long)data;/* data is the cpio file */ @offset is the offset of the next file, not the matching file itself. This is confused and may cause unnecessary waste of time to debug. So fix it. Signed-off-by: Tang Chen --- lib/earlycpio.c |7 --- 1 files changed, 4 insertions(+), 3

[PATCH 20/21] x86, numa, acpi, memory-hotplug: Make movablecore=acpi have higher priority.

2013-07-19 Thread Tang Chen
kernel will arrange hotpluggable memory in SRAT as ZONE_MOVABLE. And if users do this, all the other movablecore=nn@ss and kernelcore=nn@ss options should be ignored. For those who don't want this, just specify nothing. The kernel will act as before. Signed-off-by: Tang Chen Reviewed-by: Wanpe

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-24 Thread Tang Chen
On 06/24/2013 11:51 AM, Tang Chen wrote: On 06/22/2013 02:25 AM, Tejun Heo wrote: Hey, On Fri, Jun 21, 2013 at 05:19:48PM +0800, Tang Chen wrote: * As memblock allocator can relocate itself. There's no point in avoiding setting NUMA node while parsing and registering NUMA topology. Just

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-23 Thread Tang Chen
On 06/22/2013 02:25 AM, Tejun Heo wrote: Hey, On Fri, Jun 21, 2013 at 05:19:48PM +0800, Tang Chen wrote: * As memblock allocator can relocate itself. There's no point in avoiding setting NUMA node while parsing and registering NUMA topology. Just parse and register NUMA info and

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-21 Thread Tang Chen
Hi tj, On 06/20/2013 02:17 PM, Tejun Heo wrote: .. I was suggesting two separate things. * As memblock allocator can relocate itself. There's no point in avoiding setting NUMA node while parsing and registering NUMA topology. Just parse and register NUMA info and later tell it to

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-20 Thread Tang Chen
On 06/21/2013 02:10 PM, H. Peter Anvin wrote: On 06/20/2013 11:06 PM, Tang Chen wrote: Hi hpa, The build problem has been fixed by Yinghai. Where? I don't see anything that is obviously a fix in my inbox. Yinghai resent a new version to fix the problem. https://lkml.org/lkml/2013

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-20 Thread Tang Chen
On 06/21/2013 01:19 PM, H. Peter Anvin wrote: On 06/13/2013 06:02 AM, Tang Chen wrote: From: Yinghai Lu No offence, just rebase and resend the patches from Yinghai to help to push this functionality faster. Also improve the comments in the patches' log. So we need a new version of

Re: [PATCH 1/5] page_isolation: Fix a comment typo in test_pages_isolated()

2013-06-20 Thread Tang Chen
On 06/20/2013 09:17 PM, Zhang Yanfei wrote: On 06/20/2013 06:10 PM, Tang Chen wrote: pageblock_nr_page should be pageblock_nr_pages, and fist is a typo of first. Signed-off-by: Tang Chen --- mm/page_isolation.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH 1/5] page_isolation: Fix a comment typo in test_pages_isolated()

2013-06-20 Thread Tang Chen
pageblock_nr_page should be pageblock_nr_pages, and fist is a typo of first. Signed-off-by: Tang Chen --- mm/page_isolation.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 383bdbb..0cee10f 100644 --- a/mm

[PATCH 2/5] page_migrate: Fix wrong comment in address_space_operations->migratepage()

2013-06-20 Thread Tang Chen
There is no parameter "sync" in address_space_operations->migratepage(). It should be mograte_mode. And the comment is for MIGRATE_ASYNC. Signed-off-by: Tang Chen --- include/linux/fs.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/f

[PATCH 0/5] Fix some wrong comments.

2013-06-20 Thread Tang Chen
Fix some wrong comments found when reading code. Tang Chen (5): page_isolation: Fix a comment typo in test_pages_isolated() page_migrate: Fix wrong comment in address_space_operations->migratepage() aio: Fix wrong comment in aio_complete() memblock: Fix wrong comment

[PATCH 5/5] bootmem, numa: Fix a comment typo in register_page_bootmem_info_node()

2013-06-20 Thread Tang Chen
Signed-off-by: Tang Chen --- mm/memory_hotplug.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 1ad92b4..12ee2a0 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -220,13 +220,13 @@ void

[PATCH 4/5] memblock: Fix wrong comment in __next_free_mem_range()

2013-06-20 Thread Tang Chen
Remove one redundant "nid" in the comment. Signed-off-by: Tang Chen --- mm/memblock.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index c5fad93..a847bfe 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -566,7 +56

[PATCH 3/5] aio: Fix wrong comment in aio_complete()

2013-06-20 Thread Tang Chen
ctx->ctx_lock should be ctx->completion_lock. Signed-off-by: Tang Chen --- fs/aio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 2bbcacf..e4a01fa 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -623,7 +623,7 @@ void aio_complete(struct kiocb

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-19 Thread Tang Chen
Hi tj, Yinghai, On 06/19/2013 01:21 AM, Tejun Heo wrote: Hey, Tang. On Tue, Jun 18, 2013 at 01:47:16PM +0800, Tang Chen wrote: [approach] Parse SRAT earlier before memblock starts to work, because there is a bit in SRAT specifying which memory is hotpluggable. I'm not saying this is the

Re: [Part3 PATCH v2 0/4] Support hot-remove local pagetable pages.

2013-06-19 Thread Tang Chen
Hi Vasilis, Yinghai, On 06/19/2013 01:05 AM, Vasilis Liaskovitis wrote: .. This could be a design problem of part3: if we allow local pagetable memory to not be offlined but allow the offlining to return successfully, then hot-remove is going to succeed. But the direct mapped pagetable page

Re: [Part2 PATCH v4 08/15] x86, numa: Save nid when reserve memory into memblock.reserved[].

2013-06-18 Thread Tang Chen
Hi Vasilis, Thanks for reviewing. :) On 06/19/2013 12:57 AM, Vasilis Liaskovitis wrote: .. However, patches 21,22 of part1 and all part3 patches increase kernel usage of local node memory by putting pagetables local to those nodes. Are these pagetable pages accounted in part2's memblock_ke

Re: [Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-17 Thread Tang Chen
Hi tj, On 06/18/2013 10:03 AM, Tejun Heo wrote: .. So, can you please explain why you're doing the above? What are you trying to achieve in the end and why is this the best approach? This is all for memory hotplug, right? Yes, this is all for memory hotplug. [why] At early boot time (b

Re: [Part3 PATCH v2 0/4] Support hot-remove local pagetable pages.

2013-06-16 Thread Tang Chen
On 06/17/2013 09:58 AM, Jianguo Wu wrote: Hi Tang, On 2013/6/13 21:03, Tang Chen wrote: The following patch-set from Yinghai allocates pagetables to local nodes. v1: https://lkml.org/lkml/2013/3/7/642 v2: https://lkml.org/lkml/2013/3/10/47 v3: https://lkml.org/lkml/2013/4/4/639 v4: https

Re: [Part3 PATCH v2 2/4] mem-hotplug: Skip LOCAL_NODE_DATA pages in memory offline procedure.

2013-06-13 Thread Tang Chen
Hi Dave, On 06/14/2013 01:17 AM, Dave Hansen wrote: On 06/13/2013 06:03 AM, Tang Chen wrote: +static inline bool is_local_node_data(struct page *page) +{ + return (unsigned long)page->lru.next == LOCAL_NODE_DATA; +} page->lru is already in a union. Could you please just add

Re: [Part3 PATCH v2 1/4] bootmem, mem-hotplug: Register local pagetable pages with LOCAL_NODE_DATA when freeing bootmem.

2013-06-13 Thread Tang Chen
Hi Michal, Please see below. On 06/13/2013 10:16 PM, Michal Nazarewicz wrote: .. diff --git a/include/linux/memblock.h b/include/linux/memblock.h index a85ced9..8a38eef 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -131,6 +131,28 @@ void __next_free_mem_range_rev(u

Re: [Part1 PATCH v5 21/22] x86, mm: Make init_mem_mapping be able to be called several times

2013-06-13 Thread Tang Chen
On 06/14/2013 06:47 AM, Yinghai Lu wrote: On Thu, Jun 13, 2013 at 11:35 AM, Konrad Rzeszutek Wilk wrote: Tang Chen wrote: From: Yinghai Lu Prepare to put page table on local nodes. Move calling of init_mem_mapping() to early_initmem_init(). Rework alloc_low_pages to allocate page table

[Part2 PATCH v4 09/15] x86, numa, mem-hotplug: Mark nodes which the kernel resides in.

2013-06-13 Thread Tang Chen
e, we arrange them as un-hotpluggable. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c | 10 ++ include/linux/memblock.h |1 + mm/memblock.c| 20 3 files changed, 31 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x

[Part2 PATCH v4 01/15] x86: get pg_data_t's memory from other node

2013-06-13 Thread Tang Chen
fails. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Lai Jiangshan Signed-off-by: Tang Chen Signed-off-by: Jiang Liu Reviewed-by: Wanpeng Li --- 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 5adf803..be

[Part3 PATCH v2 4/4] mem-hotplug: Do not free LOCAL_NODE_DATA pages to buddy system in hot-remove procedure.

2013-06-13 Thread Tang Chen
Prevent freeing LOCAL_NODE_DATA pages in free_pagetable() instead of in put_page_bootmem(). Suggested-by: Wu Jianguo Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64

[Part2 PATCH v4 13/15] x86, memblock, mem-hotplug: Free hotpluggable memory reserved by memblock.

2013-06-13 Thread Tang Chen
We reserved hotpluggable memory in memblock. And when memory initialization is done, we have to free it to buddy system. This patch free memory reserved by memblock with flag MEMBLK_HOTPLUGGABLE. Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- include/linux/memblock.h |1 + mm

[Part3 PATCH v2 0/4] Support hot-remove local pagetable pages.

2013-06-13 Thread Tang Chen
h2: As suggested by Wu Jianguo, define a macro to check if a page cantains local node data. patch4: As suggested by Wu Jianguo, prevent freeing LOCAL_NODE_DATA pages in free_pagetable() instead of in put_page_bootmem(). Tang Chen (4): bootmem, mem-hotplug: Re

[Part2 PATCH v4 02/15] acpi: Print Hot-Pluggable Field in SRAT.

2013-06-13 Thread Tang Chen
The Hot-Pluggable field in SRAT suggests if the memory could be hotplugged while the system is running. Print it as well when parsing SRAT will help users to know which memory is hotpluggable. Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- arch/x86/mm/srat.c | 11 +++ 1 files

[Part3 PATCH v2 3/4] mem-hotplug: Skip LOCAL_NODE_DATA pages in memory online procedure.

2013-06-13 Thread Tang Chen
Pages marked as LOCAL_NODE_DATA are skipped when we do memory offline. So we have to skip them again when we do memory online. Signed-off-by: Tang Chen --- mm/memory_hotplug.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c

[Part1 PATCH v5 14/22] x86, mm, numa: Set memblock nid later

2013-06-13 Thread Tang Chen
numa_register_memblks to numa_check_memblks() after moving out code of setting memblock nid. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86

[Part2 PATCH v4 08/15] x86, numa: Save nid when reserve memory into memblock.reserved[].

2013-06-13 Thread Tang Chen
Since we introduced numa_sync_memblock_nid synchronize nid info in memblock.reserved[] and numa_meminfo, when numa_meminfo has been initialized, we need to save the nid into memblock.reserved[] when we reserve memory. Reported-by: Vasilis Liaskovitis Signed-off-by: Tang Chen --- include/linux

[Part2 PATCH v4 15/15] doc, page_alloc, acpi, mem-hotplug: Add doc for movablecore=acpi boot option.

2013-06-13 Thread Tang Chen
Since we modify movablecore boot option to support "movablecore=acpi", this patch adds doc for it. Signed-off-by: Tang Chen --- Documentation/kernel-parameters.txt |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/Documentation/kernel-paramet

[Part1 PATCH v5 20/22] x86, mm: Add comments for step_size shift

2013-06-13 Thread Tang Chen
From: Yinghai Lu As requested by hpa, add comments for why we choose 5 to be the step size shift. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/init.c | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/arch

[Part2 PATCH v4 05/15] x86, numa, acpi, memory-hotplug: Consider hotplug info when cleanup numa_meminfo.

2013-06-13 Thread Tang Chen
minfo() logic like this: Merge blocks with the same hotpluggable type on the same node, holes between which don't overlap with memory on other nodes. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86

[Part2 PATCH v4 00/15] Arrange hotpluggable memory in SRAT as ZONE_MOVABLE.

2013-06-13 Thread Tang Chen
Please refer to: v1: https://lkml.org/lkml/2013/3/7/642 v2: https://lkml.org/lkml/2013/3/10/47 v3: https://lkml.org/lkml/2013/4/4/639 v4: https://lkml.org/lkml/2013/4/11/829 And Yinghai's patch did the following things: 1) Parse SRAT early enough. 2)Allocate pagetable pages in local node. Ta

[Part2 PATCH v4 11/15] x86, numa, memblock: Introduce MEMBLK_LOCAL_NODE to mark and reserve node-life-cycle data.

2013-06-13 Thread Tang Chen
mapping pagetable pages, based on Yinghai's patch. Signed-off-by: Tang Chen --- arch/x86/mm/init.c | 16 include/linux/memblock.h |2 ++ mm/memblock.c|6 ++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/init.c b

[Part1 PATCH v5 12/22] x86, mm, numa: Move node_map_pfn_alignment() to x86

2013-06-13 Thread Tang Chen
From: Yinghai Lu Move node_map_pfn_alignment() to arch/x86/mm as there is no other user for it. Will update it to use numa_meminfo instead of memblock. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 50

[Part2 PATCH v4 04/15] x86, numa, acpi, memory-hotplug: Introduce hotplug info into struct numa_meminfo.

2013-06-13 Thread Tang Chen
s the following APIs' prototypes to support it: - numa_add_memblk() - numa_add_memblk_to() And the following callers: - numaq_register_node() - dummy_numa_init() - amd_numa_init() - acpi_numa_memory_affinity_init() in x86 Signed-off-by: Tang Chen --- arch/x86/include/asm/numa.h

[Part3 PATCH v2 2/4] mem-hotplug: Skip LOCAL_NODE_DATA pages in memory offline procedure.

2013-06-13 Thread Tang Chen
pages will be skipped. After the iteration of all page, the block will be set as offline, but the kernel can still access the pagetable pages. This is user transparent. v1 -> v2: As suggested by Wu Jianguo , define a macro to check if a page contains local node data. Signed-off-by: T

[Part2 PATCH v4 07/15] x86, numa: Synchronize nid info in memblock.reserve with numa_meminfo.

2013-06-13 Thread Tang Chen
to memblock.reserve[] immediately. Signed-off-by: Tang Chen Signed-off-by: Vasilis Liaskovitis --- arch/x86/mm/numa.c | 49 + 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 05e4443

[Part1 PATCH v5 11/22] x86, mm, numa: Call numa_meminfo_cover_memory() checking early

2013-06-13 Thread Tang Chen
we can move that numa_meminfo_cover_memory() early. Also we could change __absent_pages_in_range() to static and use absent_pages_in_range() directly. Later we will set memblock nid only once on successful path. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch

[Part1 PATCH v5 15/22] x86, mm, numa: Move node_possible_map setting later

2013-06-13 Thread Tang Chen
-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index e448b6f..da2ebab 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -536,12 +536,13 @@ static

[Part1 PATCH v5 13/22] x86, mm, numa: Use numa_meminfo to check node_map_pfn alignment

2013-06-13 Thread Tang Chen
From: Yinghai Lu We could use numa_meminfo directly instead of memblock nid in node_map_pfn_alignment(). So we could do setting memblock nid later and only do it once for successful path. -v2: according to tj, separate moving to another patch. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen

[Part1 PATCH v5 22/22] x86, mm, numa: Put pagetable on local node ram for 64bit

2013-06-13 Thread Tang Chen
page table will be on low range or local nodes. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Konrad Rzeszutek Wilk Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions

[Part1 PATCH v5 05/22] x86, ACPI: Increase acpi initrd override tables number limit

2013-06-13 Thread Tang Chen
comments about mapping table one by one during copying per tj. Signed-off-by: Yinghai Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Acked-by: Tejun Heo Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- drivers/acpi/osl.c | 26 +++--- 1

[Part1 PATCH v5 00/22] x86, ACPI, numa: Parse numa info earlier

2013-06-13 Thread Tang Chen
5d30f | Author: Tang Chen | Date: Fri Feb 22 16:33:44 2013 -0800 | |acpi, memory-hotplug: parse SRAT before memblock is ready It broke several things, like acpi override and fall back path etc. This patchset is clean implementation that will parse numa info early. 1. keep the acpi table i

[Part1 PATCH v5 04/22] x86, ACPI: Search buffer above 4GB in a second try for acpi initrd table override

2013-06-13 Thread Tang Chen
(), using memory above 4GB is OK. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: linux-a...@vger.kernel.org Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- drivers/acpi/osl.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dr

[Part1 PATCH v5 16/22] x86, mm, numa: Move numa emulation handling down.

2013-06-13 Thread Tang Chen
original numa_meminfo not changed. Signed-off-by: Yinghai Lu Cc: David Rientjes Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c |6 +++--- arch/x86/mm/numa_emulation.c |2 +- arch/x86/mm/numa_internal.h |2 ++ 3 files changed, 6 insertions(+), 4 deletions

[Part1 PATCH v5 02/22] x86, microcode: Use common get_ramdisk_{image|size}()

2013-06-13 Thread Tang Chen
is found by Tang Chen Signed-off-by: Yinghai Lu Cc: Fenghua Yu Acked-by: Tejun Heo Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/kernel/microcode_intel_early.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86

[Part1 PATCH v5 07/22] x86, ACPI: Store override acpi tables phys addr in cpio files info array

2013-06-13 Thread Tang Chen
_data which tj is not happy with. Signed-off-by: Yinghai Lu Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- drivers/acpi/osl.c | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --

[Part2 PATCH v4 06/15] memblock, numa: Introduce flag into memblock.

2013-06-13 Thread Tang Chen
. v3 -> v4: Define the flags with macro directly instead of bit shift. Suggested-by: Wen Congyang Suggested-by: Liu Jiang Signed-off-by: Tang Chen --- include/linux/memblock.h |4 +++ mm/memblock.c| 55 + 2 files changed, 44 insert

[Part1 PATCH v5 19/22] x86, mm: Parse numa info earlier

2013-06-13 Thread Tang Chen
early_initmem_init before init_mem_mapping() to prepare to use numa_info with it. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/kernel/setup.c | 24 ++-- 1 files changed, 10 insertions(+), 14 deletions

[Part3 PATCH v2 1/4] bootmem, mem-hotplug: Register local pagetable pages with LOCAL_NODE_DATA when freeing bootmem.

2013-06-13 Thread Tang Chen
ark this type of memory. Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c |2 + include/linux/memblock.h | 22 + include/linux/memory_hotplug.h | 13 - mm/memblock.c | 52 mm/memory_hotplu

[Part1 PATCH v5 01/22] x86: Change get_ramdisk_{image|size}() to global

2013-06-13 Thread Tang Chen
get_ramdisk_size() take a boot_params pointer, so that we can pass a physical address to code in head_32.S. Signed-off-by: Yinghai Lu Acked-by: Tejun Heo Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/include/asm/setup.h |3 +++ arch/x86/kernel/setup.c

[Part1 PATCH v5 10/22] x86, mm, numa: Move two functions calling on successful path later

2013-06-13 Thread Tang Chen
numa_init(), as it is only set in setup_node_data() at last in successful path. Signed-off-by: Yinghai Lu Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/mm/numa.c | 69 +-- 1 files changed, 39 insertions(+), 30 deletions(-) diff

[Part1 PATCH v5 21/22] x86, mm: Make init_mem_mapping be able to be called several times

2013-06-13 Thread Tang Chen
. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Konrad Rzeszutek Wilk Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/include/asm/pgtable.h |2 +- arch/x86/kernel/setup.c|1 - arch/x86/mm/init.c | 100

[Part1 PATCH v5 06/22] x86, ACPI: Split acpi_initrd_override() into find/copy two steps

2013-06-13 Thread Tang Chen
off-by: Yinghai Cc: Pekka Enberg Cc: Jacob Shin Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Acked-by: Tejun Heo Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/kernel/setup.c |6 +++--- drivers/acpi/osl.c | 18 +-

[Part1 PATCH v5 03/22] x86, ACPI, mm: Kill max_low_pfn_mapped

2013-06-13 Thread Tang Chen
ted-by: H. Peter Anvin Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Jacob Shin Cc: Pekka Enberg Cc: linux-a...@vger.kernel.org Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/include/asm/page_types.h |1 - arch/x86/kernel/setup.c

[Part1 PATCH v5 17/22] x86, ACPI, numa, ia64: split SLIT handling out

2013-06-13 Thread Tang Chen
. Signed-off-by: Yinghai Lu Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Cc: Tony Luck Cc: Fenghua Yu Cc: linux-i...@vger.kernel.org Tested-by: Tony Luck Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/ia64/kernel/setup.c|4 +++- arch/x86/include/asm/acpi.h |3 ++- arch

[Part1 PATCH v5 09/22] x86, ACPI: Find acpi tables in initrd early from head_32.S/head64.c

2013-06-13 Thread Tang Chen
acpi_initrd_override_copy(), to make sure we are using right address. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/include/asm/setup.h

[Part2 PATCH v4 14/15] x86, numa, acpi, memory-hotplug: Make movablecore=acpi have higher priority.

2013-06-13 Thread Tang Chen
rs specify "movablecore=acpi" in kernel commandline, the kernel will use SRAT to arrange ZONE_MOVABLE, and it has higher priority then original movablecore and kernelcore boot option. For those who don't want this, just specify nothing. Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li ---

[Part2 PATCH v4 12/15] x86, acpi, numa, mem-hotplug: Introduce MEMBLK_HOTPLUGGABLE to mark and reserve hotpluggable memory.

2013-06-13 Thread Tang Chen
freed to buddy when memory initialization is done. And also, ensure all the nodes which the kernel resides in are un-hotpluggable. This idea is from Wen Congyang and Jiang Liu . Suggested-by: Jiang Liu Suggested-by: Wen Congyang Signed-off-by: Tang Chen Reviewed-by: Vasilis Liaskovitis

[Part2 PATCH v4 10/15] x86, numa: Move memory_add_physaddr_to_nid() to CONFIG_NUMA.

2013-06-13 Thread Tang Chen
tplug. And also, it can be used by alloc_low_pages() to obtain nid of the allocated memory. So in x86, also use CONFIG_NUMA to protect it. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/n

[Part1 PATCH v5 08/22] x86, ACPI: Make acpi_initrd_override_find work with 32bit flat mode

2013-06-13 Thread Tang Chen
variables, so delay print during copying. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Cc: Rafael J. Wysocki Cc: linux-a...@vger.kernel.org Tested-by: Thomas Renninger Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch/x86/kernel/setup.c |2 +- drivers/ac

[Part1 PATCH v5 18/22] x86, mm, numa: Add early_initmem_init() stub

2013-06-13 Thread Tang Chen
From: Yinghai Lu Introduce early_initmem_init() to call early_x86_numa_init(), which will be used to parse numa info earlier. Later will call init_mem_mapping for all the nodes. Signed-off-by: Yinghai Lu Cc: Pekka Enberg Cc: Jacob Shin Reviewed-by: Tang Chen Tested-by: Tang Chen --- arch

[Part2 PATCH v4 03/15] page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using SRAT.

2013-06-13 Thread Tang Chen
t to lose their NUMA performance, just don't specify anything. The kernel will work as before. Suggested-by: Kamezawa Hiroyuki Signed-off-by: Tang Chen Reviewed-by: Wanpeng Li --- include/linux/memory_hotplug.h |3 +++ mm/page_alloc.c| 13 + 2 files cha

Re: [WiP]: aio support for migrating pages (Re: [PATCH V2 1/2] mm: hotplug: implement non-movable version of get_user_pages() called get_user_pages_non_movable())

2013-06-11 Thread Tang Chen
Hi Benjamin, Are you still working on this problem ? Thanks. :) On 05/21/2013 10:27 AM, Benjamin LaHaise wrote: On Tue, May 21, 2013 at 10:07:52AM +0800, Tang Chen wrote: I'm not saying using two callbacks before and after migration is better. I don't w

Re: [PATCH v3 07/13] x86, numa, mem-hotplug: Mark nodes which the kernel resides in.

2013-06-06 Thread Tang Chen
Hi Vasilis, On 06/03/2013 09:18 PM, Vasilis Liaskovitis wrote: .. In such an early time, I think we can only get nid from numa_meminfo. So as I said above, I'd like to fix this problem by making memblock has correct nid. And I read the patch below. I think if we get nid from numa_meminfo,

Re: [PATCH v4 03/22] x86, ACPI, mm: Kill max_low_pfn_mapped

2013-06-05 Thread Tang Chen
Hi yinghai, HPA, On 04/12/2013 08:55 AM, Yinghai Lu wrote: Now we have arch_pfn_mapped array, and max_low_pfn_mapped should not be used anymore. I'm rebasing this patch-set to the latest kernel, and improving the comment. But I didn't find any "arch_pfn_mapped array" in the kernel. Would you

Re: [PATCH v3 12/13] x86, numa, acpi, memory-hotplug: Make movablecore=acpi have higher priority.

2013-06-03 Thread Tang Chen
On 06/03/2013 10:59 AM, Wanpeng Li wrote: On Fri, May 24, 2013 at 05:29:21PM +0800, Tang Chen wrote: Arrange hotpluggable memory as ZONE_MOVABLE will cause NUMA performance decreased because the kernel cannot use movable memory. For users who don't use memory hotplug and who don'

Re: [PATCH v3 07/13] x86, numa, mem-hotplug: Mark nodes which the kernel resides in.

2013-06-03 Thread Tang Chen
Hi Vasilis, On 06/01/2013 12:24 AM, Vasilis Liaskovitis wrote: .. +void __init_memblock memblock_mark_kernel_nodes() +{ + int i, nid; + struct memblock_type *reserved =&memblock.reserved; + + for (i = 0; i< reserved->cnt; i++) + if (reserved->regions[i].flags

Re: [PATCH v4 00/22] x86, ACPI, numa: Parse numa info early

2013-06-02 Thread Tang Chen
Hi HPA, Would you please tell me if this patch-set has been merged into any tree or branch ? If not merged, I'll rebased it to the latest kernel and resend it again. Hope the rebasing will help to push this patch-set. Thanks. :) On 05/22/2013 01:18 PM, H. Peter Anvin wrote: Sorry, just have b

Re: [PATCH v3 06/13] memblock, numa: Introduce flag into memblock.

2013-06-02 Thread Tang Chen
Hi Li, On 06/03/2013 09:30 AM, Wanpeng Li wrote: On Fri, May 24, 2013 at 05:29:15PM +0800, Tang Chen wrote: There is no flag in memblock to discribe what type the memory is. s/discribe/describe OK. .. +#define MEMBLK_FLAGS_DEFAULT 0 + MEMBLK_FLAGS_DEFAULT is one of the memblock

[PATCH v3 07/13] x86, numa, mem-hotplug: Mark nodes which the kernel resides in.

2013-05-24 Thread Tang Chen
e, we arrange them as un-hotpluggable. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c |6 ++ include/linux/memblock.h |1 + mm/memblock.c| 20 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/n

[PATCH v3 01/13] x86: get pg_data_t's memory from other node

2013-05-24 Thread Tang Chen
. As noticed by Chen Gong , memblock_alloc_try_nid() will call panic() if it fails to allocate memory. So we don't need to check the return value. 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 |7

[PATCH v3 04/13] x86, numa, acpi, memory-hotplug: Introduce hotplug info into struct numa_meminfo.

2013-05-24 Thread Tang Chen
s the following APIs' prototypes to support it: - numa_add_memblk() - numa_add_memblk_to() And the following callers: - numaq_register_node() - dummy_numa_init() - amd_numa_init() - acpi_numa_memory_affinity_init() in x86 Signed-off-by: Tang Chen --- arch/x86/include/asm/numa.h

[PATCH 3/4] mem-hotplug: Skip LOCAL_NODE_DATA pages in memory online procedure.

2013-05-24 Thread Tang Chen
Pages marked as LOCAL_NODE_DATA are skipped when we do memory offline. So we have to skip them again when we do memory online. Signed-off-by: Tang Chen --- mm/memory_hotplug.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/mm/memory_hotplug.c b/mm

[PATCH v3 02/13] acpi: Print Hot-Pluggable Field in SRAT.

2013-05-24 Thread Tang Chen
The Hot-Pluggable field in SRAT suggests if the memory could be hotplugged while the system is running. Print it as well when parsing SRAT will help users to know which memory is hotpluggable. Signed-off-by: Tang Chen --- arch/x86/mm/srat.c |9 ++--- 1 files changed, 6 insertions(+), 3

[PATCH v3 13/13] doc, page_alloc, acpi, mem-hotplug: Add doc for movablecore=acpi boot option.

2013-05-24 Thread Tang Chen
Since we modify movablecore boot option to support "movablecore=acpi", this patch adds doc for it. Signed-off-by: Tang Chen --- Documentation/kernel-parameters.txt |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/Documentation/kernel-paramet

[PATCH 2/4] mem-hotplug: Skip LOCAL_NODE_DATA pages in memory offline procedure.

2013-05-24 Thread Tang Chen
pages will be skipped. After the iteration of all page, the block will be set as offline, but the kernel can still access the pagetable pages. This is user transparent. Signed-off-by: Tang Chen --- mm/page_alloc.c | 18 -- mm/page_isolation.c |6 ++ 2 files changed

[PATCH v3 08/13] x86, numa: Move memory_add_physaddr_to_nid() to CONFIG_NUMA.

2013-05-24 Thread Tang Chen
tplug. And also, it can be used by alloc_low_pages() to obtain nid of the allocated memory. So in x86, also use CONFIG_NUMA to protect it. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/n

[PATCH v3 00/13] Arrange hotpluggable memory in SRAT as ZONE_MOVABLE.

2013-05-24 Thread Tang Chen
i's patch did the following things: 1) Parse SRAT early enough. 2)Allocate pagetable pages in local node. Tang Chen (12): acpi: Print Hot-Pluggable Field in SRAT. page_alloc, mem-hotplug: Improve movablecore to {en|dis}able using SRAT. x86, numa, acpi, memory-hotplug: Introduce hotplug

[PATCH v3 05/13] x86, numa, acpi, memory-hotplug: Consider hotplug info when cleanup numa_meminfo.

2013-05-24 Thread Tang Chen
minfo() logic like this: Merge blocks with the same hotpluggable type on the same node, holes between which don't overlap with memory on other nodes. Signed-off-by: Tang Chen --- arch/x86/mm/numa.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86

[PATCH 1/4] bootmem, mem-hotplug: Register local pagetable pages with LOCAL_NODE_DATA when freeing bootmem.

2013-05-24 Thread Tang Chen
ark this type of memory. Signed-off-by: Tang Chen --- arch/x86/mm/init_64.c |2 + include/linux/memblock.h | 22 + include/linux/memory_hotplug.h | 13 - mm/memblock.c | 52 mm/memory_hotplu

[PATCH 0/4] Support hot-remove local pagetable pages.

2013-05-24 Thread Tang Chen
Do not free LOCA_NODE_DATAL pages to buddy system because they were skipped when in offline/online procedures. The memory block they reside in could have been offlined. Anyway, this problem should be fixed. Any better idea is welcome. Tang Chen (4): bootmem, mem-hotp

[PATCH 4/4] mem-hotplug: Do not free LOCAL_NODE_DATA pages to buddy system in hot-remove procedure.

2013-05-24 Thread Tang Chen
In memory hot-remove procedure, we free pagetable pages to buddy system. But for local pagetable pages, do not free them to buddy system because they were skipped in offline procedure. The memory block they reside in could have been offlined, and we won't offline it again. Signed-off-by:

<    1   2   3   4   5   6   7   8   9   10   >