[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1DDED2FB-35F4-4159-B46B-0F3846DCF98E@nvidia.com>
Date: Mon, 26 Aug 2024 22:46:25 +0000
From: Bruno Faccini <bfaccini@...dia.com>
To: Mike Rapoport <rppt@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Alexander
Gordeev <agordeev@...ux.ibm.com>, Andreas Larsson <andreas@...sler.com>,
Andrew Morton <akpm@...ux-foundation.org>, Arnd Bergmann <arnd@...db.de>,
Borislav Petkov <bp@...en8.de>, Catalin Marinas <catalin.marinas@....com>,
Christophe Leroy <christophe.leroy@...roup.eu>, Dan Williams
<dan.j.williams@...el.com>, Dave Hansen <dave.hansen@...ux.intel.com>, David
Hildenbrand <david@...hat.com>, "David S. Miller" <davem@...emloft.net>,
Davidlohr Bueso <dave@...olabs.net>, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, Heiko Carstens <hca@...ux.ibm.com>, Huacai Chen
<chenhuacai@...nel.org>, Ingo Molnar <mingo@...hat.com>, Jiaxun Yang
<jiaxun.yang@...goat.com>, John Paul Adrian Glaubitz
<glaubitz@...sik.fu-berlin.de>, Jonathan Cameron
<jonathan.cameron@...wei.com>, Jonathan Corbet <corbet@....net>, Michael
Ellerman <mpe@...erman.id.au>, Palmer Dabbelt <palmer@...belt.com>, "Rafael
J. Wysocki" <rafael@...nel.org>, Rob Herring <robh@...nel.org>, Samuel
Holland <samuel.holland@...ive.com>, Thomas Bogendoerfer
<tsbogend@...ha.franken.de>, Thomas Gleixner <tglx@...utronix.de>, Vasily
Gorbik <gor@...ux.ibm.com>, Will Deacon <will@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-cxl@...r.kernel.org"
<linux-cxl@...r.kernel.org>, "linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>, "linux-mips@...r.kernel.org"
<linux-mips@...r.kernel.org>, "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"loongarch@...ts.linux.dev" <loongarch@...ts.linux.dev>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>, "x86@...nel.org"
<x86@...nel.org>, Zi Yan <ziy@...dia.com>, Bruno Faccini
<bfaccini@...dia.com>
Subject: Re: [PATCH v4 24/26] arch_numa: switch over to numa_memblks
On 7 Aug 2024, at 2:41, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
Until now arch_numa was directly translating firmware NUMA information
to memblock.
Using numa_memblks as an intermediate step has a few advantages:
* alignment with more battle tested x86 implementation
* availability of NUMA emulation
* maintaining node information for not yet populated memory
Adjust a few places in numa_memblks to compile with 32-bit phys_addr_t
and replace current functionality related to numa_add_memblk() and
__node_distance() in arch_numa with the implementation based on
numa_memblks and add functions required by numa_emulation.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@...nel.org>
Tested-by: Zi Yan <ziy@...dia.com> # for x86_64 and arm64
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Tested-by: Jonathan Cameron <Jonathan.Cameron@...wei.com> [arm64 + CXL via QEMU]
Acked-by: Dan Williams <dan.j.williams@...el.com>
Acked-by: David Hildenbrand <david@...hat.com>
---
drivers/base/Kconfig | 1 +
drivers/base/arch_numa.c | 201 +++++++++++--------------------------
include/asm-generic/numa.h | 6 +-
mm/numa_memblks.c | 17 ++--
4 files changed, 75 insertions(+), 150 deletions(-)
<snip>
+
+u64 __init numa_emu_dma_end(void)
+{
+ return PFN_PHYS(memblock_start_of_DRAM() + SZ_4G);
+}
+
PFN_PHYS() translation is unnecessary here, as
memblock_start_of_DRAM() + SZ_4G is already a
memory size.
This should fix it:
====================================================
diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
index 8d49893c0e94..e18701676426 100644
--- a/drivers/base/arch_numa.c
+++ b/drivers/base/arch_numa.c
@@ -346,7 +346,7 @@ void __init numa_emu_update_cpu_to_node(int *emu_nid_to_phys,
u64 __init numa_emu_dma_end(void)
{
- return PFN_PHYS(memblock_start_of_DRAM() + SZ_4G);
+ return memblock_start_of_DRAM() + SZ_4G;
}
void debug_cpumask_set_cpu(unsigned int cpu, int node, bool enable)
====================================================
!!! I had a lot of trouble to send in plain text from Outlook on my Mac, sorry for the noise and the duplicate copies !!!
Powered by blists - more mailing lists