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

From: Waiman Long

Date: Fri Mar 27 2026 - 21:42:37 EST



On 3/27/26 4:22 PM, Tejun Heo wrote:
On Fri, Mar 27, 2026 at 04:15:46PM -0400, Waiman Long wrote:
+ /*
+ * Set to true if a kthread is moving tasks away from a v1 cpuset with
+ * no CPUs
+ */
+ kthread_move_task_from_empty_cs = !cpuset_v2() &&
+ cpumask_empty(oldcs->effective_cpus) &&
+ (current->flags & PF_KTHREAD);
PF_KTHREAD test seems odd. Can't you pass this in as a flag from hotplug
handler?

Yes, I can added a new CS flag like CS_TASK_MIGRATION in the hotplug handler to indicate that task migration is allowed. Thanks for the suggestion. I will send a v2 with that change.

Cheers,
Longman