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] [day] [month] [year] [list]
Message-ID: <yghzleu6pvqzmie77muujhc4ac3dmtjmies3pcwjikrbwp7vvq@qpxo4qmxzhcs>
Date: Wed, 7 May 2025 20:41:11 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Waiman Long <longman@...hat.com>
Cc: Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>, 
	cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cgroup/cpuset: Extend kthread_is_per_cpu() check to all
 PF_NO_SETAFFINITY tasks

Hello.

On Wed, May 07, 2025 at 02:30:11PM -0400, Waiman Long <longman@...hat.com> wrote:
> Commit ec5fbdfb99d1 ("cgroup/cpuset: Enable update_tasks_cpumask()
> on top_cpuset") enabled us to pull CPUs dedicated to child partitions
> from tasks in top_cpuset by ignoring per cpu kthreads. However, there
> can be other kthreads that are not per cpu but have PF_NO_SETAFFINITY
> flag set to indicate that we shouldn't mess with their CPU affinity.
> 
> As all the per cpu kthreads have PF_NO_SETAFFINITY set, fix this
> issue by dropping the kthread_is_per_cpu() check and checking the
> PF_NO_SETAFFINITY flag instead.

I think there's a reason for existence of kthread_is_per_cpu(), so I'd
stick with more robust

-			if (kthread_is_per_cpu(task))
+			if (kthread_is_per_cpu(task) || task->flags & PF_NO_SETAFFINITY)

Perhaps with a comment that illuminates the kthread_is_per_cpu vs
PF_NO_SETAFFINITY difference.

0.02€,
Michal

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