aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorOscar Salvador <[email protected]>2025-06-16 13:51:52 +0000
committerAndrew Morton <[email protected]>2025-07-13 23:38:16 +0000
commitcf0b61adf23f2cfaa360cd7d81d224c0bde7f413 (patch)
tree00b15f81058ed466310d98fce29363a8be68072f /mm
parentkernel,cpuset: use node-notifier instead of memory-notifier (diff)
downloadkernel-cf0b61adf23f2cfaa360cd7d81d224c0bde7f413.tar.gz
kernel-cf0b61adf23f2cfaa360cd7d81d224c0bde7f413.zip
mm,mempolicy: use node-notifier instead of memory-notifier
mempolicy is only concerned when a numa node changes its memory state, because it needs to take this node into account for the auto-weighted memory policy system. So stop using the memory notifier and use the new numa node notifer instead. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Oscar Salvador <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Harry Yoo <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Reviewed-by: Rakie Kim <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Gregory Price <[email protected]> Cc: Hyeonggon Yoo <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index b0619d0020c9..1ff7b2174eb7 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -3788,20 +3788,17 @@ static int wi_node_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{
int err;
- struct memory_notify *arg = data;
- int nid = arg->status_change_nid;
-
- if (nid < 0)
- return NOTIFY_OK;
+ struct node_notify *nn = data;
+ int nid = nn->nid;
switch (action) {
- case MEM_ONLINE:
+ case NODE_ADDED_FIRST_MEMORY:
err = sysfs_wi_node_add(nid);
if (err)
pr_err("failed to add sysfs for node%d during hotplug: %d\n",
nid, err);
break;
- case MEM_OFFLINE:
+ case NODE_REMOVED_LAST_MEMORY:
sysfs_wi_node_delete(nid);
break;
}
@@ -3840,7 +3837,7 @@ static int __init add_weighted_interleave_group(struct kobject *mempolicy_kobj)
}
}
- hotplug_memory_notifier(wi_node_notifier, DEFAULT_CALLBACK_PRI);
+ hotplug_node_notifier(wi_node_notifier, DEFAULT_CALLBACK_PRI);
return 0;
err_cleanup_kobj: