From: "tip-bot2 for Liming Wu" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Liming Wu <liming.wu@jaguarmicro.com>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug()
Date: Fri, 22 Sep 2023 09:59:26 -0000 [thread overview]
Message-ID: <169537676655.27769.432100540285605722.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230825023501.1848-1-liming.wu@jaguarmicro.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: dc461c48deda8a2d243fbaf49e276d555eb833d8
Gitweb: https://git.kernel.org/tip/dc461c48deda8a2d243fbaf49e276d555eb833d8
Author: Liming Wu <liming.wu@jaguarmicro.com>
AuthorDate: Fri, 25 Aug 2023 10:35:00 +08:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 22 Sep 2023 11:50:49 +02:00
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
---
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 52ceb85..1074934 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);
}
prev parent reply other threads:[~2023-09-22 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 2:35 [PATCH] [RFC] sched/core: avoid checking in_atomic_preempt_off twice liming.wu
2023-09-22 9:59 ` tip-bot2 for Liming Wu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=169537676655.27769.432100540285605722.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=liming.wu@jaguarmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®