Re: [PATCH v2] mm/memory_hotplug: maintain N_NORMAL_MEMORY during hotplug

Harry Yoo (Oracle)
2026-03-30T08:28:37Z

On Mon, Mar 30, 2026 at 11:57:49AM +0800, Hao Li wrote:
> N_NORMAL_MEMORY is initialized from zone population at boot, but memory
> hotplug currently only updates N_MEMORY. As a result, a node that gains
> normal memory via hotplug can remain invisible to users iterating over
> N_NORMAL_MEMORY, while a node that loses its last normal memory can stay
> incorrectly marked as such.
>
> Restore N_NORMAL_MEMORY maintenance directly in online_pages() and
> offline_pages(). Set the bit when a node that currently lacks normal
> memory onlines pages into a zone <= ZONE_NORMAL, and clear it when
> offlining removes the last present pages from zones <= ZONE_NORMAL.
>
> This restores the intended semantics without bringing back the old
> status_change_nid_normal notifier plumbing which was removed in
> 8d2882a8edb8.
>
> Current users that benefit include list_lru, zswap, nfsd filecache,
> hugetlb_cgroup, and has_normal_memory sysfs reporting.
>
> Fixes: 8d2882a8edb8 ("mm,memory_hotplug: remove status_change_nid_normal and update documentation")

The Fixes: tag indeed looks correct to me.

By the way, MM needs an explicit Cc: stable@vger.kernel.org for backporting.

Since this commit was introduced in v6.17 and we have v6.18 as LTS,
this should to be backported to v6.18.

> Signed-off-by: Hao Li <hao.li@linux.dev>
> ---

Otherwise looks good to me,
Reviewed-by: Harry Yoo (Oracle) <harry@kernel.org>

--
Cheers,
Harry / Hyeonggon