Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315558

[PATCH v3 08/12] arm64, numa: rework numa_add_memblk()

From Hanjun Guo <guohanjun@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v3 08/12] arm64, numa: rework numa_add_memblk()
Date 2016-01-23 10:50 +0100
Message-ID <qU2Zs-K2-25@gated-at.bofh.it> (permalink)
References <qU2Zr-K2-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Hanjun Guo <hanjun.guo@linaro.org>

Rework numa_add_memblk() to update the parameter "u64 size"
to "u64 end", this will make it consistent with x86 and
can simplify the code later.

Updates for arch/arm64/mm/numa.c should squash to core NUMA
patches from Ganapat.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
 arch/arm64/kernel/acpi_numa.c |  2 +-
 arch/arm64/kernel/of_numa.c   |  2 +-
 arch/arm64/mm/numa.c          | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
index 15fb935..3bcf058 100644
--- a/arch/arm64/kernel/acpi_numa.c
+++ b/arch/arm64/kernel/acpi_numa.c
@@ -184,7 +184,7 @@ int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 		node, pxm,
 		(unsigned long long) start, (unsigned long long) end - 1);
 
-	if (numa_add_memblk(node, start, (end - start)) < 0) {
+	if (numa_add_memblk(node, start, end) < 0) {
 		bad_srat();
 		return -EINVAL;
 	}
diff --git a/arch/arm64/kernel/of_numa.c b/arch/arm64/kernel/of_numa.c
index 2f9e34b..aa6f3a3 100644
--- a/arch/arm64/kernel/of_numa.c
+++ b/arch/arm64/kernel/of_numa.c
@@ -168,7 +168,7 @@ static int __init early_init_parse_memory_node(unsigned long node)
 		pr_debug("NUMA-DT:  base = %llx , node = %u\n",
 				base, nid);
 
-		if (numa_add_memblk(nid, base, size) < 0)
+		if (numa_add_memblk(nid, base, base + size) < 0)
 			return -EINVAL;
 	}
 
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index e974995..2b04b8a 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -137,25 +137,25 @@ void numa_store_cpu_info(unsigned int cpu)
  * numa_add_memblk - Set node id to memblk
  * @nid: NUMA node ID of the new memblk
  * @start: Start address of the new memblk
- * @size:  Size of the new memblk
+ * @end:  End address of the new memblk
  *
  * RETURNS:
  * 0 on success, -errno on failure.
  */
-int __init numa_add_memblk(int nid, u64 start, u64 size)
+int __init numa_add_memblk(int nid, u64 start, u64 end)
 {
 	int ret;
 
-	ret = memblock_set_node(start, size, &memblock.memory, nid);
+	ret = memblock_set_node(start, (end - start), &memblock.memory, nid);
 	if (ret < 0) {
 		pr_err("NUMA: memblock [0x%llx - 0x%llx] failed to add on node %d\n",
-			start, (start + size - 1), nid);
+			start, (end - 1), nid);
 		return ret;
 	}
 
 	node_set(nid, numa_nodes_parsed);
 	pr_info("NUMA: Adding memblock [0x%llx - 0x%llx] on node %d\n",
-			start, (start + size - 1), nid);
+			start, (end - 1), nid);
 	return ret;
 }
 EXPORT_SYMBOL(numa_add_memblk);
@@ -366,7 +366,7 @@ static int __init dummy_numa_init(void)
 	       0LLU, PFN_PHYS(max_pfn) - 1);
 
 	for_each_memblock(memory, mblk) {
-		ret = numa_add_memblk(0, mblk->base, mblk->size);
+		ret = numa_add_memblk(0, mblk->base, mblk->base + mblk->size);
 		if (unlikely(ret < 0))
 			return ret;
 	}
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/12] ACPI NUMA support for ARM64 Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
  [PATCH v3 08/12] arm64, numa: rework numa_add_memblk() Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
    Re: [PATCH v3 08/12] arm64, numa: rework numa_add_memblk() Robert Richter <robert.richter@caviumnetworks.com> - 2016-01-25 11:10 +0100
      Re: [PATCH v3 08/12] arm64, numa: rework numa_add_memblk() Hanjun Guo <guohanjun@huawei.com> - 2016-01-27 07:30 +0100
  [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT and SLIT Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
    Re: [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT  and SLIT Robert Richter <robert.richter@caviumnetworks.com> - 2016-01-25 11:30 +0100
      Re: [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT  and SLIT Hanjun Guo <guohanjun@huawei.com> - 2016-01-27 08:20 +0100
        Re: [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT  and SLIT Robert Richter <robert.richter@caviumnetworks.com> - 2016-01-27 15:40 +0100
  [PATCH v3 12/12] acpi, numa: reuse acpi_numa_memory_affinity_init() Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
    Re: [PATCH v3 12/12] acpi, numa: reuse  acpi_numa_memory_affinity_init() Robert Richter <robert.richter@caviumnetworks.com> - 2016-01-25 11:30 +0100
      Re: [PATCH v3 12/12] acpi, numa: reuse  acpi_numa_memory_affinity_init() Hanjun Guo <guohanjun@huawei.com> - 2016-01-27 07:20 +0100
        Re: [PATCH v3 12/12] acpi, numa: reuse  acpi_numa_memory_affinity_init() Robert Richter <robert.richter@caviumnetworks.com> - 2016-01-27 15:20 +0100
  [PATCH v3 10/12] acpi, numa: move bad_srat() and srat_disabled() to common place Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
  [PATCH v3 02/12] acpi, numa: Replace ACPI_DEBUG_PRINT() with pr_debug() Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100
  [PATCH v3 07/12] acpi, numa: move acpi_numa_slit_init() to common place Hanjun Guo <guohanjun@huawei.com> - 2016-01-23 10:50 +0100

csiph-web