diff -puN mm/migrate.c~faster-node-order mm/migrate.c --- a/mm/migrate.c~faster-node-order 2021-09-17 14:44:58.697476940 -0700 +++ b/mm/migrate.c 2021-09-20 14:31:43.570477095 -0700 @@ -3239,8 +3239,18 @@ static int migration_offline_cpu(unsigne * set_migration_target_nodes(). */ static int __meminit migrate_on_reclaim_callback(struct notifier_block *self, - unsigned long action, void *arg) + unsigned long action, void *_arg) { + struct memory_notify *arg = _arg; + + /* + * Only update the node migration order when a node is + * changing status, like online->offline. This avoids + * the overhead of synchronize_rcu() in most cases. + */ + if (arg->status_change_nid < 0) + return notifier_from_errno(0); + switch (action) { case MEM_GOING_OFFLINE: /* _