]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Reject CPU affinity changes based on task_cpu_possible_mask()
authorWill Deacon <will@kernel.org>
Fri, 30 Jul 2021 11:24:32 +0000 (12:24 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 20 Aug 2021 10:32:59 +0000 (12:32 +0200)
commit2d998dd4af6e39579a1f52432bffcda5098784ec
treeee867fb4f0dc0afd94d240eb949e4d569b85e4d8
parentdb209c8aad224c67d759788e9af687f642e9e07f
sched: Reject CPU affinity changes based on task_cpu_possible_mask()

Reject explicit requests to change the affinity mask of a task via
set_cpus_allowed_ptr() if the requested mask is not a subset of the
mask returned by task_cpu_possible_mask(). This ensures that the
'cpus_mask' for a given task cannot contain CPUs which are incapable of
executing it, except in cases where the affinity is forced.

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>
Reviewed-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20210730112443.23245-6-will@kernel.org
kernel/sched/core.c