Re: [PATCH] mm/memory_hotplug: maintain N_NORMAL_MEMORY during hotplug
From: David Hildenbrand (Arm)
Date: Fri Mar 27 2026 - 11:25:11 EST
On 3/27/26 15:44, Vlastimil Babka (SUSE) wrote:
> On 3/27/26 15:38, Joshua Hahn wrote:
>> On Fri, 27 Mar 2026 20:42:47 +0800 Hao Li <hao.li@xxxxxxxxx> wrote:
>>
>> Hello Hao,
>>
>> I hope you are doing well, thank you for the patch!
>>
>>> 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.
>>
>> The second part feels more important than the second part, doing a quick
>> glance through the code I can see a few N_NORMAL_MEMORY iterators that
>
> Note in practice it's unlikely that a node would hotplug normal memory,
> start using it, and then manage to successfully hotremove it, due to
> unmovable allocations. Most likely only ZONE_MOVABLE memory can get hotremoved.
Yes, hotunplug of all normal memory of a node is unlikely. Possible, but
nothing to optimize for.
--
Cheers,
David