lkml.org 
[lkml]   [2023]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] cgroup/cpuset: simplify the percpu kthreads check in update_tasks_cpumask()
    Date
    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>
    ---
    kernel/cgroup/cpuset.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
    index 58e6f18f01c1..601c40da8e03 100644
    --- a/kernel/cgroup/cpuset.c
    +++ b/kernel/cgroup/cpuset.c
    @@ -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 {
    --
    2.33.0
    \
     
     \ /
      Last update: 2023-07-04 13:31    [W:5.775 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site