Re: [PATCH v5 3/3] mm/mempolicy: Support memory hotplug in weighted interleave
From: Gregory Price
Date: Wed Apr 02 2025 - 10:18:42 EST
On Wed, Apr 02, 2025 at 11:51:17AM +0200, Oscar Salvador wrote:
> > + case MEM_OFFLINE:
> > + if (!node_state(nid, N_MEMORY))
> > + sysfs_wi_node_release(nid);
>
> This check is not needed.
>
> If status_change_nid is different than NUMA_NO_NODE, it means that the memory
> state of the numa node was effectively changed.
> So doing:
>
> case MEM_OFFLINE:
> sysfs_wi_node_release(nid)
>
> is enough.
offline_pages will call this callback unconditionally any time it's
called (and succeeds). If 2 dax devices online into the same node, it's
possible to offline one chunk of blocks without offlining the other
chunks of blocks - which is why we did the additional check.
~Gregory