From: Dan Williams <dan.j.williams@intel.com>
To: Yuquan Wang <wangyuquan1236@phytium.com.cn>,
<Jonathan.Cameron@huawei.com>, <dan.j.williams@intel.com>,
<rppt@kernel.org>, <akpm@linux-foundation.org>,
<david@redhat.com>, <bfaccini@nvidia.com>, <rafael@kernel.org>,
<lenb@kernel.org>, <dave@stgolabs.net>, <dave.jiang@intel.com>,
<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
<ira.weiny@intel.com>, <rrichter@amd.com>, <haibo1.xu@intel.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <chenbaozi@phytium.com.cn>,
Yuquan Wang <wangyuquan1236@phytium.com.cn>
Subject: Re: [RFC PATCH v3 1/2] mm: numa_memblks: introduce numa_add_reserved_memblk
Date: Wed, 26 Mar 2025 19:33:12 -0400 [thread overview]
Message-ID: <67e48eb87206f_13cb2944b@dwillia2-mobl3.amr.corp.intel.com.notmuch> (raw)
In-Reply-To: <20250321023602.2609614-2-wangyuquan1236@phytium.com.cn>
Yuquan Wang wrote:
> With numa_add_reserved_memblk(), kernel could add numa_memblk into
> numa_reserved_meminfo directly.
>
> In previous, such process relies on numa_add_memblk() adding to
> numa_meminfo list first and then uses numa_move_tail_memblk() to
> move one from numa_meminfo to numa_reserved_meminfo.
I would explicitly state the motivation and the use case for the patch.
---
acpi_parse_cfmws() currently adds empty CFMWS ranges to numa_meminfo
with the expectation that numa_cleanup_meminfo moves them to
numa_reserved_meminfo. There is no need for that indirection when it is
known in advance that these unpopulated ranges are meant for
numa_reserved_meminfo in suppot of future hotplug / CXL provisioning.
---
>
> Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
> ---
> include/linux/numa_memblks.h | 1 +
> mm/numa_memblks.c | 16 ++++++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/include/linux/numa_memblks.h b/include/linux/numa_memblks.h
> index dd85613cdd86..991076cba7c5 100644
> --- a/include/linux/numa_memblks.h
> +++ b/include/linux/numa_memblks.h
> @@ -22,6 +22,7 @@ struct numa_meminfo {
> };
>
> int __init numa_add_memblk(int nodeid, u64 start, u64 end);
> +int __init numa_add_reserved_memblk(int nid, u64 start, u64 end);
> void __init numa_remove_memblk_from(int idx, struct numa_meminfo *mi);
>
> int __init numa_cleanup_meminfo(struct numa_meminfo *mi);
> diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
> index ff4054f4334d..e70c76cc46dd 100644
> --- a/mm/numa_memblks.c
> +++ b/mm/numa_memblks.c
> @@ -200,6 +200,22 @@ int __init numa_add_memblk(int nid, u64 start, u64 end)
> return numa_add_memblk_to(nid, start, end, &numa_meminfo);
> }
>
> +/**
> + * numa_add_reserved_memblk - Add one numa_memblk to numa_reserved_meminfo
> + * @nid: NUMA node ID of the new memblk
> + * @start: Start address of the new memblk
> + * @end: End address of the new memblk
> + *
> + * Add a new memblk to the numa_reserved_meminfo.
I would say a bit more here about when to use this function. Something
like:
"numa_cleanup_meminfo() reconciles all numa_memblk instances against
memblock_type information and moves any that intersect reserved ranges
to numa_reserved_meminfo. However, when that information is known ahead
of time add the numa_memblk to numa_reserved_meminfo directly."
With those 2 suggestions you can add:
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
next prev parent reply other threads:[~2025-03-26 23:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 2:36 [RFC PATCH v3 0/2] ACPI: NUMA: debug invalid unused PXM value for CFMWs Yuquan Wang
2025-03-21 2:36 ` [RFC PATCH v3 1/2] mm: numa_memblks: introduce numa_add_reserved_memblk Yuquan Wang
2025-03-26 23:33 ` Dan Williams [this message]
2025-03-21 2:36 ` [RFC PATCH v3 2/2] ACPI: NUMA: debug invalid unused PXM value for CFMWs Yuquan Wang
2025-03-21 11:51 ` Jonathan Cameron
2025-03-26 15:00 ` Mike Rapoport
2025-03-26 23:48 ` Dan Williams
2025-03-26 23:19 ` [RFC PATCH v3 0/2] " Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67e48eb87206f_13cb2944b@dwillia2-mobl3.amr.corp.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=bfaccini@nvidia.com \
--cc=chenbaozi@phytium.com.cn \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=david@redhat.com \
--cc=haibo1.xu@intel.com \
--cc=ira.weiny@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rppt@kernel.org \
--cc=rrichter@amd.com \
--cc=vishal.l.verma@intel.com \
--cc=wangyuquan1236@phytium.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox