Re: [PATCH] mm/memory_hotplug: maintain N_NORMAL_MEMORY during hotplug
From: Vlastimil Babka (SUSE)
Date: Mon Mar 30 2026 - 07:45:49 EST
On 3/28/26 05:03, Hao Li wrote:
> On Fri, Mar 27, 2026 at 09:35:54AM -0700, Joshua Hahn wrote:
>> On Fri, 27 Mar 2026 15:44:18 +0100 "Vlastimil Babka (SUSE)" <vbabka@xxxxxxxxxx> wrote:
>>
>> > >> 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.
>> >
>> > But commit 8d2882a8edb8 didn't introduce the current state, or did it?
>>
>> I don't mean to speak on Hao's behalf, but as far as I can tell I think this
>> would have been the commit to introduce the state, since
>> node_states_check_changes_online would set status_change_nid_normal to nid,
>> then nodes_states_set_node would come around and set it to N_NORMAL_MEMORY.
>> Maybe I'm missing something? :0
>
> Thanks for this analysis. I was thinking the same. N_NORMAL_MEMORY is no longer
> updated after this commit.
You're right. Initially I found a much older commit that seemed to remove
updating N_NORMAL_MEMORY shortly after it was introduced. But seems it was
reintroduced later and indeed 8d2882a8edb8 removed it again. Partially my
fault as I reviewed that commit and was blind to that aspect - that it's not
just removing an unused status_change_nid_normal. Thanks for figuring that out!
>>
>> Thanks for the reply, Vlastimil. I hope you have a great day : -)
>> Joshua
>