Re: [RESEND PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-12 Thread Tang Chen
Hi Toshi, On 09/13/2013 03:22 AM, Toshi Kani wrote: .. + if (memblock_direction_bottom_up()) { + addr = memblock_alloc_bottom_up( + MEMBLOCK_ALLOC_ACCESSIBLE, +

[RESEND PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-12 Thread Tang Chen
o access initrd with virtual address. So relocate_initrd() must be done before acpi_initrd_override(). Change log v1 -> v2: 1. According to tj's suggestion, implemented a new function memblock_alloc_bottom_up() to allocate memory from bottom upwards, whihc can simplify the code. Tang

[RESEND PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function dma_contiguous_reserve(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- drivers/base

[RESEND PATCH v2 2/9] x86, memblock: Introduce memblock_alloc_bottom_up() to memblock.

2013-09-12 Thread Tang Chen
Heo Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h |2 ++ mm/memblock.c| 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index a7d3436

[RESEND PATCH v2 6/9] x86, acpi: Support allocate memory from bottom upwards in acpi_initrd_override().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function acpi_initrd_override(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- drivers/acpi

[RESEND PATCH v2 1/9] memblock: Introduce allocation direction to memblock.

2013-09-12 Thread Tang Chen
to low. So this patch introduces the allocation direct to memblock. It could be used to tell memblock to allocate memory from high to low or from low to high. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h | 22 ++ mm/memblock.c

[RESEND PATCH v2 5/9] x86: Support allocate memory from bottom upwards in relocate_initrd().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function relocate_initrd(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel

[RESEND PATCH v2 7/9] x86, acpi, crash, kdump: Do reserve_crashkernel() after SRAT is parsed.

2013-09-12 Thread Tang Chen
SRAT is parsed. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel/setup.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 7372be7..fa56a57 100644 --- a/arch/x86/kernel/setup.c +++ b/arch

[RESEND PATCH v2 4/9] x86: Support allocate memory from bottom upwards in setup_log_buf().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function setup_log_buf(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- kernel/printk/printk.c

[RESEND PATCH v2 9/9] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction.

2013-09-12 Thread Tang Chen
1. After memblock is ready, make memblock allocate memory from low address to high. 2. After SRAT is parsed, make memblock behave as default, allocate memory from high address to low. This behavior is controlled by movablenode boot option. Suggested-by: Kamezawa Hiroyuki Signed-off-by: Tang Chen

[RESEND PATCH v2 8/9] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-12 Thread Tang Chen
init_mem_mapping() is called before SRAT is parsed. And memblock will allocate memory for page tables. To prevent page tables being allocated within hotpluggable memory, we will allocate page tables from the end of kernel image to the higher memory. Signed-off-by: Tang Chen Reviewed-by: Zhang

Re: [PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-12 Thread Tang Chen
On 09/11/2013 08:51 PM, Tejun Heo wrote: On Wed, Sep 11, 2013 at 06:07:28PM +0800, Tang Chen wrote: This patch-set is based on tj's suggestion, and not fully tested. Just for review and discussion. And according to tj's suggestion, implemented a new function memblock_alloc_bottom_up

Re: [PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-12 Thread Tang Chen
On 09/11/2013 08:51 PM, Tejun Heo wrote: On Wed, Sep 11, 2013 at 06:07:28PM +0800, Tang Chen wrote: This patch-set is based on tj's suggestion, and not fully tested. Just for review and discussion. And according to tj's suggestion, implemented a new function memblock_alloc_bottom_up

[RESEND PATCH v2 9/9] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction.

2013-09-12 Thread Tang Chen
-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Wanpeng Li liw...@linux.vnet.ibm.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- Documentation/kernel-parameters.txt | 15 ++ arch/x86/kernel/setup.c | 36 +++ include

[RESEND PATCH v2 8/9] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-12 Thread Tang Chen
init_mem_mapping() is called before SRAT is parsed. And memblock will allocate memory for page tables. To prevent page tables being allocated within hotpluggable memory, we will allocate page tables from the end of kernel image to the higher memory. Signed-off-by: Tang Chen tangc

[RESEND PATCH v2 4/9] x86: Support allocate memory from bottom upwards in setup_log_buf().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function setup_log_buf(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[RESEND PATCH v2 7/9] x86, acpi, crash, kdump: Do reserve_crashkernel() after SRAT is parsed.

2013-09-12 Thread Tang Chen
SRAT is parsed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/kernel/setup.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 7372be7..fa56a57

[RESEND PATCH v2 5/9] x86: Support allocate memory from bottom upwards in relocate_initrd().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function relocate_initrd(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[RESEND PATCH v2 2/9] x86, memblock: Introduce memblock_alloc_bottom_up() to memblock.

2013-09-12 Thread Tang Chen
Heo t...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/memblock.h |2 ++ mm/memblock.c| 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git

[RESEND PATCH v2 1/9] memblock: Introduce allocation direction to memblock.

2013-09-12 Thread Tang Chen
to low. So this patch introduces the allocation direct to memblock. It could be used to tell memblock to allocate memory from high to low or from low to high. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/memblock.h | 22

[RESEND PATCH v2 6/9] x86, acpi: Support allocate memory from bottom upwards in acpi_initrd_override().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function acpi_initrd_override(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[RESEND PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-12 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function dma_contiguous_reserve(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang

[RESEND PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-12 Thread Tang Chen
address. So relocate_initrd() must be done before acpi_initrd_override(). Change log v1 - v2: 1. According to tj's suggestion, implemented a new function memblock_alloc_bottom_up() to allocate memory from bottom upwards, whihc can simplify the code. Tang Chen (9): memblock: Introduce

Re: [RESEND PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-12 Thread Tang Chen
Hi Toshi, On 09/13/2013 03:22 AM, Toshi Kani wrote: .. + if (memblock_direction_bottom_up()) { + addr = memblock_alloc_bottom_up( + MEMBLOCK_ALLOC_ACCESSIBLE, +

[Bug report] Warning when hot-add an ACPI0004 device.

2013-09-11 Thread Tang Chen
Hi Rafael, Toshi, When we hot-add an ACPI0004 device, we got the following warning: acpi ACPI0004:01: Attempt to re-insert The ACPI0004 device is a System Board in Fujitsu server, which has two numa nodes (processors and memory). It seems that we reserved the ACPI_NOTIFY_DEVICE_CHECK

[PATCH v2 5/9] x86: Support allocate memory from bottom upwards in relocate_initrd().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function relocate_initrd(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel

[PATCH v2 4/9] x86: Support allocate memory from bottom upwards in setup_log_buf().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function setup_log_buf(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- kernel/printk/printk.c

[PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-11 Thread Tang Chen
ed a new function memblock_alloc_bottom_up() to allocate memory from bottom upwards, whihc can simplify the code. Tang Chen (9): memblock: Introduce allocation direction to memblock. x86, memblock: Introduce memblock_alloc_bottom_up() to memblock. x86, dma: Support allocate memory from b

[PATCH v2 1/9] memblock: Introduce allocation direction to memblock.

2013-09-11 Thread Tang Chen
to low. So this patch introduces the allocation direct to memblock. It could be used to tell memblock to allocate memory from high to low or from low to high. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h | 22 ++ mm/memblock.c

[PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function dma_contiguous_reserve(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- drivers/base

[PATCH v2 2/9] x86, memblock: Introduce memblock_alloc_bottom_up() to memblock.

2013-09-11 Thread Tang Chen
Heo Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h |2 ++ mm/memblock.c| 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index fbf6b6d

[PATCH v2 9/9] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction.

2013-09-11 Thread Tang Chen
1. After memblock is ready, make memblock allocate memory from low address to high. 2. After SRAT is parsed, make memblock behave as default, allocate memory from high address to low. This behavior is controlled by movablenode boot option. Suggested-by: Kamezawa Hiroyuki Signed-off-by: Tang Chen

[PATCH v2 8/9] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-11 Thread Tang Chen
init_mem_mapping() is called before SRAT is parsed. And memblock will allocate memory for page tables. To prevent page tables being allocated within hotpluggable memory, we will allocate page tables from the end of kernel image to the higher memory. Signed-off-by: Tang Chen Reviewed-by: Zhang

[PATCH v2 6/9] x86, acpi: Support allocate memory from bottom upwards in acpi_initrd_override().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function acpi_initrd_override(), we add the above logic. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- drivers/acpi

[PATCH v2 7/9] x86, acpi, crash, kdump: Do reserve_crashkernel() after SRAT is parsed.

2013-09-11 Thread Tang Chen
SRAT is parsed. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel/setup.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 7372be7..fa56a57 100644 --- a/arch/x86/kernel/setup.c +++ b/arch

[PATCH v2 6/9] x86, acpi: Support allocate memory from bottom upwards in acpi_initrd_override().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function acpi_initrd_override(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[PATCH v2 7/9] x86, acpi, crash, kdump: Do reserve_crashkernel() after SRAT is parsed.

2013-09-11 Thread Tang Chen
SRAT is parsed. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- arch/x86/kernel/setup.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 7372be7..fa56a57

[PATCH v2 8/9] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-11 Thread Tang Chen
init_mem_mapping() is called before SRAT is parsed. And memblock will allocate memory for page tables. To prevent page tables being allocated within hotpluggable memory, we will allocate page tables from the end of kernel image to the higher memory. Signed-off-by: Tang Chen tangc

[PATCH v2 2/9] x86, memblock: Introduce memblock_alloc_bottom_up() to memblock.

2013-09-11 Thread Tang Chen
Heo t...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/memblock.h |2 ++ mm/memblock.c| 38 ++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git

[PATCH v2 9/9] mem-hotplug: Introduce movablenode boot option to control memblock allocation direction.

2013-09-11 Thread Tang Chen
-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Wanpeng Li liw...@linux.vnet.ibm.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- Documentation/kernel-parameters.txt | 15 ++ arch/x86/kernel/setup.c | 36 +++ include

[PATCH v2 1/9] memblock: Introduce allocation direction to memblock.

2013-09-11 Thread Tang Chen
to low. So this patch introduces the allocation direct to memblock. It could be used to tell memblock to allocate memory from high to low or from low to high. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei zhangyan...@cn.fujitsu.com --- include/linux/memblock.h | 22

[PATCH v2 4/9] x86: Support allocate memory from bottom upwards in setup_log_buf().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function setup_log_buf(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[PATCH v2 0/9] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-11 Thread Tang Chen
memory from bottom upwards, whihc can simplify the code. Tang Chen (9): memblock: Introduce allocation direction to memblock. x86, memblock: Introduce memblock_alloc_bottom_up() to memblock. x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve(). x86: Support

[PATCH v2 3/9] x86, dma: Support allocate memory from bottom upwards in dma_contiguous_reserve().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function dma_contiguous_reserve(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang

[PATCH v2 5/9] x86: Support allocate memory from bottom upwards in relocate_initrd().

2013-09-11 Thread Tang Chen
During early boot, if the bottom up mode is set, just try allocating bottom up from the end of kernel image, and if that fails, do normal top down allocation. So in function relocate_initrd(), we add the above logic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Zhang Yanfei

[Bug report] Warning when hot-add an ACPI0004 device.

2013-09-11 Thread Tang Chen
Hi Rafael, Toshi, When we hot-add an ACPI0004 device, we got the following warning: acpi ACPI0004:01: Attempt to re-insert The ACPI0004 device is a System Board in Fujitsu server, which has two numa nodes (processors and memory). It seems that we reserved the ACPI_NOTIFY_DEVICE_CHECK

Re: [PATCH 10/11] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-05 Thread Tang Chen
Hi Wanpeng, On 09/06/2013 10:16 AM, Wanpeng Li wrote: .. +#ifdef CONFIG_MOVABLE_NODE + unsigned long kernel_end; + + if (movablenode_enable_srat&& + memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH) { I think memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH

Re: [PATCH 10/11] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-05 Thread Tang Chen
Hi Wanpeng, Thank you for reviewing. See below, please. On 09/05/2013 09:30 PM, Wanpeng Li wrote: .. +#ifdef CONFIG_MOVABLE_NODE + unsigned long kernel_end; + + if (movablenode_enable_srat&& + memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH) { I think

Re: [PATCH 05/11] memblock: Introduce allocation order to memblock.

2013-09-05 Thread Tang Chen
Hi Wanpeng, On 09/05/2013 05:16 PM, Wanpeng Li wrote: .. +/* Allocation order. */ How about replace "Allocation order" by "Allocation sequence". The "Allocation order" is ambiguity. Yes, order is ambiguity. But as tj suggested, I think maybe "direction" is better. Thanks. :) -- To

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-05 Thread Tang Chen
Hi tj, On 09/05/2013 03:22 AM, Tejun Heo wrote: .. I'm expectedly happier with this approach but some overall review points. * I think patch splitting went a bit too far. e.g. it doesn't make much sense or helps anything to split "introduction of a param" from "the param doing

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-05 Thread Tang Chen
Hi tj, On 09/05/2013 03:22 AM, Tejun Heo wrote: .. I'm expectedly happier with this approach but some overall review points. * I think patch splitting went a bit too far. e.g. it doesn't make much sense or helps anything to split introduction of a param from the param doing

Re: [PATCH 05/11] memblock: Introduce allocation order to memblock.

2013-09-05 Thread Tang Chen
Hi Wanpeng, On 09/05/2013 05:16 PM, Wanpeng Li wrote: .. +/* Allocation order. */ How about replace Allocation order by Allocation sequence. The Allocation order is ambiguity. Yes, order is ambiguity. But as tj suggested, I think maybe direction is better. Thanks. :) -- To

Re: [PATCH 10/11] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-05 Thread Tang Chen
Hi Wanpeng, Thank you for reviewing. See below, please. On 09/05/2013 09:30 PM, Wanpeng Li wrote: .. +#ifdef CONFIG_MOVABLE_NODE + unsigned long kernel_end; + + if (movablenode_enable_srat + memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH) { I think

Re: [PATCH 10/11] x86, mem-hotplug: Support initialize page tables from low to high.

2013-09-05 Thread Tang Chen
Hi Wanpeng, On 09/06/2013 10:16 AM, Wanpeng Li wrote: .. +#ifdef CONFIG_MOVABLE_NODE + unsigned long kernel_end; + + if (movablenode_enable_srat + memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH) { I think memblock.current_order == MEMBLOCK_ORDER_LOW_TO_HIGH is

Re: [PATCH v2 0/4] acpi: Fix and cleanup in acpi.

2013-09-04 Thread Tang Chen
On 09/05/2013 07:50 AM, Rafael J. Wysocki wrote: On Tuesday, September 03, 2013 04:45:37 PM Tang Chen wrote: This patch-set fix the following problems: 1. Kill useless function save_add_info() which will block us from using numa when MEMORY_HOTPLUG is not configured. 2. acpi_table_parse

Re: [PATCH v2 0/4] acpi: Fix and cleanup in acpi.

2013-09-04 Thread Tang Chen
On 09/05/2013 07:50 AM, Rafael J. Wysocki wrote: On Tuesday, September 03, 2013 04:45:37 PM Tang Chen wrote: This patch-set fix the following problems: 1. Kill useless function save_add_info() which will block us from using numa when MEMORY_HOTPLUG is not configured. 2. acpi_table_parse

Re: [PATCH 07/11] x86, memblock: Set lowest limit for memblock_alloc_base_nid().

2013-09-03 Thread Tang Chen
On 09/04/2013 08:37 AM, Toshi Kani wrote: On Tue, 2013-08-27 at 17:37 +0800, Tang Chen wrote: memblock_alloc_base_nid() is a common API of memblock. And it calls memblock_find_in_range_node() with %start = 0, which means it has no limit for the lowest address by default

Re: [PATCH 06/11] memblock: Improve memblock to support allocation from lower address.

2013-09-03 Thread Tang Chen
On 09/04/2013 08:24 AM, Toshi Kani wrote: .. +phys_addr_t __init_memblock +__memblock_find_range(phys_addr_t start, phys_addr_t end, + phys_addr_t size, phys_addr_t align, int nid) This func should be static as it must be an internal func. .. +phys_addr_t

[PATCH v2 3/4] acpi: Check if @id is NULL in acpi_table_parse()

2013-09-03 Thread Tang Chen
strncmp() does not check if the params are NULL. In acpi_table_parse(), if @id is NULL, the kernel will panic. Signed-off-by: Tang Chen Acked-by: Toshi Kani --- drivers/acpi/tables.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi

[PATCH v2 1/4] acpi, numa, mem_hotplug: Kill save_add_info().

2013-09-03 Thread Tang Chen
() is added by commit 71efa8fdc55e70ec6687c897a30759f0a2c2ad7e in 2006. And now it is useless. So this patch kill save_add_info() and the nonsense checking. Signed-off-by: Tang Chen Acked-by: Toshi Kani --- arch/x86/mm/srat.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/arch/x86

[PATCH v2 2/4] acpi cleanup: Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c

2013-09-03 Thread Tang Chen
Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c. As suggested by Joe Perches , use pr_fmt(fmt) to simplify the output format. Signed-off-by: Tang Chen Acked-by: Toshi Kani --- arch/x86/mm/srat.c | 32 +--- 1 files changed, 17 insertions(+), 15

[PATCH v2 4/4] acpi: Return -ENOENT in acpi_table_parse() and fix wrong comment.

2013-09-03 Thread Tang Chen
change the stub in linux/acpi.h to return -ENODEV. Signed-off-by: Tang Chen --- drivers/acpi/tables.c |7 --- include/linux/acpi.h |2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 5a5263b..e6de24f 100644

[PATCH v2 0/4] acpi: Fix and cleanup in acpi.

2013-09-03 Thread Tang Chen
nfo|err} patches into one. 4. Remove on of the patch that has been merged by Rafael. Tang Chen (4): acpi, numa, mem_hotplug: Kill save_add_info(). acpi cleanup: Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c acpi: Check if @id is NULL in acpi_table_parse() acpi: Ret

Re: [PATCH 06/11] memblock: Improve memblock to support allocation from lower address.

2013-09-03 Thread Tang Chen
On 09/04/2013 08:24 AM, Toshi Kani wrote: .. +phys_addr_t __init_memblock +__memblock_find_range(phys_addr_t start, phys_addr_t end, + phys_addr_t size, phys_addr_t align, int nid) This func should be static as it must be an internal func. .. +phys_addr_t

Re: [PATCH 07/11] x86, memblock: Set lowest limit for memblock_alloc_base_nid().

2013-09-03 Thread Tang Chen
On 09/04/2013 08:37 AM, Toshi Kani wrote: On Tue, 2013-08-27 at 17:37 +0800, Tang Chen wrote: memblock_alloc_base_nid() is a common API of memblock. And it calls memblock_find_in_range_node() with %start = 0, which means it has no limit for the lowest address by default

[PATCH v2 4/4] acpi: Return -ENOENT in acpi_table_parse() and fix wrong comment.

2013-09-03 Thread Tang Chen
toshi.k...@hp.com, also change the stub in linux/acpi.h to return -ENODEV. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- drivers/acpi/tables.c |7 --- include/linux/acpi.h |2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/tables.c b/drivers/acpi

[PATCH v2 0/4] acpi: Fix and cleanup in acpi.

2013-09-03 Thread Tang Chen
...@hp.com 3. Merge the two pr_{info|err} patches into one. 4. Remove on of the patch that has been merged by Rafael. Tang Chen (4): acpi, numa, mem_hotplug: Kill save_add_info(). acpi cleanup: Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c acpi: Check if @id is NULL

[PATCH v2 3/4] acpi: Check if @id is NULL in acpi_table_parse()

2013-09-03 Thread Tang Chen
strncmp() does not check if the params are NULL. In acpi_table_parse(), if @id is NULL, the kernel will panic. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Acked-by: Toshi Kani toshi.k...@hp.com --- drivers/acpi/tables.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH v2 1/4] acpi, numa, mem_hotplug: Kill save_add_info().

2013-09-03 Thread Tang Chen
71efa8fdc55e70ec6687c897a30759f0a2c2ad7e in 2006. And now it is useless. So this patch kill save_add_info() and the nonsense checking. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Acked-by: Toshi Kani toshi.k...@hp.com --- arch/x86/mm/srat.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git

[PATCH v2 2/4] acpi cleanup: Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c

2013-09-03 Thread Tang Chen
Use pr_{info|err}() instead of printk() in arch/x86/mm/srat.c. As suggested by Joe Perches j...@perches.com, use pr_fmt(fmt) to simplify the output format. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Acked-by: Toshi Kani toshi.k...@hp.com --- arch/x86/mm/srat.c | 32

Re: [PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
On 09/03/2013 10:48 AM, Yinghai Lu wrote: On Mon, Sep 2, 2013 at 6:06 PM, Tang Chen wrote: Hi Yinghai, On 09/03/2013 02:41 AM, Yinghai Lu wrote: How about change the "for (from low to high)" in init_range_memory_mapping() to "for_rev(from high to low)" ? Then we can u

Re: [PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
Hi Yinghai, On 09/03/2013 02:41 AM, Yinghai Lu wrote: .. Nak, you can not move that. min_pfn_mapped should not be updated before init_range_memory_mapping is returned. as it need to refer old min_pfn_mapped. and init_range_memory_mapping still init mapping from low to high locally.

[PATCH RESEND 0/3] x86, ACPI, mm: Cleanup for {max|low|max_low}_pfn_mapped.

2013-09-02 Thread Tang Chen
This patch-set does the following: 1. Kill max_low_pfn_mapped as it is useless. This patch is from Yinghai. 2. Update min_pfn_mapped and max_pfn_mapped together in add_pfn_range_mapped(). 3. Move definition of max_pfn_mapped tp init.c together with min_pfn_mapped. Tang Chen (2): x86, mm

[PATCH RESEND 3/3] x86, mm: Move max_pfn_mapped definition to init.c.

2013-09-02 Thread Tang Chen
min_pfn_mapped is defined in init.c, we can also define max_pfn_mapped here. Signed-off-by: Tang Chen --- arch/x86/kernel/setup.c |8 arch/x86/mm/init.c |9 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel

[PATCH RESEND 1/3] x86, ACPI, mm: Kill max_low_pfn_mapped.

2013-09-02 Thread Tang Chen
change to use 1U<<(32_PAGE_SHIFT) with it, aka under 4G. -v2: Leave alone max_low_pfn_mapped in i915 code according to tj. Suggested-by: H. Peter Anvin Signed-off-by: Yinghai Lu Signed-off-by: Tang Chen Cc: "Rafael J. Wysocki" Cc: Jacob Shin Cc: Pekka Enberg Cc: linux-a...@

[PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
We can also update min_pfn_mapped in add_pfn_range_mapped(). Signed-off-by: Tang Chen --- arch/x86/mm/init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 5b2eaca..a97749f 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init

[PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
min_pfn_mapped in add_pfn_range_mapped(). Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/mm/init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 5b2eaca..a97749f 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86

[PATCH RESEND 0/3] x86, ACPI, mm: Cleanup for {max|low|max_low}_pfn_mapped.

2013-09-02 Thread Tang Chen
This patch-set does the following: 1. Kill max_low_pfn_mapped as it is useless. This patch is from Yinghai. 2. Update min_pfn_mapped and max_pfn_mapped together in add_pfn_range_mapped(). 3. Move definition of max_pfn_mapped tp init.c together with min_pfn_mapped. Tang Chen (2): x86, mm

[PATCH RESEND 3/3] x86, mm: Move max_pfn_mapped definition to init.c.

2013-09-02 Thread Tang Chen
min_pfn_mapped is defined in init.c, we can also define max_pfn_mapped here. Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kernel/setup.c |8 arch/x86/mm/init.c |9 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel

[PATCH RESEND 1/3] x86, ACPI, mm: Kill max_low_pfn_mapped.

2013-09-02 Thread Tang Chen
(). We could change to use 1U(32_PAGE_SHIFT) with it, aka under 4G. -v2: Leave alone max_low_pfn_mapped in i915 code according to tj. Suggested-by: H. Peter Anvin h...@zytor.com Signed-off-by: Yinghai Lu ying...@kernel.org Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Cc: Rafael J. Wysocki r

Re: [PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
Hi Yinghai, On 09/03/2013 02:41 AM, Yinghai Lu wrote: .. Nak, you can not move that. min_pfn_mapped should not be updated before init_range_memory_mapping is returned. as it need to refer old min_pfn_mapped. and init_range_memory_mapping still init mapping from low to high locally.

Re: [PATCH RESEND 2/3] x86, mm: Update min_pfn_mapped in add_pfn_range_mapped().

2013-09-02 Thread Tang Chen
On 09/03/2013 10:48 AM, Yinghai Lu wrote: On Mon, Sep 2, 2013 at 6:06 PM, Tang Chentangc...@cn.fujitsu.com wrote: Hi Yinghai, On 09/03/2013 02:41 AM, Yinghai Lu wrote: How about change the for (from low to high) in init_range_memory_mapping() to for_rev(from high to low) ? Then we can

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-01 Thread Tang Chen
Hi guys, Any comment to this patch-set ? And shall agree on using this solution suggested by Tejun ? Thanks. On 08/27/2013 05:37 PM, Tang Chen wrote: This patch-set is based on tj's suggestion, and not fully tested. Just for review and discussion. [Problem] The current Linux cannot

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-09-01 Thread Tang Chen
Hi guys, Any comment to this patch-set ? And shall agree on using this solution suggested by Tejun ? Thanks. On 08/27/2013 05:37 PM, Tang Chen wrote: This patch-set is based on tj's suggestion, and not fully tested. Just for review and discussion. [Problem] The current Linux cannot

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
Hi Wanpeng, On 08/29/2013 09:36 AM, Wanpeng Li wrote: .. Hi tj, Sorry for the trouble. Please refer to the following branch: https://github.com/imtangchen/linux.git movablenode-boot-option Could you post your testcase? So I can test it on x86 and powerpc machines. Sure. Some simple

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
On 08/28/2013 11:19 PM, Tejun Heo wrote: .. Doesn't apply to -master, -next or tip. Again, can you please include which tree and git commit the patches are against in the patch description? How is one supposed to know on top of which tree you're working? It is in your benefit to make

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
Hi Wanpeng On 08/28/2013 04:03 PM, Wanpeng Li wrote: Hi Tang, .. [About this patch-set] So this patch-set does the following: 1. Make memblock be able to allocate memory from low address to high address. I want to know if there is fragmentation degree difference here? Before this

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
Hi Wanpeng On 08/28/2013 04:03 PM, Wanpeng Li wrote: Hi Tang, .. [About this patch-set] So this patch-set does the following: 1. Make memblock be able to allocate memory from low address to high address. I want to know if there is fragmentation degree difference here? Before this

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
On 08/28/2013 11:19 PM, Tejun Heo wrote: .. Doesn't apply to -master, -next or tip. Again, can you please include which tree and git commit the patches are against in the patch description? How is one supposed to know on top of which tree you're working? It is in your benefit to make

Re: [PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-28 Thread Tang Chen
Hi Wanpeng, On 08/29/2013 09:36 AM, Wanpeng Li wrote: .. Hi tj, Sorry for the trouble. Please refer to the following branch: https://github.com/imtangchen/linux.git movablenode-boot-option Could you post your testcase? So I can test it on x86 and powerpc machines. Sure. Some simple

[PATCH 02/11] memblock: Rename memblock_set_current_limit() to memblock_set_current_limit_high().

2013-08-27 Thread Tang Chen
Since we renamed memblock.current_limit to current_limit_high, we also rename memblock_set_current_limit() to memblock_set_current_limit_high(). Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/arm/mm/mmu.c |2 +- arch/arm64/mm/mmu.c |4 ++-- arch

[PATCH 01/11] memblock: Rename current_limit to current_limit_high in memblock.

2013-08-27 Thread Tang Chen
memblock.current_limit specifies the highest address that memblock could allocate. The next coming patches will introduce a lowest limit to memblock, so rename it to current_limit_high. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h |2 +- mm/memblock.c

[PATCH 00/11] x86, memblock: Allocate memory near kernel image before SRAT parsed.

2013-08-27 Thread Tang Chen
initrd_override() needs to access initrd with virtual address. So relocate_initrd() must be done before acpi_initrd_override(). Tang Chen (11): memblock: Rename current_limit to current_limit_high in memblock. memblock: Rename memblock_set_current_limit() to memblock_set_current_li

[PATCH 07/11] x86, memblock: Set lowest limit for memblock_alloc_base_nid().

2013-08-27 Thread Tang Chen
if the allocation order is from low to high, they will allocate memory from the lowest limit to higher memory. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- mm/memblock.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 961d4a5..be8c4d1

[PATCH 06/11] memblock: Improve memblock to support allocation from lower address.

2013-08-27 Thread Tang Chen
This patch modifies the memblock_find_in_range_node() to support two different allocation orders. After this patch, memblock will check memblock.current_order, and decide in which order to allocate memory. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- mm/memblock.c | 90

[PATCH 11/11] x86, mem_hotplug: Allocate memory near kernel image before SRAT is parsed.

2013-08-27 Thread Tang Chen
, make memblock behave as default, allocate memory from high address to low, and reset the lowest limit to 0. This behavior is controlled by movablenode boot option. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- arch/x86/kernel/setup.c | 37 + 1

[PATCH 09/11] mem-hotplug: Introduce movablenode boot option to {en|dis}able using SRAT.

2013-08-27 Thread Tang Chen
ctionality. 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 Reviewed-by: Zhang Yanfei --- Documentat

[PATCH 08/11] x86, acpi, memblock: Use __memblock_alloc_base() in acpi_initrd_override()

2013-08-27 Thread Tang Chen
it_low. And __memblock_alloc_base() calls memblock_alloc_base_nid(). __memblock_alloc_base() |->memblock_alloc_base_nid() |->memblock_find_in_range_node(MEMBLOCK_ALLOC_ACCESSIBLE, ...) So use __memblock_alloc_base() to allocate memory in acpi_initrd_override(). Signed-off-by: Tang Chen Reviewed-by:

[PATCH 10/11] x86, mem-hotplug: Support initialize page tables from low to high.

2013-08-27 Thread Tang Chen
is controled by movablenode boot option. Since the default behavior of page tables initialization procedure is allocate page tables from top of the memory downwards, if users don't specify movablenode boot option, the kernel will behave as before. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei

[PATCH 04/11] memblock: Introduce memblock_set_current_limit_low() to set lower limit of memblock.

2013-08-27 Thread Tang Chen
Corresponding to memblock_set_current_limit_high(), we introduce memblock_set_current_limit_low() to set the lowest limit for memblock. Signed-off-by: Tang Chen Reviewed-by: Zhang Yanfei --- include/linux/memblock.h |9 - mm/memblock.c|5 + 2 files changed, 13

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