]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drivers,hmat: use node-notifier instead of memory-notifier
authorOscar Salvador <osalvador@suse.de>
Mon, 16 Jun 2025 13:51:50 +0000 (15:51 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 13 Jul 2025 23:38:16 +0000 (16:38 -0700)
hmat driver is only concerned when a numa node changes its memory state,
specifically when a numa node with memory comes into play for the first
time, because it will register the memory_targets belonging to that numa
node.  So stop using the memory notifier and use the new numa node notifer
instead.

Link: https://lkml.kernel.org/r/20250616135158.450136-8-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/acpi/numa/hmat.c

index 9d9052258e924e0cc3c47b0bd4772b1df67f3ed1..4958301f541796e1dfdcdf16dccd357df21061bf 100644 (file)
@@ -962,10 +962,10 @@ static int hmat_callback(struct notifier_block *self,
                         unsigned long action, void *arg)
 {
        struct memory_target *target;
-       struct memory_notify *mnb = arg;
-       int pxm, nid = mnb->status_change_nid;
+       struct node_notify *nn = arg;
+       int pxm, nid = nn->nid;
 
-       if (nid == NUMA_NO_NODE || action != MEM_ONLINE)
+       if (action != NODE_ADDED_FIRST_MEMORY)
                return NOTIFY_OK;
 
        pxm = node_to_pxm(nid);
@@ -1118,7 +1118,7 @@ static __init int hmat_init(void)
        hmat_register_targets();
 
        /* Keep the table and structures if the notifier may use them */
-       if (hotplug_memory_notifier(hmat_callback, HMAT_CALLBACK_PRI))
+       if (hotplug_node_notifier(hmat_callback, HMAT_CALLBACK_PRI))
                goto out_put;
 
        if (!hmat_set_default_dram_perf())