mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [RFC] sched/core: avoid checking in_atomic_preempt_off twice
@ 2023-08-25  2:35 liming.wu
  2023-09-22  9:59 ` [tip: sched/core] sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug() tip-bot2 for Liming Wu
  0 siblings, 1 reply; 2+ messages in thread
From: liming.wu @ 2023-08-25  2:35 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid, brauner,
	linux-kernel, 398776277
  Cc: Liming Wu

From: Liming Wu <liming.wu@jaguarmicro.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@jaguarmicro.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-22  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  2:35 [PATCH] [RFC] sched/core: avoid checking in_atomic_preempt_off twice liming.wu
2023-09-22  9:59 ` [tip: sched/core] sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug() tip-bot2 for Liming Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®