cgroup: A fix for v6.15-rc6

One low-risk patch to fix a cpuset bug where it over-eagerly tries to modify
 CPU affinity of kernel threads.
 -----BEGIN PGP SIGNATURE-----
 
 iIQEABYKACwWIQTfIjM1kS57o3GsC/uxYfJx3gVYGQUCaCKVJA4cdGpAa2VybmVs
 Lm9yZwAKCRCxYfJx3gVYGZJ7AQDJIOHkmRvDnSnwdsaQ7hvsU1afNEWjGsvKcLtp
 VXQUFwD/UIgSc5miCkgi5ucphlr6Vxxnq0PW7hf7KRhdzhqwagg=
 =j/Y4
 -----END PGP SIGNATURE-----

Merge tag 'cgroup-for-6.15-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup fix from Tejun Heo:
 "One low-risk patch to fix a cpuset bug where it over-eagerly tries to
  modify CPU affinity of kernel threads"

* tag 'cgroup-for-6.15-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup/cpuset: Extend kthread_is_per_cpu() check to all PF_NO_SETAFFINITY tasks
This commit is contained in:
Linus Torvalds 2025-05-12 17:58:57 -07:00
commit d471045e75
1 changed files with 4 additions and 2 deletions

View File

@ -1116,9 +1116,11 @@ void cpuset_update_tasks_cpumask(struct cpuset *cs, struct cpumask *new_cpus)
if (top_cs) {
/*
* Percpu kthreads in top_cpuset are ignored
* PF_NO_SETAFFINITY tasks are ignored.
* All per cpu kthreads should have PF_NO_SETAFFINITY
* flag set, see kthread_set_per_cpu().
*/
if (kthread_is_per_cpu(task))
if (task->flags & PF_NO_SETAFFINITY)
continue;
cpumask_andnot(new_cpus, possible_mask, subpartitions_cpus);
} else {