]> git.baikalelectronics.ru Git - kernel.git/commit
lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed
authorYejune Deng <yejune.deng@gmail.com>
Mon, 10 May 2021 15:10:24 +0000 (16:10 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 19 May 2021 08:51:40 +0000 (10:51 +0200)
commite4d82ba6c0c1703a373142c219b5554ba3ea3d8d
tree848e23fc4dd2a57a0b17f2a8fc5732d70d59e5c2
parent81e9c9c2c8bff3fa1e5f5b34fd97d935d824b88e
lib/smp_processor_id: Use is_percpu_thread() instead of nr_cpus_allowed

is_percpu_thread() more elegantly handles SMP vs UP, and further checks the
presence of PF_NO_SETAFFINITY. This lets us catch cases where
check_preemption_disabled() can race with a concurrent sched_setaffinity().

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
[Amended changelog]
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210510151024.2448573-3-valentin.schneider@arm.com
lib/smp_processor_id.c