From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Ben Segall <bsegall@google.com>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>, Mel Gorman <mgorman@suse.de>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH] sched: Make preempt_enable_no_resched() behave like preempt_enable() on PREEMPT_RT
Date: Tue, 1 Mar 2022 19:30:32 +0100 [thread overview]
Message-ID: <Yh5mSGCbvqDdeCa3@linutronix.de> (raw)
From: Thomas Gleixner <tglx@linutronix.de>
Use the distinction that has been made earlier between
preempt_enable_no_resched() and sched_preempt_enable_no_resched().
sched_preempt_enable_no_resched() is used within the scheduler where an
immediate schedule() follows. preempt_enable_no_resched() is used
outside of the scheduler and an immediate schedule() invocation may not
follow for other reasons.
The lack of an immediate schedule() invocation matters on PREEMPT_RT
where it will introduce latencies while the scheduler expects a context
switch.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/preempt.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index b4381f255a5ca..582e43856a532 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -210,7 +210,11 @@ do { \
preempt_count_dec(); \
} while (0)
-#define preempt_enable_no_resched() sched_preempt_enable_no_resched()
+#ifdef CONFIG_PREEMPT_RT
+# define preempt_enable_no_resched() preempt_enable()
+#else
+# define preempt_enable_no_resched() sched_preempt_enable_no_resched()
+#endif
#define preemptible() (preempt_count() == 0 && !irqs_disabled())
--
2.35.1
next reply other threads:[~2022-03-01 18:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 18:30 Sebastian Andrzej Siewior [this message]
2022-03-01 20:14 ` Peter Zijlstra
2022-03-01 20:23 ` Sebastian Andrzej Siewior
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=Yh5mSGCbvqDdeCa3@linutronix.de \
--to=bigeasy@linutronix.de \
--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=tglx@linutronix.de \
--cc=vincent.guittot@linaro.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
Powered by JetHome