[RFC PATCH 4/8] arch_numa: Avoid onlining empty NUMA nodes
Yuquan Wang
wangyuquan1236 at phytium.com.cn
Thu Aug 1 00:53:43 PDT 2024
On Wed, May 29, 2024 at 06:12:32PM +0100, Jonathan Cameron wrote:
> ACPI can declare NUMA nodes for memory that will be along later.
> CXL Fixed Memory Windows may also be assigned NUMA nodes that
> are initially empty. Currently the generic arch_numa handling will
> online these empty nodes. This is both inconsistent with x86 and
> with itself as if we add memory and remove it again the node goes
> away.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron at huawei.com>
> ---
> drivers/base/arch_numa.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
> index 5b59d133b6af..0630efb696ab 100644
> --- a/drivers/base/arch_numa.c
> +++ b/drivers/base/arch_numa.c
> @@ -363,6 +363,11 @@ static int __init numa_register_nodes(void)
> unsigned long start_pfn, end_pfn;
>
> get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
> + if (start_pfn >= end_pfn &&
> + !node_state(nid, N_CPU) &&
> + !node_state(nid, N_GENERIC_INITIATOR))
> + continue;
> +
> setup_node_data(nid, start_pfn, end_pfn);
> node_set_online(nid);
> }
> --
> 2.39.2
>
Tested-off-by: Yuquan Wang <wangyuquan1236 at phytium.com.cn>
More information about the linux-arm-kernel
mailing list