From: Yuquan Wang <wangyuquan1236@phytium.com.cn>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: dan.j.williams@intel.com, rppt@kernel.org, rafael@kernel.org,
lenb@kernel.org, akpm@linux-foundation.org,
alison.schofield@intel.com, rrichter@amd.com,
bfaccini@nvidia.com, haibo1.xu@intel.com, david@redhat.com,
chenhuacai@kernel.org, linux-cxl@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, loongarch@lists.linux.dev
Subject: Re: [PATCH v2] mm: numa_memblks: introduce numa_add_reserved_memblk
Date: Thu, 8 May 2025 09:47:04 +0800 [thread overview]
Message-ID: <aBwNGG2hLMZBO0mh@phytium.com.cn> (raw)
In-Reply-To: <20250507172436.00003888@huawei.com>
On Wed, May 07, 2025 at 05:24:36PM +0100, Jonathan Cameron wrote:
> On Tue, 6 May 2025 14:22:45 +0800
> Yuquan Wang <wangyuquan1236@phytium.com.cn> wrote:
>
> > 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 support of future hotplug / CXL provisioning.
> >
> > Introduce and use numa_add_reserved_memblk() to add the empty CFMWS
> > ranges directly.
> >
> > Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
> This is v2 take 2. There were tags on the previous version (pre longarch
> change).
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> (Also Dan Williams).
>
> Easiest option when this happens is spin a v3 with a change log to
> say the loongarch issue is resolved and you picked up tags.
>
Hi Jonathan,
Thanks for your tips. Would this v2 version trigger the kernel test
robot? It seems like only a new version of patch would trigger that.
I would publish v3 of this patch as soon as possible.
Yuquan
>
> > ---
> >
> > Changes in v2 (Thanks to Dan & Alison):
> > - Use numa_add_reserved_memblk() to replace numa_add_memblk() in acpi_parse_cfmws()
> > - Add comments to describe the usage of numa_add_reserved_memblk()
> > - Updating the commit message to clarify the purpose of the patch
> >
> > By the way, "LoongArch: Introduce the numa_memblks conversion" is in linux-next.
> >
> > drivers/acpi/numa/srat.c | 2 +-
> > include/linux/numa_memblks.h | 1 +
> > mm/numa_memblks.c | 22 ++++++++++++++++++++++
> > 3 files changed, 24 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
> > index 0a725e46d017..751774f0b4e5 100644
> > --- a/drivers/acpi/numa/srat.c
> > +++ b/drivers/acpi/numa/srat.c
> > @@ -453,7 +453,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
> > return -EINVAL;
> > }
> >
> > - if (numa_add_memblk(node, start, end) < 0) {
> > + if (numa_add_reserved_memblk(node, start, end) < 0) {
> > /* CXL driver must handle the NUMA_NO_NODE case */
> > pr_warn("ACPI NUMA: Failed to add memblk for CFMWS node %d [mem %#llx-%#llx]\n",
> > node, start, end);
> > 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..541a99c4071a 100644
> > --- a/mm/numa_memblks.c
> > +++ b/mm/numa_memblks.c
> > @@ -200,6 +200,28 @@ 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.
> > + *
> > + * Usage Case: 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, we use numa_add_reserved_memblk() to add the numa_memblk
> > + * to numa_reserved_meminfo directly.
> > + *
> > + * RETURNS:
> > + * 0 on success, -errno on failure.
> > + */
> > +int __init numa_add_reserved_memblk(int nid, u64 start, u64 end)
> > +{
> > + return numa_add_memblk_to(nid, start, end, &numa_reserved_meminfo);
> > +}
> > +
> > /**
> > * numa_cleanup_meminfo - Cleanup a numa_meminfo
> > * @mi: numa_meminfo to clean up
>
next prev parent reply other threads:[~2025-05-08 1:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 6:22 [PATCH v2] mm: numa_memblks: introduce numa_add_reserved_memblk Yuquan Wang
2025-05-07 1:55 ` Andrew Morton
2025-05-07 15:21 ` Mike Rapoport
2025-05-07 15:20 ` Mike Rapoport
2025-05-07 16:24 ` Jonathan Cameron
2025-05-08 1:47 ` Yuquan Wang [this message]
2025-05-08 1:54 ` Huacai Chen
-- strict thread matches above, loose matches on Subject: below --
2025-04-09 4:01 Yuquan Wang
2025-04-09 9:43 ` Mike Rapoport
2025-03-28 9:21 Yuquan Wang
2025-03-28 13:15 ` kernel test robot
2025-04-03 21:01 ` Dan Williams
2025-04-09 4:08 ` Yuquan Wang
2025-04-09 4:14 ` Dan Williams
2025-03-28 22:53 ` Mike Rapoport
2025-04-03 12:16 ` Jonathan Cameron
2025-04-03 18:37 ` Alison Schofield
2025-04-04 6:29 ` Anshuman Khandual
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=aBwNGG2hLMZBO0mh@phytium.com.cn \
--to=wangyuquan1236@phytium.com.cn \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=bfaccini@nvidia.com \
--cc=chenhuacai@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=haibo1.xu@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=linux-mm@kvack.org \
--cc=loongarch@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=rppt@kernel.org \
--cc=rrichter@amd.com \
/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