Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm,memory_hotplug: drop status_change_nid parameter from memory_notify

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>

authored by

Oscar Salvador and committed by
Andrew Morton
d2a9721d 1a19c91b

-12
-7
Documentation/core-api/memory-hotplug.rst
··· 59 59 struct memory_notify { 60 60 unsigned long start_pfn; 61 61 unsigned long nr_pages; 62 - int status_change_nid; 63 62 } 64 63 65 64 - start_pfn is start_pfn of online/offline memory. 66 65 - nr_pages is # of pages of online/offline memory. 67 - - status_change_nid is set node id when N_MEMORY of nodemask is (will be) 68 - set/clear. It means a new(memoryless) node gets new memory by online and a 69 - node loses all memory. If this is -1, then nodemask status is not changed. 70 - 71 - If status_changed_nid* >= 0, callback should create/discard structures for the 72 - node if necessary. 73 66 74 67 It is possible to get notified for MEM_CANCEL_ONLINE without having been notified 75 68 for MEM_GOING_ONLINE, and the same applies to MEM_CANCEL_OFFLINE and
-1
include/linux/memory.h
··· 109 109 unsigned long altmap_nr_pages; 110 110 unsigned long start_pfn; 111 111 unsigned long nr_pages; 112 - int status_change_nid; 113 112 }; 114 113 115 114 struct notifier_block;
-4
mm/memory_hotplug.c
··· 1153 1153 struct memory_notify mem_arg = { 1154 1154 .start_pfn = pfn, 1155 1155 .nr_pages = nr_pages, 1156 - .status_change_nid = NUMA_NO_NODE, 1157 1156 }; 1158 1157 struct node_notify node_arg = { 1159 1158 .nid = NUMA_NO_NODE, ··· 1180 1181 if (!node_state(nid, N_MEMORY)) { 1181 1182 /* Adding memory to the node for the first time */ 1182 1183 node_arg.nid = nid; 1183 - mem_arg.status_change_nid = nid; 1184 1184 ret = node_notify(NODE_ADDING_FIRST_MEMORY, &node_arg); 1185 1185 ret = notifier_to_errno(ret); 1186 1186 if (ret) ··· 1902 1904 struct memory_notify mem_arg = { 1903 1905 .start_pfn = start_pfn, 1904 1906 .nr_pages = nr_pages, 1905 - .status_change_nid = NUMA_NO_NODE, 1906 1907 }; 1907 1908 struct node_notify node_arg = { 1908 1909 .nid = NUMA_NO_NODE, ··· 1972 1975 */ 1973 1976 if (nr_pages >= pgdat->node_present_pages) { 1974 1977 node_arg.nid = node; 1975 - mem_arg.status_change_nid = node; 1976 1978 ret = node_notify(NODE_REMOVING_LAST_MEMORY, &node_arg); 1977 1979 ret = notifier_to_errno(ret); 1978 1980 if (ret) {