[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030093017.6264-G-hca@linux.ibm.com>
Date: Wed, 30 Oct 2024 10:30:17 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-s390@...r.kernel.org, virtualization@...ts.linux.dev,
linux-doc@...r.kernel.org, kvm@...r.kernel.org,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Thomas Huth <thuth@...hat.com>,
Cornelia Huck <cohuck@...hat.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eugenio PĂ©rez <eperezma@...hat.com>,
Eric Farman <farman@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH v3 7/7] s390/sparsemem: provide
memory_add_physaddr_to_nid() with CONFIG_NUMA
On Fri, Oct 25, 2024 at 04:14:52PM +0200, David Hildenbrand wrote:
> 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@...hat.com>
> ---
> arch/s390/include/asm/sparsemem.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
...
> diff --git a/arch/s390/include/asm/sparsemem.h b/arch/s390/include/asm/sparsemem.h
> index ff628c50afac..6377b7ea8a40 100644
> --- a/arch/s390/include/asm/sparsemem.h
> +++ b/arch/s390/include/asm/sparsemem.h
> @@ -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 */
> +
We would need to have the same for phys_to_target_node(), even though
it looks like this won't be used on s390 currently.
Anyway, I'll add that, if I don't forget about it :)
For this patch:
Reviewed-by: Heiko Carstens <hca@...ux.ibm.com>
Powered by blists - more mailing lists