diff mbox series

[RFC,5/8] arch_numa: Make numa_add_memblk() set nid for memblock.reserved regions

Message ID 20240529171236.32002-6-Jonathan.Cameron@huawei.com (mailing list archive)
State New, archived
Headers show
Series arm64/memblock: Handling of CXL Fixed Memory Windows. | expand

Commit Message

Jonathan Cameron May 29, 2024, 5:12 p.m. UTC
Setting the reserved region entries to the appropriate Node ID means
that they can be used to establish the node to which we should add
hotplugged CXL memory within a CXL fixed memory window.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/base/arch_numa.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Yuquan Wang Aug. 1, 2024, 7:54 a.m. UTC | #1
On Wed, May 29, 2024 at 06:12:33PM +0100, Jonathan Cameron wrote:
> Setting the reserved region entries to the appropriate Node ID means
> that they can be used to establish the node to which we should add
> hotplugged CXL memory within a CXL fixed memory window.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/base/arch_numa.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
> index 0630efb696ab..568dbabeb636 100644
> --- a/drivers/base/arch_numa.c
> +++ b/drivers/base/arch_numa.c
> @@ -208,6 +208,13 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
>  			start, (end - 1), nid);
>  		return ret;
>  	}
> +	/* Also set reserved nodes nid */
> +	ret = memblock_set_node(start, (end - start), &memblock.reserved, nid);
> +	if (ret < 0) {
> +		pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n",
> +			start, (end - 1), nid);
> +		return ret;
> +	}
>  
>  	node_set(nid, numa_nodes_parsed);
>  	return ret;
> -- 
> 2.39.2
>

Tested-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
diff mbox series

Patch

diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c
index 0630efb696ab..568dbabeb636 100644
--- a/drivers/base/arch_numa.c
+++ b/drivers/base/arch_numa.c
@@ -208,6 +208,13 @@  int __init numa_add_memblk(int nid, u64 start, u64 end)
 			start, (end - 1), nid);
 		return ret;
 	}
+	/* Also set reserved nodes nid */
+	ret = memblock_set_node(start, (end - start), &memblock.reserved, nid);
+	if (ret < 0) {
+		pr_err("memblock [0x%llx - 0x%llx] failed to add on node %d\n",
+			start, (end - 1), nid);
+		return ret;
+	}
 
 	node_set(nid, numa_nodes_parsed);
 	return ret;