Re: [PATCH 2/2] mm,memory_hotplug: Replace status_change_nid parameter in memory_notify

Harry Yoo
2025-04-02T02:54:01Z

On Tue, Apr 01, 2025 at 11:27:16AM +0200, Oscar Salvador wrote:
> memory notify consumers are only interested in which node the memory we
> are adding belongs to, so replace current status_change_nid{_normal} fields
> with only one that specifies the node.
>
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> ---

Looks good to me,
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>

> include/linux/memory.h | 3 +--
> mm/memory_hotplug.c | 6 ++----
> mm/page_ext.c | 12 +-----------
> 3 files changed, 4 insertions(+), 17 deletions(-)
>
> diff --git a/mm/page_ext.c b/mm/page_ext.c
> index c351fdfe9e9a..477e6f24b7ab 100644
> --- a/mm/page_ext.c
> +++ b/mm/page_ext.c
> @@ -378,16 +378,6 @@ static int __meminit online_page_ext(unsigned long start_pfn,
> start = SECTION_ALIGN_DOWN(start_pfn);
> end = SECTION_ALIGN_UP(start_pfn + nr_pages);
>
> - if (nid == NUMA_NO_NODE) {
> - /*
> - * In this case, "nid" already exists and contains valid memory.
> - * "start_pfn" passed to us is a pfn which is an arg for
> - * online__pages(), and start_pfn should exist.
> - */
> - nid = pfn_to_nid(start_pfn);
> - VM_BUG_ON(!node_online(nid));
> - }

Ok, now that users who care 'status change' are using node notifier,
mem_arg.nid is the NUMA node the pfn range belongs to,
and always not NUMA_NO_NODE.

> for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION)
> fail = init_section_page_ext(pfn, nid);
> if (!fail)

--
Cheers,
Harry (formerly known as Hyeonggon)