mm/migrate: add CPU hotplug to demotion #ifdef

Once upon a time, the node demotion updates were driven solely by memory
hotplug events.  But now, there are handlers for both CPU and memory

However, the #ifdef around the code checks only memory hotplug.  A
system that has HOTPLUG_CPU=y but MEMORY_HOTPLUG=n would miss CPU
hotplug events.

Update the #ifdef around the common code.  Add memory and CPU-specific
#ifdefs for their handlers.  These memory/CPU #ifdefs avoid unused
function warnings when their Kconfig option is off.

[ rework hotplug_memory_notifier() stub]

Fixes: 884a6e5d1f93 ("mm/migrate: update node demotion order on hotplug events")
Signed-off-by: Dave Hansen <>
Signed-off-by: Arnd Bergmann <>
Cc: "Huang, Ying" <>
Cc: Michal Hocko <>
Cc: Wei Xu <>
Cc: Oscar Salvador <>
Cc: David Rientjes <>
Cc: Dan Williams <>
Cc: David Hildenbrand <>
Cc: Greg Thelen <>
Cc: Yang Shi <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
4 files changed