On 6/30/26 10:14 PM, Ridong Chen wrote:
@@ -3203,28 +3208,60 @@ static void cpuset_attach_task(struct cpuset
*cs, struct task_struct *task)
*/
WARN_ON_ONCE(set_cpus_allowed_ptr(task, cpus_attach));
+ if (cpuset_v2() && !attach_ctx.mems_updated)
+ return;
+
cpuset_change_task_nodemask(task, &attach_ctx.nodemask_to);
cpuset1_update_task_spread_flags(cs, task);
+
+ if ((task != task->group_leader) ||
+ (!is_memory_migrate(cs) && !attach_ctx.mems_updated))
+ return;
+
Nit.
IIUC, the !is_memory_migrate(cs) check may be unnecessary. Previously,
placing this condition outside could prevent an unnecessary loop, but
in its current position, it appears redundant.
if (task != task->group_leader ||
!attach_ctx.mems_updated)
You are right. The is_memory_migrate(cs) check is unnecessary. Will
remove it in the next version.
Cheers,
Longman