[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230825023501.1848-1-liming.wu@jaguarmicro.com>
Date: Fri, 25 Aug 2023 10:35:00 +0800
From: liming.wu@...uarmicro.com
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com, brauner@...nel.org,
linux-kernel@...r.kernel.org, 398776277@...com
Cc: Liming Wu <liming.wu@...uarmicro.com>
Subject: [PATCH] [RFC] sched/core: avoid checking in_atomic_preempt_off twice
From: Liming Wu <liming.wu@...uarmicro.com>
in_atomic_preempt_off is checked twice in schedule_debug, and
__schedule_bug only called in schedule_debug. remove the redundant
in_atomic_preempt_off check in __schedule_bug.
Signed-off-by: Liming Wu <liming.wu@...uarmicro.com>
---
kernel/sched/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a68d1276bab0..ae44958b3851 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5884,8 +5884,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);
}
--
2.25.1
Powered by blists - more mailing lists