diff options
author | 2023-08-25 10:35:00 +0800 | |
---|---|---|
committer | 2023-09-22 11:50:49 +0200 | |
commit | dc461c48deda8a2d243fbaf49e276d555eb833d8 (patch) | |
tree | f5a2140ac7adf43b7bb999f0bc02c01f60e2a03e /kernel/sched/core.c | |
parent | <linux/list.h>: Introduce the list_for_each_reverse() method (diff) | |
download | linux-dc461c48deda8a2d243fbaf49e276d555eb833d8.tar.gz linux-dc461c48deda8a2d243fbaf49e276d555eb833d8.tar.bz2 linux-dc461c48deda8a2d243fbaf49e276d555eb833d8.zip |
sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug()
in_atomic_preempt_off() already gets called in schedule_debug() once,
which is the only caller of __schedule_bug().
Skip the second call within __schedule_bug(), it should always be true
at this point.
[ mingo: Clarified the changelog. ]
Signed-off-by: Liming Wu <liming.wu@jaguarmicro.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230825023501.1848-1-liming.wu@jaguarmicro.com
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 52ceb85b6421..107493469b4e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5899,8 +5899,7 @@ static noinline void __schedule_bug(struct task_struct *prev) print_modules(); if (irqs_disabled()) print_irqtrace_events(prev); - if (IS_ENABLED(CONFIG_DEBUG_PREEMPT) - && in_atomic_preempt_off()) { + if (IS_ENABLED(CONFIG_DEBUG_PREEMPT)) { pr_err("Preemption disabled at:"); print_ip_sym(KERN_ERR, preempt_disable_ip); } |