[tip:x86/apic] x86/numa: Online memory-less nodes at boot time

2016-09-22 Thread tip-bot for Tang Chen
Commit-ID: 2532fc318db0e1fe68e01407ee27634c76916e44 Gitweb: http://git.kernel.org/tip/2532fc318db0e1fe68e01407ee27634c76916e44 Author: Tang Chen <tangc...@cn.fujitsu.com> AuthorDate: Thu, 25 Aug 2016 16:35:14 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate:

[PATCH v5 RESEND 3/5] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-01-24 Thread Tang Chen
istent. cpuid <-> apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid <-> apicid mapping when registering local apic. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed

[PATCH v5 RESEND 1/5] x86, memhp, numa: Online memory-less nodes at boot time.

2016-01-24 Thread Tang Chen
For now, x86 does not support memory-less node. A node without memory will not be onlined, and the cpus on it will be mapped to the other online nodes with memory in init_cpu_to_node(). The reason of doing this is to ensure each cpu has mapped to a node with memory, so that it will be able to

[PATCH v5 RESEND 5/5] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-01-24 Thread Tang Chen
g. This patch finishes step 4. This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu

[PATCH v5 RESEND 4/5] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-01-24 Thread Tang Chen
at caller is able to control if disabled processors are ignored. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++---

[PATCH v5 RESEND 0/5] Make cpuid <-> nodeid mapping persistent

2016-01-24 Thread Tang Chen
us at boot time. x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping. x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid. x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting. Tang

[PATCH v5 RESEND 2/5] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-01-24 Thread Tang Chen
n-presnet or disabled cpus' apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch fin

Re: [PATCH v5 RESEND 0/5] Make cpuid <-> nodeid mapping persistent

2016-01-24 Thread Tang Chen
Hi Rafael, Len, Would you please help to review the ACPI part of this patch-set ? Thanks. On 01/25/2016 02:08 PM, Tang Chen wrote: [Problem] cpuid <-> nodeid mapping is firstly established at boot time. And workqueue caches the mapping in wq_numa_possible_cpumask in wq_numa_init() a

Re: [PATCH v5 0/5] Make cpuid <-> nodeid mapping persistent.

2016-01-24 Thread Tang Chen
Hi tj, I have resent the patch-set and to Rafael and Len. Thanks. On 01/22/2016 05:26 AM, Tejun Heo wrote: Hello, Most changes being in ACPI, I think it probably would be a good idea to cc Rafael and Len Brown. Thanks.

[PATCH v5 4/5] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-01-20 Thread Tang Chen
at caller is able to control if disabled processors are ignored. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++---

[PATCH v5 5/5] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-01-20 Thread Tang Chen
g. This patch finishes step 4. This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu

[PATCH v5 0/5] Make cpuid <-> nodeid mapping persistent.

2016-01-20 Thread Tang Chen
us at boot time. x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping. x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid. x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting. Tang

[PATCH v5 1/5] x86, memhp, numa: Online memory-less nodes at boot time.

2016-01-20 Thread Tang Chen
For now, x86 does not support memory-less node. A node without memory will not be onlined, and the cpus on it will be mapped to the other online nodes with memory in init_cpu_to_node(). The reason of doing this is to ensure each cpu has mapped to a node with memory, so that it will be able to

[PATCH v5 2/5] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-01-20 Thread Tang Chen
n-presnet or disabled cpus' apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch fin

[PATCH v5 3/5] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-01-20 Thread Tang Chen
istent. cpuid <-> apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid <-> apicid mapping when registering local apic. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed

[PATCH 1/5] x86, memhp, numa: Online memory-less nodes at boot time.

2016-01-06 Thread Tang Chen
local node, it will automatically fall back to the proper zones in the zonelists. Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/mm/numa.c | 27 +-- include/linux/mmzone.h | 1 + mm/page_alloc.c| 2 +- 3 files changed, 15 insertions(+),

[PATCH 3/5] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-01-06 Thread Tang Chen
y: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 6 ++--- arch/x86/kernel/apic/apic.c | 61 --- 3 files changed, 61 insertions(+), 7

