cpuset: Honour task_cpu_possible_mask() in guarantee_online_cpus()
authorWill Deacon <will@kernel.org>
Fri, 30 Jul 2021 11:24:30 +0000 (12:24 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 20 Aug 2021 10:32:59 +0000 (12:32 +0200)
commit431c69fac05baa7477d61a44f2708e069f2bed6c
tree0a9b5e92c190187b22999f9065cb664408da5ffb
parentd4b96fb92ae7fe7533e11e662504d96161928575
cpuset: Honour task_cpu_possible_mask() in guarantee_online_cpus()

Asymmetric systems may not offer the same level of userspace ISA support
across all CPUs, meaning that some applications cannot be executed by
some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do
not feature support for 32-bit applications on both clusters.

Modify guarantee_online_cpus() to take task_cpu_possible_mask() into
account when trying to find a suitable set of online CPUs for a given
task. This will avoid passing an invalid mask to set_cpus_allowed_ptr()
during ->attach() and will subsequently allow the cpuset hierarchy to be
taken into account when forcefully overriding the affinity mask for a
task which requires migration to a compatible CPU.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <Valentin.Schneider@arm.com>
Link: https://lkml.kernel.org/r/20210730112443.23245-4-will@kernel.org
include/linux/cpuset.h
kernel/cgroup/cpuset.c