]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/sparsemem: Provide memory_add_physaddr_to_nid() with CONFIG_NUMA
authorDavid Hildenbrand <david@redhat.com>
Fri, 25 Oct 2024 14:14:52 +0000 (16:14 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Nov 2024 09:26:25 +0000 (10:26 +0100)
virtio-mem uses memory_add_physaddr_to_nid() to determine the NID to use
for memory it adds.

We currently fallback to the dummy implementation in mm/numa.c with
CONFIG_NUMA, which will end up triggering an undesired pr_info_once():

Unknown online node for memory at 0x100000000, assuming node 0

On s390, we map all cpus and memory to node 0, so let's add a simple
memory_add_physaddr_to_nid() implementation that does exactly that,
but without complaining.

Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Link: https://lore.kernel.org/r/20241025141453.1210600-8-david@redhat.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/sparsemem.h

index ff628c50afacf6cb89c6cd3208de491adf1b2b03..6377b7ea8a40a3b89de3517c3488edc51456b07e 100644 (file)
@@ -5,4 +5,12 @@
 #define SECTION_SIZE_BITS      27
 #define MAX_PHYSMEM_BITS       CONFIG_MAX_PHYSMEM_BITS
 
+#ifdef CONFIG_NUMA
+static inline int memory_add_physaddr_to_nid(u64 addr)
+{
+       return 0;
+}
+#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
+#endif /* CONFIG_NUMA */
+
 #endif /* _ASM_S390_SPARSEMEM_H */