[PATCH 4/5] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-01-06 Thread Tang Chen
abled processors and returns -ENODEV. After this patch, a new parameter will be added to MADT APIs so that caller is able to control if disabled processors are ignored. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com&

[PATCH 2/5] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-01-06 Thread Tang Chen
n-presnet or disabled cpus' apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch fin

[PATCH 5/5] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-01-06 Thread Tang Chen
com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/ia64/kernel/acpi.c | 2 +- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/bus.c| 3 ++ drivers/acpi/processor_core.c | 65 +++ include/linux/acpi.h | 2

[PATCH v4 0/5] Make cpuid <-> nodeid mapping persistent.

2016-01-06 Thread Tang Chen
t cpuid <-> apicid mapping. x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid. x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting. Tang Chen (1): x86, memhp, numa: Online memory-less nodes at boot time.

Re: [PATCH v3 0/5] Make cpuid <-> nodeid mapping persistent.

2015-12-09 Thread Tang Chen
=0x20a000, Memory of Node 2 and 3 are ignored and the Nodes become memoryless node. OK, I'm using initrd overwrite. It could also fake the memory-less node. Thanks. Thanks, Yasuaki Ishimatsu On Thu, 19 Nov 2015 12:22:10 +0800 Tang Chen <tangc...@cn.fujitsu.com> wrote: [Problem]

Re: [PATCH v3 0/5] Make cpuid <-> nodeid mapping persistent.

2015-11-23 Thread Tang Chen
On 11/24/2015 06:04 AM, Tejun Heo wrote: Hello, On Thu, Nov 19, 2015 at 12:22:10PM +0800, Tang Chen wrote: [Solution] There are four mappings in the kernel: 1. nodeid (logical node id) <-> pxm 2. apicid (physical cpu id) <-> nodeid 3. cpuid (logical cpu id) <->

Re: [RFC] mm: direct mapping count in /proc/meminfo is error

2015-11-20 Thread Tang Chen
Hi Shi, Would you please share where did you add the printk debug info ? Thanks. :) On 11/20/2015 04:17 PM, Xishi Qiu wrote: I find the direct mapping count in /proc/meminfo is error. The value should be equal to the size of init_memory_mapping which showed in boot log. I add some print to

[PATCH v3 2/5] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2015-11-18 Thread Tang Chen
n-presnet or disabled cpus' apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch fin

[PATCH v3 0/5] Make cpuid <-> nodeid mapping persistent.

2015-11-18 Thread Tang Chen
cpu-hotplug: Enable acpi to register all possible cpus at boot time. x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping. x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid. x86, acpi, cpu-hotplug: Set persist

Re: [PATCH v3 0/5] Make cpuid <-> nodeid mapping persistent.

2015-11-18 Thread Tang Chen
Hi, Sorry for the terrible delay for this patch-set. But unfortunately, they are still not fully tested for the memory-less node case. Please help to review first. Will soon do the tests. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

[PATCH v3 1/5] x86, memhp, numa: Online memory-less nodes at boot time.

2015-11-18 Thread Tang Chen
For now, x86 does not support memory-less node. A node without memory will not be onlined, and the cpus on it will be mapped to the other online nodes with memory in init_cpu_to_node(). The reason of doing this is to ensure each cpu has mapped to a node with memory, so that it will be able to

[PATCH v3 4/5] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2015-11-18 Thread Tang Chen
abled processors and returns -ENODEV. After this patch, a new parameter will be added to MADT APIs so that caller is able to control if disabled processors are ignored. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com&

[PATCH v3 3/5] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2015-11-18 Thread Tang Chen
y: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 6 ++--- arch/x86/kernel/apic/apic.c | 61 --- 3 files changed, 61 insertions(+), 7

[PATCH v3 5/5] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2015-11-18 Thread Tang Chen
com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/ia64/kernel/acpi.c | 2 +- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/bus.c| 3 ++ drivers/acpi/processor_core.c | 65 +++ include/linux/acpi.h | 2

