From: liming.wu@jaguarmicro.com
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com, brauner@kernel.org,
linux-kernel@vger.kernel.org, 398776277@qq.com
Cc: Liming Wu <liming.wu@jaguarmicro.com>
Subject: [PATCH] [RFC] sched/core: avoid checking in_atomic_preempt_off twice
Date: Fri, 25 Aug 2023 10:35:00 +0800 [thread overview]
Message-ID: <20230825023501.1848-1-liming.wu@jaguarmicro.com> (raw)
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
next reply other threads:[~2023-08-25 2:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 2:35 liming.wu [this message]
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
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=20230825023501.1848-1-liming.wu@jaguarmicro.com \
--to=liming.wu@jaguarmicro.com \
--cc=398776277@qq.com \
--cc=brauner@kernel.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/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®