cgroup/cpuset: simplify the percpu kthreads check in update_tasks_cpumask()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 4 Jul 2023 11:30:49 +0000 (19:30 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 10 Jul 2023 20:24:56 +0000 (10:24 -1000)
kthread_is_per_cpu() can be called directly without checking whether
PF_KTHREAD is set in task->flags. So remove PF_KTHREAD check to make
code more concise.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c

index 58e6f18f01c1b54f3572c16a32a355a9bab771fe..601c40da8e0333c3ea330c9e5e10ba793d9611cf 100644 (file)
@@ -1230,7 +1230,7 @@ static void update_tasks_cpumask(struct cpuset *cs, struct cpumask *new_cpus)
                        /*
                         * Percpu kthreads in top_cpuset are ignored
                         */
-                       if ((task->flags & PF_KTHREAD) && kthread_is_per_cpu(task))
+                       if (kthread_is_per_cpu(task))
                                continue;
                        cpumask_andnot(new_cpus, possible_mask, cs->subparts_cpus);
                } else {