mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Miaohe Lin <linmiaohe@huawei.com>,
	tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cgroup/cpuset: simplify the percpu kthreads check in update_tasks_cpumask()
Date: Tue, 4 Jul 2023 23:14:01 -0400	[thread overview]
Message-ID: <bc8202fd-a31c-2b08-bd01-8b5868aab230@redhat.com> (raw)
In-Reply-To: <20230704113049.1019118-1-linmiaohe@huawei.com>

On 7/4/23 07:30, Miaohe Lin wrote:
> 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 {

The initial intention was to ignore only percpu kthreads. The current 
code likely ignore all the kthreads. Removing the PF_KTHREAD flag, 
however, may introduce unexpected regression at this point. I would like 
to hold off for now until more investigation are done.

Thanks,
Longman


  reply	other threads:[~2023-07-05  3:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 11:30 Miaohe Lin
2023-07-05  3:14 ` Waiman Long [this message]
2023-07-05  5:56   ` Miaohe Lin
2023-07-05 14:49     ` Waiman Long
2023-07-10 20:25 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc8202fd-a31c-2b08-bd01-8b5868aab230@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®