Re: [PATCH V7] mm: memory hot-add: memory can not be added to movable zone defaultly

2015-10-21 Thread Tang Chen
On 10/21/2015 05:00 PM, Vlastimil Babka wrote: On 10/21/2015 04:20 AM, Changsheng Liu wrote: 在 2015/10/15 0:18, Vlastimil Babka 写道: On 10/12/2015 08:58 AM, Changsheng Liu wrote: From: Changsheng Liu After the user config CONFIG_MOVABLE_NODE, When the memory is

Re: [PATCH V7] mm: memory hot-add: memory can not be added to movable zone defaultly

2015-10-21 Thread Tang Chen
On 10/21/2015 05:18 PM, Tang Chen wrote: On 10/21/2015 05:00 PM, Vlastimil Babka wrote: On 10/21/2015 04:20 AM, Changsheng Liu wrote: 在 2015/10/15 0:18, Vlastimil Babka 写道: On 10/12/2015 08:58 AM, Changsheng Liu wrote: From: Changsheng Liu <liuchangch...@inspur.com> After th

Re: [PATCH] mm: skip if required_kernelcore is larger than totalpages

2015-10-13 Thread Tang Chen
Hi, Qiu The patch seems OK to me. Only one little concern below. On 10/12/2015 09:37 AM, Xishi Qiu wrote: On 2015/10/9 23:41, Yasuaki Ishimatsu wrote: On Thu, 8 Oct 2015 10:21:05 +0800 Xishi Qiu wrote: If kernelcore was not specified, or the kernelcore size is zero

Re: [PATCH] mm: skip if required_kernelcore is larger than totalpages

2015-10-13 Thread Tang Chen
On 10/14/2015 11:28 AM, Xishi Qiu wrote: On 2015/10/14 10:50, Tang Chen wrote: Hi, Qiu The patch seems OK to me. Only one little concern below. On 10/12/2015 09:37 AM, Xishi Qiu wrote: On 2015/10/9 23:41, Yasuaki Ishimatsu wrote: On Thu, 8 Oct 2015 10:21:05 +0800 Xishi Qiu <qi

Re: [PATCH V6] mm: memory hot-add: memory can not be added to movable zone defaultly

2015-10-11 Thread Tang Chen
Hi Ishimatsu, On 10/10/2015 02:13 AM, Yasuaki Ishimatsu wrote: Hi Tang, On Fri, 9 Oct 2015 15:59:38 +0800 Tang Chen <tangc...@cn.fujitsu.com> wrote: Hi, I don't mean to offend, but I really think it is not necessary to do this. hot-added memory will be added to ZONE_NORMAL by defaul

Re: [PATCH V6] mm: memory hot-add: memory can not be added to movable zone defaultly

2015-10-09 Thread Tang Chen
...@huawei.com> Cc: Zhang Yanfei <zhangyan...@cn.fujitsu.com> Cc: Dave Hansen <dave.han...@intel.com> Cc: Yinghai Lu <ying...@kernel.org> Cc: Tang Chen <tangc...@cn.fujitsu.com> Cc: Hu Tao <hu...@cn.fujitsu.com> Cc: Lai Jiangshan <la...@cn.fujitsu.com> Cc: Y

Re: [PATCH] mm: fix overflow in find_zone_movable_pfns_for_nodes()

2015-09-30 Thread Tang Chen
Seems OK to me. Thanks. On 09/30/2015 05:33 PM, Xishi Qiu wrote: If user set "movablecore=xx" to a large number, corepages will overflow, this patch fix the problem. Signed-off-by: Xishi Qiu --- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH v2 3/7] x86, gfp: Cache best near node for memory allocation.

2015-09-27 Thread Tang Chen
Hi, tj, On 09/27/2015 01:53 AM, Tejun Heo wrote: Hello, Tang. On Sat, Sep 26, 2015 at 05:31:07PM +0800, Tang Chen wrote: @@ -307,13 +307,19 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, if (nid < 0) nid = numa_node

Re: [PATCH v2 5/7] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid <-> apicid mapping.

