diff options
author | Valentin Schneider <valentin.schneider@arm.com> | 2021-11-12 19:52:02 +0100 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-04-05 10:24:42 +0200 |
commit | 5693fa74f98afed5421ac0165e9e9291bde7d9e1 (patch) | |
tree | 906e800bda569ce6c99b13055d5cb4b6cac6119a /kernel/kcsan | |
parent | preempt/dynamic: Introduce preemption model accessors (diff) | |
download | linux-5693fa74f98afed5421ac0165e9e9291bde7d9e1.tar.xz linux-5693fa74f98afed5421ac0165e9e9291bde7d9e1.zip |
kcsan: Use preemption model accessors
Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual
preemption model of the live kernel. Use the newly-introduced accessors
instead.
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20211112185203.280040-4-valentin.schneider@arm.com
Diffstat (limited to 'kernel/kcsan')
-rw-r--r-- | kernel/kcsan/kcsan_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index a36fca063a73..767dfacd6ed3 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -1380,13 +1380,14 @@ static const void *nthreads_gen_params(const void *prev, char *desc) else nthreads *= 2; - if (!IS_ENABLED(CONFIG_PREEMPT) || !IS_ENABLED(CONFIG_KCSAN_INTERRUPT_WATCHER)) { + if (!preempt_model_preemptible() || + !IS_ENABLED(CONFIG_KCSAN_INTERRUPT_WATCHER)) { /* * Without any preemption, keep 2 CPUs free for other tasks, one * of which is the main test case function checking for * completion or failure. */ - const long min_unused_cpus = IS_ENABLED(CONFIG_PREEMPT_NONE) ? 2 : 0; + const long min_unused_cpus = preempt_model_none() ? 2 : 0; const long min_required_cpus = 2 + min_unused_cpus; if (num_online_cpus() < min_required_cpus) { |