lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 4 Jul 2023 23:14:01 -0400
From:   Waiman Long <longman@...hat.com>
To:     Miaohe Lin <linmiaohe@...wei.com>, tj@...nel.org,
        hannes@...xchg.org, lizefan.x@...edance.com
Cc:     cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cgroup/cpuset: simplify the percpu kthreads check in
 update_tasks_cpumask()

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