2015-09-27 Thread Tang Chen
On 09/27/2015 01:56 AM, Tejun Heo wrote: On Sat, Sep 26, 2015 at 05:52:09PM +0800, Tang Chen wrote: +static int allocate_logical_cpuid(int apicid) +{ + int i; + + /* +* cpuid <-> apicid mapping is persistent, so when a cpu is up, +* check if the kernel has all

Re: [PATCH v2 4/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2015-09-26 Thread Tang Chen
Hi Rafael, On 09/11/2015 07:10 AM, Rafael J. Wysocki wrote: On Thursday, September 10, 2015 12:27:46 PM Tang Chen wrote: .. Can you please avoid using the same (or at least very similar changelog) for multiple patches in the series? That doesn't help a lot. OK, will update the comment

Re: [PATCH v2 3/7] x86, gfp: Cache best near node for memory allocation.

2015-09-26 Thread Tang Chen
Hi, tj On 09/11/2015 03:29 AM, Tejun Heo wrote: Hello, On Thu, Sep 10, 2015 at 12:27:45PM +0800, Tang Chen wrote: diff --git a/include/linux/gfp.h b/include/linux/gfp.h index ad35f30..1a1324f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -307,13 +307,19 @@ static inline struct

Re: [PATCH v2 3/7] x86, gfp: Cache best near node for memory allocation.

2015-09-26 Thread Tang Chen
Hi, Christoph, tj, On 09/11/2015 08:14 AM, Christoph Lameter wrote: On Thu, 10 Sep 2015, Tejun Heo wrote: Why not just update node_data[]->node_zonelist in the first place? Also, what's the synchronization rule here? How are allocators synchronized against node hot [un]plugs? Also,

Re: [PATCH v2 5/7] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid <-> apicid mapping.

2015-09-26 Thread Tang Chen
Hi tj, On 09/11/2015 03:55 AM, Tejun Heo wrote: Hello, So, overall, I think this is the right way to go although I have no idea whether the acpi part is okay. Thank you very much for reviewing. :) +/* + * Current allocated max logical CPU ID plus 1. + * All allocated CPU ID should be in

[PATCH v2 2/7] x86, numa: Introduce a node to node array to map a node to its best online node.

2015-09-09 Thread Tang Chen
cessful. This is done outside alloc_pages_node() and alloc_pages_exact_node(), when the kernel boots. In this patch, we calculate best near online node for all nodes at node hotplug time, and store them in an array so that they could be obtained inside memory allocator at any time. Signed

[PATCH v2 4/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2015-09-09 Thread Tang Chen
n-presnet or disabled cpus' apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch fin

[PATCH v2 7/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2015-09-09 Thread Tang Chen
walk for processors. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/ia64/kernel/acpi.c | 2 +- arch/x86/kernel/acpi/boot.c | 2 +- drivers/acpi/bus.c| 3 ++ drivers/acpi/processor_core.c | 65 +

[PATCH v2 0/7] Make cpuid <-> nodeid mapping persistent.

2015-09-09 Thread Tang Chen
me. x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid <-> apicid mapping. x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid. x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting. Tang Chen (2): x86, n

[PATCH v2 5/7] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid <-> apicid mapping.

2015-09-09 Thread Tang Chen
ering local apic. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 6 ++--- arch/x86/kernel/apic/apic.c | 53 --- 3 files

[PATCH v2 3/7] x86, gfp: Cache best near node for memory allocation.

2015-09-09 Thread Tang Chen
et best near online node for CPUs on memory-less nodes inside alloc_pages_node() and alloc_pages_exact_node() to avoid memory allocation failure. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/mm/numa.c | 3 +--

[PATCH v2 1/7] x86, numa: Move definition of find_near_online_node() forward.

2015-09-09 Thread Tang Chen
Will call this function earlier in next coming patches. So simply move its definition forward. And also, add comments for it. Signed-off-by: Tang Chen <tangc...@cn.fujitsu.com> --- arch/x86/mm/numa.c | 47 +-- 1 file changed, 29 insertions(

[PATCH v2 6/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2015-09-09 Thread Tang Chen
The current code ignores disabled processors and returns -ENODEV. After this patch, a new parameter will be added to MADT APIs so that caller is able to control if disabled processors are ignored. Signed-off-by: Gu Zheng <guz.f...@cn.fujitsu.com> Signed-off-by: Tang Chen <tangc...@cn.fujitsu

Re: [PATCH 1/1] memhp: Add hot-added memory ranges to memblock before allocate node_data for a node.

2015-08-26 Thread Tang Chen
On 08/25/2015 09:09 AM, Xishi Qiu wrote: On 2015/8/24 17:22, Xishi Qiu wrote: On 2015/8/24 1:06, Tang Chen wrote: The commit below adds hot-added memory range to memblock, after creating pgdat for new node. commit f9126ab9241f66562debf69c2c9d8fee32ddcc53 Author: Xishi Qiu qiuxi

Re: [PATCH 2/2] memory-hotplug: remove reset_node_managed_pages() and reset_node_managed_pages() in hotadd_new_pgdat()

2015-08-26 Thread Tang Chen
On 08/24/2015 07:24 PM, Xishi Qiu wrote: .. [ 2007.584000] On node 5 totalpages: 0 [ 2007.585000] Built 5 zonelists in Node order, mobility grouping on. Total pages: 32588823 [ 2007.594000] Policy zone: Normal [ 2007.598000] init_memory_mapping: [mem 0x600-0x607] And

Re: [PATCH 2/2] memory-hotplug: remove reset_node_managed_pages() and reset_node_managed_pages() in hotadd_new_pgdat()

2015-08-24 Thread Tang Chen
On 08/24/2015 05:17 PM, Xishi Qiu wrote: On 2015/8/23 18:28, Tang Chen wrote: Hi Shi, Sorry for the late reply. I hope it won't be too late. NON-ACK by me, I think. I noticed that your first has been merged. But it won't fix the problem these code intended to fix. After your patch 1

[PATCH 1/1] memhp: Add hot-added memory ranges to memblock before allocate node_data for a node.

2015-08-23 Thread Tang Chen
on. Total pages: 32588823 [ 2007.594000] Policy zone: Normal [ 2007.598000] init_memory_mapping: [mem 0x600-0x607] The solution is simple, just add the memory range to memblock a little earlier, before hotadd_new_pgdat(). Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- mm

Re: [PATCH 2/2] memory-hotplug: remove reset_node_managed_pages() and reset_node_managed_pages() in hotadd_new_pgdat()

2015-08-23 Thread Tang Chen
Hi Shi, Sorry for the late reply. I hope it won't be too late. NON-ACK by me, I think. I noticed that your first has been merged. But it won't fix the problem these code intended to fix. After your patch 1, zone's spanned/present won't be set to 0 because: free_area_init_node() |--

Re: [Patch V3 9/9] mm, x86: Enable memoryless node support to better support CPU/memory hotplug

2015-08-18 Thread Tang Chen
Hi Liu, On 08/17/2015 11:19 AM, Jiang Liu wrote: .. diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b3a1a5d77d92..5d7ad70ace0d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2069,6 +2069,9 @@ config USE_PERCPU_NUMA_NODE_ID def_bool y depends on NUMA

Re: [Patch V3 9/9] mm, x86: Enable memoryless node support to better support CPU/memory hotplug

2015-08-18 Thread Tang Chen
On 08/18/2015 02:59 PM, Jiang Liu wrote: ... } @@ -739,6 +746,22 @@ void __init init_cpu_to_node(void) if (!node_online(node)) node = find_near_online_node(node); Hi Liu, If cpu-less, memory-less and normal node will all be online anyway, I think we don't

Re: [Patch V3 0/9] Enable memoryless node support for x86

2015-08-18 Thread Tang Chen
On 08/17/2015 11:18 AM, Jiang Liu wrote: This is the third version to enable memoryless node support on x86 platforms. The previous version (https://lkml.org/lkml/2014/7/11/75) blindly replaces numa_node_id()/cpu_to_node() with numa_mem_id()/ cpu_to_mem(). That's not the right solution as

Re: [Xen-devel] [PATCHv3 01/10] mm: memory hotplug with an existing resource

2015-08-16 Thread Tang Chen
); + if (ret 0) Not a big deal, but I think if (ret) is enough. The code looks good. Reviewed-by: Tang Chen tangc...@cn.fujitsu.com Thanks. + release_memory_resource(res); + return ret; +} EXPORT_SYMBOL_GPL(add_memory); #ifdef CONFIG_MEMORY_HOTREMOVE -- To unsubscribe

Re: [PATCH 1/5] x86, gfp: Cache best near node for memory allocation.

2015-08-09 Thread Tang Chen
wrote: On 2015/8/4 11:36, Tang Chen wrote: Hi TJ, Sorry for the late reply. On 07/16/2015 05:48 AM, Tejun Heo wrote: .. so in initialization pharse makes no sense any more. The best near online node for each cpu should be cached somewhere. I'm not really following. Is this because the now

Re: [PATCH 1/5] x86, gfp: Cache best near node for memory allocation.

2015-08-04 Thread Tang Chen
On 08/04/2015 04:05 PM, Jiang Liu wrote: .. But, 1) in cpu_up(), it will try to online a node, and it doesn't check if the node has memory. 2) in try_offline_node(), it offlines CPUs first, and then the memory. This behavior looks a little wired, or let's say it is ambiguous. It seems

Re: [PATCH 1/5] x86, gfp: Cache best near node for memory allocation.

2015-08-03 Thread Tang Chen
Hi TJ, Sorry for the late reply. On 07/16/2015 05:48 AM, Tejun Heo wrote: .. so in initialization pharse makes no sense any more. The best near online node for each cpu should be cached somewhere. I'm not really following. Is this because the now offline node can later come online and

Re: [PATCH 0/5] Make cpuid - nodeid mapping persistent.

2015-07-22 Thread Tang Chen
On 07/16/2015 06:13 AM, Tejun Heo wrote: Hello, On Tue, Jul 07, 2015 at 05:30:20PM +0800, Tang Chen wrote: [Solution] To fix this problem, we establish cpuid - nodeid mapping for all the possible cpus at boot time, and make it invariable. And according to init_cpu_to_node(), cpuid - nodeid

Re: [PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-16 Thread Tang Chen
On 07/16/2015 05:20 AM, Tejun Heo wrote: On Wed, Jul 01, 2015 at 11:16:54AM +0800, Tang Chen wrote: ... - /* and there's no empty block */ - if (bi-start = bi-end) + /* and there's no empty or non-exist block */ + if (bi-start = bi-end

[PATCH 0/2] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-16 Thread Tang Chen
node2 CPU(s): 31-45,159-173 NUMA node3 CPU(s): 46-60,174-188 NUMA node4 CPU(s): 62-76,190-204 NUMA node5 CPU(s): 78-92,206-220 Tang Chen (2): memblock: Make memblock_overlaps_region() return bool. mem-hotplug: Handle node hole when initializing numa_meminfo. arch/x86/mm

[PATCH 1/2] memblock: Make memblock_overlaps_region() return bool.

2015-07-16 Thread Tang Chen
-by: Tang Chen tangc...@cn.fujitsu.com --- include/linux/memblock.h | 2 +- mm/memblock.c| 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index cc4b019..d312ae3 100644 --- a/include/linux/memblock.h +++ b

[PATCH 2/2] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-16 Thread Tang Chen
node4 CPU(s): 62-76,190-204 NUMA node5 CPU(s): 78-92,206-220 Signed-off-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com --- arch/x86/mm/numa.c | 6 -- include/linux/memblock.h | 2 ++ mm/memblock.c| 2 +- 3 files

Re: [PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-15 Thread Tang Chen
On 07/16/2015 05:20 AM, Tejun Heo wrote: On Wed, Jul 01, 2015 at 11:16:54AM +0800, Tang Chen wrote: ... - /* and there's no empty block */ - if (bi-start = bi-end) + /* and there's no empty or non-exist block */ + if (bi-start = bi-end

Re: [PATCH 3/5] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid - apicid mapping.

2015-07-15 Thread Tang Chen
On 07/15/2015 01:35 PM, Jiang Liu wrote: On 2015/7/15 11:33, Tang Chen wrote: Hi Mika, On 07/07/2015 07:14 PM, Mika Penttilä wrote: I think you forgot to reserve CPU 0 for BSP in cpuid mask. Sorry for the late reply. I'm not familiar with BSP. Do you mean in get_cpuid(), I should reserve

Re: [PATCH 3/5] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid - apicid mapping.

2015-07-14 Thread Tang Chen
. --Mika On Tue, Jul 7, 2015 at 12:30 PM, Tang Chen tangc...@cn.fujitsu.com wrote: From: Gu Zheng guz.f...@cn.fujitsu.com In this patch, we introduce a new static array named apicid_to_cpuid[], which is large enough to store info for all possible cpus. And then, we modify the cpuid calculation

Re: [PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-07 Thread Tang Chen
On 07/07/2015 12:42 AM, Yasuaki Ishimatsu wrote: On Fri, 3 Jul 2015 09:26:05 +0800 Tang Chen tangc...@cn.fujitsu.com wrote: On 07/02/2015 11:02 PM, Yasuaki Ishimatsu wrote: Hi Tang, On my box, if I run lscpu, the output looks like this: NUMA node0 CPU(s): 0-14,128-142 NUMA node1 CPU(s

[PATCH 3/5] x86, acpi, cpu-hotplug: Introduce apicid_to_cpuid[] array to store persistent cpuid - apicid mapping.

2015-07-07 Thread Tang Chen
. cpuid - apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid - apicid mapping when registering local apic. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc

[PATCH 2/5] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2015-07-07 Thread Tang Chen
- nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch finished step 1. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/kernel/apic/apic.c | 26 +++--- 1 file changed, 19

[PATCH 5/5] x86, acpi, cpu-hotplug: Set persistent cpuid - nodeid mapping when booting.

2015-07-07 Thread Tang Chen
From: Gu Zheng guz.f...@cn.fujitsu.com This patch set the persistent cpuid - nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com

[PATCH 1/5] x86, gfp: Cache best near node for memory allocation.

2015-07-07 Thread Tang Chen
in alloc_pages_node() and alloc_pages_exact_node(). Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- arch/x86/include/asm/topology.h | 2 ++ arch/x86/mm/numa.c | 57 ++--- include/linux/gfp.h | 12

[PATCH 0/5] Make cpuid - nodeid mapping persistent.

2015-07-07 Thread Tang Chen
[Problem] cpuid - nodeid mapping is firstly established at boot time. And workqueue caches the mapping in wq_numa_possible_cpumask in wq_numa_init() at boot time. When doing node online/offline, cpuid - nodeid mapping is established/destroyed, which means, cpuid - nodeid mapping will change if

[PATCH 4/5] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2015-07-07 Thread Tang Chen
processors are ignored. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Tang Chen tangc...@cn.fujitsu.com --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++ 2 files changed, 40 insertions(+), 22 deletions(-) diff

Re: [PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-02 Thread Tang Chen
is removed, but holes between nodes are not removed. I think libraries are not able to handle this problem since nodes are set online in kernel. Seeing from user space, there is no hole. Thanks. Thanks, Yasuaki Ishimatsu On Wed, 1 Jul 2015 15:55:30 +0800 Tang Chen tangc...@cn.fujitsu.com wrote

Re: [PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-07-01 Thread Tang Chen
On 07/01/2015 02:25 PM, Xishi Qiu wrote: On 2015/7/1 11:16, Tang Chen wrote: When parsing SRAT, all memory ranges are added into numa_meminfo. In numa_init(), before entering numa_cleanup_meminfo(), all possible memory ranges are in numa_meminfo. And numa_cleanup_meminfo() removes all ranges

[PATCH 1/1] mem-hotplug: Handle node hole when initializing numa_meminfo.

2015-06-30 Thread Tang Chen
. In this patch, we use memblock_overlaps_region() to check if ranges in numa_meminfo overlap with ranges in memory_block. Since memory_block contains all available memory at boot time, if they overlap, it means the ranges exist. If not, then remove them from numa_meminfo. Signed-off-by: Tang Chen tangc

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

2014-11-13 Thread Tang Chen
Thanks for the sharing. Will do more tests. :) On 11/14/2014 07:39 AM, Wanpeng Li wrote: Hi Tang, On Tue, Nov 11, 2014 at 01:35:29PM +0800, Tang Chen wrote: Hi Wanpeng, Sorry for the late. I think I have totally missed this thread. I opened lockdep and RCU debug, and tried on 3.18-rc1

[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 tangc...@cn.fujitsu.com Reviewed

[PATCH 0/2] Fix node meminfo corruption.

2014-11-12 Thread Tang Chen
: 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 | 1 + mm/bootmem.c

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

2014-11-12 Thread Tang Chen
() 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 tangc...@cn.fujitsu.com Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Cc: sta...@vger.kernel.org # 3.16+ --- include

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

2014-11-12 Thread Tang Chen
. Add Cc: sta...@vger.kernel.org # 3.16+ since it is urgent. Change log v1 - v2: 1. Replace patch 2/2 with a new one. It 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

Re: [PATCH 0/2] Fix node meminfo corruption.

2014-11-12 Thread Tang Chen
Sorry, please ignore this series. Sent by mistake. On 11/12/2014 04:36 PM, Tang Chen wrote: There are two problems when calculating node meminfo: 1. When hot-adding a node without onlining any page, MemTotal corrupted. # hot-add node2 (memory not onlined) # cat /sys/device/system/node/node2

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

2014-11-10 Thread Tang Chen
() 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 tangc...@cn.fujitsu.com Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com --- include/linux/bootmem.h | 1 + mm/bootmem.c

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

2014-11-10 Thread Tang Chen
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 | 24

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

2014-11-10 Thread Tang Chen
-by: Tang Chen tangc...@cn.fujitsu.com Reviewed-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com --- 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

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 v2 0/2] Fix node meminfo and zoneinfo corruption.

2014-11-07 Thread Tang Chen
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 | 24

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

2014-11-07 Thread Tang Chen
-by: Tang Chen tangc...@cn.fujitsu.com --- 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,14 @@ out: } #endif

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

2014-11-07 Thread Tang Chen
() 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 tangc...@cn.fujitsu.com Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com --- include/linux/bootmem.h | 1 + mm/bootmem.c

Re: [PATCH 2/2] mem-hotplug: Fix wrong check for zone-pageset initialization in online_pages().

2014-11-04 Thread Tang Chen
On 11/04/2014 04:10 PM, Yasuaki Ishimatsu wrote: (2014/10/31 18:46), Tang Chen wrote: When we are doing memory hot-add, the following functions are called: add_memory() |-- hotadd_new_pgdat() |-- free_area_init_node() |-- free_area_init_core() |-- zone

Re: [PATCH 2/2] mem-hotplug: Fix wrong check for zone-pageset initialization in online_pages().

2014-11-04 Thread Tang Chen
On 11/05/2014 09:01 AM, Kamezawa Hiroyuki wrote: .. diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 3ab01b2..bc0de0f 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1013,9 +1013,13 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int

Re: [PATCH 0/2] Fix node meminfo corruption.

2014-11-03 Thread Tang Chen
Hi all, I thinks these two problems are very important and should be merged ASAP. Would you please help to have a look at it ? Thanks. On 10/31/2014 05:46 PM, Tang Chen wrote: There are two problems when calculating node meminfo: 1. When hot-adding a node without onlining any page, MemTotal

[PATCH 0/2] Fix node meminfo corruption.

2014-10-31 Thread Tang Chen
: 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 | 1 + mm/bootmem.c

[PATCH 0/2] Fix node meminfo corruption.

2014-10-31 Thread Tang Chen
: 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 | 1 + mm/bootmem.c

  1   2   3   4   5   6   7   8   9   10   >