summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch')
-rw-r--r--debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch b/debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch
new file mode 100644
index 000000000..9b3e00f7e
--- /dev/null
+++ b/debian/patches-rt/0061-sched-Make-cond_resched_-lock-variants-consistent-vs.patch
@@ -0,0 +1,54 @@
+From a911a33c8d3dfb4943dc7861dc69c3fe286e26c6 Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Thu, 23 Sep 2021 18:54:37 +0200
+Subject: [PATCH 061/158] sched: Make cond_resched_*lock() variants consistent
+ vs. might_sleep()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.15/older/patches-5.15.10-rt24.tar.xz
+
+Commit 3427445afd26 ("sched: Exclude cond_resched() from nested sleep
+test") removed the task state check of __might_sleep() for
+cond_resched_lock() because cond_resched_lock() is not a voluntary
+scheduling point which blocks. It's a preemption point which requires the
+lock holder to release the spin lock.
+
+The same rationale applies to cond_resched_rwlock_read/write(), but those
+were not touched.
+
+Make it consistent and use the non-state checking __might_resched() there
+as well.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Link: https://lore.kernel.org/r/20210923165357.991262778@linutronix.de
+---
+ include/linux/sched.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index 150670bbc3d6..64e9bdb5d523 100644
+--- a/include/linux/sched.h
++++ b/include/linux/sched.h
+@@ -2062,14 +2062,14 @@ extern int __cond_resched_rwlock_write(rwlock_t *lock);
+ __cond_resched_lock(lock); \
+ })
+
+-#define cond_resched_rwlock_read(lock) ({ \
+- __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
+- __cond_resched_rwlock_read(lock); \
++#define cond_resched_rwlock_read(lock) ({ \
++ __might_resched(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
++ __cond_resched_rwlock_read(lock); \
+ })
+
+-#define cond_resched_rwlock_write(lock) ({ \
+- __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
+- __cond_resched_rwlock_write(lock); \
++#define cond_resched_rwlock_write(lock) ({ \
++ __might_resched(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
++ __cond_resched_rwlock_write(lock); \
+ })
+
+ static inline void cond_resched_rcu(void)
+--
+2.33.1
+