From patchwork Sat Jan 23 09:39:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 60261 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp358530lbb; Sat, 23 Jan 2016 01:45:27 -0800 (PST) X-Received: by 10.67.6.67 with SMTP id cs3mr10831030pad.143.1453542327814; Sat, 23 Jan 2016 01:45:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q80si16242892pfa.60.2016.01.23.01.45.27; Sat, 23 Jan 2016 01:45:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756200AbcAWJpS (ORCPT + 30 others); Sat, 23 Jan 2016 04:45:18 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:52142 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751866AbcAWJpL (ORCPT ); Sat, 23 Jan 2016 04:45:11 -0500 Received: from 172.24.1.49 (EHLO szxeml428-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DDP83231; Sat, 23 Jan 2016 17:40:31 +0800 (CST) Received: from localhost (10.177.17.188) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.235.1; Sat, 23 Jan 2016 17:40:24 +0800 From: Hanjun Guo To: "Rafael J. Wysocki" , Will Deacon , Catalin Marinas CC: , , , Ganapatrao Kulkarni , Lorenzo Pieralisi , Shannon Zhao , "Steve Capper" , Mark Rutland , Robert Richter , Hanjun Guo Subject: [PATCH v3 08/12] arm64, numa: rework numa_add_memblk() Date: Sat, 23 Jan 2016 17:39:23 +0800 Message-ID: <1453541967-3744-9-git-send-email-guohanjun@huawei.com> X-Mailer: git-send-email 1.7.10.msysgit.1 In-Reply-To: <1453541967-3744-1-git-send-email-guohanjun@huawei.com> References: <1453541967-3744-1-git-send-email-guohanjun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.56A34A90.007E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d575433ac3c9345dbc964e4397b69a6e Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hanjun Guo 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 --- 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(-) -- 1.9.1 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; }