The patch titled Subject: MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures has been added to the -mm mm-unstable branch. Its filename is mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx> Subject: MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures Date: Wed, 7 Aug 2024 09:40:46 +0300 sgi-ip27 is the only system that defines NODE_DATA() differently than the rest of NUMA machines. Add node_data array of struct pglist pointers that will point to __node_data[node]->pglist and redefine NODE_DATA() to use node_data array. This will allow pulling declaration of node_data to the generic mm code in the next commit. Link: https://lkml.kernel.org/r/20240807064110.1003856-3-rppt@xxxxxxxxxx Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Tested-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> [arm64 + CXL via QEMU] Acked-by: Dan Williams <dan.j.williams@xxxxxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Alexander Gordeev <agordeev@xxxxxxxxxxxxx> Cc: Andreas Larsson <andreas@xxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Borislav Petkov <bp@xxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx> Cc: David S. Miller <davem@xxxxxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Heiko Carstens <hca@xxxxxxxxxxxxx> Cc: Huacai Chen <chenhuacai@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx> Cc: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx> Cc: Jonathan Corbet <corbet@xxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx> Cc: Rafael J. Wysocki <rafael@xxxxxxxxxx> Cc: Rob Herring (Arm) <robh@xxxxxxxxxx> Cc: Samuel Holland <samuel.holland@xxxxxxxxxx> Cc: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/mips/include/asm/mach-ip27/mmzone.h | 5 ++++- arch/mips/sgi-ip27/ip27-memory.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/arch/mips/include/asm/mach-ip27/mmzone.h~mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures +++ a/arch/mips/include/asm/mach-ip27/mmzone.h @@ -22,7 +22,10 @@ struct node_data { extern struct node_data *__node_data[]; -#define NODE_DATA(n) (&__node_data[(n)]->pglist) #define hub_data(n) (&__node_data[(n)]->hub) +extern struct pglist_data *node_data[]; + +#define NODE_DATA(nid) (node_data[nid]) + #endif /* _ASM_MACH_MMZONE_H */ --- a/arch/mips/sgi-ip27/ip27-memory.c~mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures +++ a/arch/mips/sgi-ip27/ip27-memory.c @@ -34,8 +34,10 @@ #define SLOT_PFNSHIFT (SLOT_SHIFT - PAGE_SHIFT) #define PFN_NASIDSHFT (NASID_SHFT - PAGE_SHIFT) -struct node_data *__node_data[MAX_NUMNODES]; +struct pglist_data *node_data[MAX_NUMNODES]; +EXPORT_SYMBOL(node_data); +struct node_data *__node_data[MAX_NUMNODES]; EXPORT_SYMBOL(__node_data); static u64 gen_region_mask(void) @@ -361,6 +363,7 @@ static void __init node_mem_init(nasid_t */ __node_data[node] = __va(slot_freepfn << PAGE_SHIFT); memset(__node_data[node], 0, PAGE_SIZE); + node_data[node] = &__node_data[node]->pglist; NODE_DATA(node)->node_start_pfn = start_pfn; NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn; _ Patches currently in -mm which might be from rppt@xxxxxxxxxx are mm-move-kernel-numac-to-mm.patch mips-sgi-ip27-make-node_data-the-same-as-on-all-other-architectures.patch mips-sgi-ip27-ensure-node_possible_map-only-contains-valid-nodes.patch mips-sgi-ip27-drop-have_arch_nodedata_extension.patch mips-loongson64-rename-__node_data-to-node_data.patch mips-loongson64-drop-have_arch_nodedata_extension.patch arch-mm-move-definition-of-node_data-to-generic-code.patch mm-drop-config_have_arch_nodedata_extension.patch arch-mm-pull-out-allocation-of-node_data-to-generic-code.patch x86-numa-simplify-numa_distance-allocation.patch x86-numa-use-get_pfn_range_for_nid-to-verify-that-node-spans-memory.patch x86-numa-move-fake_node_-defines-to-numa_emu.patch x86-numa_emu-simplify-allocation-of-phys_dist.patch x86-numa_emu-split-__apicid_to_node-update-to-a-helper-function.patch x86-numa_emu-use-a-helper-function-to-get-max_dma32_pfn.patch x86-numa-numa_addremove_cpu-make-cpu-parameter-unsigned.patch mm-introduce-numa_memblks.patch mm-move-numa_distance-and-related-code-from-x86-to-numa_memblks.patch mm-introduce-numa_emulation.patch mm-numa_memblks-introduce-numa_memblks_init.patch mm-numa_memblks-make-several-functions-and-variables-static.patch mm-numa_memblks-use-memblock_startend_of_dram-when-sanitizing-meminfo.patch of-numa-return-einval-when-no-numa-node-id-is-found.patch arch_numa-switch-over-to-numa_memblks.patch arch_numa-switch-over-to-numa_memblks-fix.patch mm-make-range-to-target_node-lookup-facility-a-part-of-numa_memblks.patch docs-move-numa=fake-description-to-kernel-parameterstxt.patch