[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yh5mSGCbvqDdeCa3@linutronix.de>
Date: Tue, 1 Mar 2022 19:30:32 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: linux-kernel@...r.kernel.org
Cc: Ben Segall <bsegall@...gle.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Mel Gorman <mgorman@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: [PATCH] sched: Make preempt_enable_no_resched() behave like
preempt_enable() on PREEMPT_RT
From: Thomas Gleixner <tglx@...utronix.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@...utronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.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
Powered by blists - more mailing lists