Re: [PATCH 3/3] mm/memory_hotplug: Cleanup unregister_mem_sect_under_nodes

From: Oscar Salvador
Date: Sat Aug 11 2018 - 04:08:51 EST


On Fri, Aug 10, 2018 at 03:37:27PM -0700, Andrew Morton wrote:
> I guess so. But the node_online() check was silently removed?

A node can only get offline if all the memory and CPUs associated
with it are removed.

This is being checked in remove_memory()->try_offline_node().
There we check whether the node has still valid sections or not,
and if there are still CPUs associated to it.

In the case that either we still have valid sections or that we have
CPUs linked to this node, we do not offline it.

So we cannot really be removing a memory from a node that is offline,
that is why it is safe to drop the check.

It was my mistake not to explain that properly in the changelog though.
I will send a V2 fixing up all you pointed out and explaining
why it is safe to drop the check.

Thanks
--
Oscar Salvador
SUSE L3