Re: [PATCH v2 2/3] cgroup/cpuset: Skip security check for hotplug induced v1 task migration

From: Tejun Heo

Date: Mon Mar 30 2026 - 14:21:18 EST


Hello,

On Mon, Mar 30, 2026 at 12:15:01PM -0400, Waiman Long wrote:
...
> > If there are many tasks in the cpuset that has no CPUs, they will be migrated
> > one by one. I'm afraid that only the first task will succeed, and the rest will
> > fail because the flag is cleared after processing the first one.
>
> The setsched_check flag is used in the cgroup_taskset_for_each() loop below.
> That loop is going to iterate all the tasks to be migrated and so the flag
> will apply to all of them. So it is not just the first one.

During migration, a taskset is used to group tasks in a thread group if
cgroup_migrate() called with %true @threadgroup. That doens't really apply
here. cgroup_transfer_tasks() doesn't set @threadgroup and even if it were
to set set, there can just be multiple procesess. Besides, it's rather odd
for it be a one-shot param that gets cleared deep in the stack. Wouldn't it
make more sense to make whoever sets it to be responsible for clearing it?

Thanks.

--
tejun