]> Gentwo Git Trees - linux/.git/commit
mm/memory_hotplug: activate node before adding new memory blocks
authorHannes Reinecke <hare@kernel.org>
Tue, 29 Jul 2025 06:46:35 +0000 (08:46 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Oct 2025 23:42:43 +0000 (16:42 -0700)
commitb8179af120943e2fc099ea87caa234039a709a66
tree3d453c5f1fa931bcdee26618e7e5d0e08dafba98
parentc6a809363a66b8ff0f6a000b5f09408a1b33eeb5
mm/memory_hotplug: activate node before adding new memory blocks

The sysfs attributes for memory blocks require the node ID to be set and
initialized, so move the node activation before adding new memory blocks.
This also has the nice side effect that the BUG_ON() can be converted into
a WARN_ON() as we now can handle registration errors.

Link: https://lkml.kernel.org/r/20250729064637.51662-3-hare@kernel.org
Fixes: b9ff036082cd ("mm/memory_hotplug.c: make add_memory_resource use __try_online_node")
Signed-off-by: Hannes Reinecke <hare@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/base/memory.c
include/linux/memory.h
mm/memory_hotplug.c