]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm,memory_hotplug: drop status_change_nid parameter from memory_notify
authorOscar Salvador <osalvador@suse.de>
Mon, 16 Jun 2025 13:51:54 +0000 (15:51 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 13 Jul 2025 23:38:17 +0000 (16:38 -0700)
There no users left of status_change_nid, so drop it from memory_notify
struct.

Link: https://lkml.kernel.org/r/20250616135158.450136-12-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Suggested-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Harry Yoo <harry.yoo@oracle.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Joanthan Cameron <Jonathan.Cameron@huawei.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/core-api/memory-hotplug.rst
include/linux/memory.h
mm/memory_hotplug.c

index fb84e78968b2743eca0c6e42fe6da5a5a800f314..8fc97c2379de866773f507fe325f5065f54d9058 100644 (file)
@@ -59,17 +59,10 @@ The third argument (arg) passes a pointer of struct memory_notify::
        struct memory_notify {
                unsigned long start_pfn;
                unsigned long nr_pages;
-               int status_change_nid;
        }
 
 - start_pfn is start_pfn of online/offline memory.
 - nr_pages is # of pages of online/offline memory.
-- status_change_nid is set node id when N_MEMORY of nodemask is (will be)
-  set/clear. It means a new(memoryless) node gets new memory by online and a
-  node loses all memory. If this is -1, then nodemask status is not changed.
-
-  If status_changed_nid* >= 0, callback should create/discard structures for the
-  node if necessary.
 
 It is possible to get notified for MEM_CANCEL_ONLINE without having been notified
 for MEM_GOING_ONLINE, and the same applies to MEM_CANCEL_OFFLINE and
index a8284d41e452ba3d05e21a5cb6f270ec79bd1cb8..40eb70ccb09d5ebd0033b68e923cce75cd708dd8 100644 (file)
@@ -109,7 +109,6 @@ struct memory_notify {
        unsigned long altmap_nr_pages;
        unsigned long start_pfn;
        unsigned long nr_pages;
-       int status_change_nid;
 };
 
 struct notifier_block;
index 0d54a01985ba3008613bce3ccfd251def6425e13..a371d59cc71897305dcd8d4a3b3daabeea5ae400 100644 (file)
@@ -1153,7 +1153,6 @@ int online_pages(unsigned long pfn, unsigned long nr_pages,
        struct memory_notify mem_arg = {
                .start_pfn = pfn,
                .nr_pages = nr_pages,
-               .status_change_nid = NUMA_NO_NODE,
        };
        struct node_notify node_arg = {
                .nid = NUMA_NO_NODE,
@@ -1181,7 +1180,6 @@ int online_pages(unsigned long pfn, unsigned long nr_pages,
        if (!node_state(nid, N_MEMORY)) {
                /* Adding memory to the node for the first time */
                node_arg.nid = nid;
-               mem_arg.status_change_nid = nid;
                ret = node_notify(NODE_ADDING_FIRST_MEMORY, &node_arg);
                ret = notifier_to_errno(ret);
                if (ret)
@@ -1904,7 +1902,6 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
        struct memory_notify mem_arg = {
                .start_pfn = start_pfn,
                .nr_pages = nr_pages,
-               .status_change_nid = NUMA_NO_NODE,
        };
        struct node_notify node_arg = {
                .nid = NUMA_NO_NODE,
@@ -1975,7 +1972,6 @@ int offline_pages(unsigned long start_pfn, unsigned long nr_pages,
         */
        if (nr_pages >= pgdat->node_present_pages) {
                node_arg.nid = node;
-               mem_arg.status_change_nid = node;
                ret = node_notify(NODE_REMOVING_LAST_MEMORY, &node_arg);
                ret = notifier_to_errno(ret);
                if (ret) {