The patch titled Subject: mm/memory_hotplug.c: spare unnecessary calls to node_set_state has been added to the -mm tree. Its filename is mm-memory_hotplug-spare-unnecessary-calls-to-node_set_state.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memory_hotplug-spare-unnecessary-calls-to-node_set_state.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memory_hotplug-spare-unnecessary-calls-to-node_set_state.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Oscar Salvador <osalvador@xxxxxxx> Subject: mm/memory_hotplug.c: spare unnecessary calls to node_set_state In node_states_check_changes_online, we check if the node will have to be set for any of the N_*_MEMORY states after the pages have been onlined. Later on, we perform the activation in node_states_set_node. Currently, in node_states_set_node we set the node to N_MEMORY unconditionally. This means that we call node_set_state for N_MEMORY every time pages go online, but we only need to do it if the node has not yet been set for N_MEMORY. Fix this by checking status_change_nid. Link: http://lkml.kernel.org/r/20180919100819.25518-2-osalvador@xxxxxxxxxxxxxxxxxx Signed-off-by: Oscar Salvador <osalvador@xxxxxxx> Reviewed-by: Pavel Tatashin <pavel.tatashin@xxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Cc: <yasu.isimatu@xxxxxxxxx> Cc: Mathieu Malaterre <malat@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/memory_hotplug.c~mm-memory_hotplug-spare-unnecessary-calls-to-node_set_state +++ a/mm/memory_hotplug.c @@ -753,7 +753,8 @@ static void node_states_set_node(int nod if (arg->status_change_nid_high >= 0) node_set_state(node, N_HIGH_MEMORY); - node_set_state(node, N_MEMORY); + if (arg->status_change_nid >= 0) + node_set_state(node, N_MEMORY); } static void __meminit resize_zone_range(struct zone *zone, unsigned long start_pfn, _ Patches currently in -mm which might be from osalvador@xxxxxxx are mm-page_alloc-clean-up-check_for_memory.patch mm-memory_hotplug-spare-unnecessary-calls-to-node_set_state.patch mm-memory_hotplug-tidy-up-node_states_clear_node.patch mm-memory_hotplug-simplify-node_states_check_changes_online.patch mm-memory_hotplug-simplify-node_states_check_changes_online-v2.patch mm-memory_hotplug-clean-up-node_states_check_changes_offline.patch mm-memory_hotplug-clean-up-node_states_check_changes_offline-v2.patch