linux/debian/patches-rt/0146-rtmutex-rwlock-preserv...

37 lines
1.6 KiB
Diff
Raw Normal View History

2020-10-12 12:52:06 +00:00
From e4589e51a1cfc859492c0a47c62637e8ada67310 Mon Sep 17 00:00:00 2001
Message-Id: <e4589e51a1cfc859492c0a47c62637e8ada67310.1601675152.git.zanussi@kernel.org>
In-Reply-To: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
References: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
2019-01-14 10:08:29 +00:00
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 11 Jan 2019 21:16:31 +0100
2020-09-04 20:10:21 +00:00
Subject: [PATCH 146/333] rtmutex/rwlock: preserve state like a sleeping lock
2020-10-12 12:52:06 +00:00
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.148-rt64.tar.xz
2019-01-14 10:08:29 +00:00
The rwlock is spinning while acquiring a lock. Therefore it must become
a sleeping lock on RT and preserve its task state while sleeping and
waiting for the lock to become available.
Reported-by: Joe Korty <Joe.Korty@concurrent-rt.com>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
2019-04-08 23:49:20 +00:00
kernel/locking/rwlock-rt.c | 2 +-
2019-01-14 10:08:29 +00:00
1 file changed, 1 insertion(+), 1 deletion(-)
2019-04-08 23:49:20 +00:00
diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c
index aebb7ce25bc6..8f90afe111ce 100644
2019-01-14 10:08:29 +00:00
--- a/kernel/locking/rwlock-rt.c
+++ b/kernel/locking/rwlock-rt.c
2019-04-08 23:49:20 +00:00
@@ -128,7 +128,7 @@ void __sched __read_rt_lock(struct rt_rw_lock *lock)
2019-01-14 10:08:29 +00:00
* That would put Reader1 behind the writer waiting on
* Reader2 to call read_unlock() which might be unbound.
*/
- rt_mutex_init_waiter(&waiter, false);
+ rt_mutex_init_waiter(&waiter, true);
rt_spin_lock_slowlock_locked(m, &waiter, flags);
/*
* The slowlock() above is guaranteed to return with the rtmutex is
2020-01-03 23:36:11 +00:00
--
2020-06-22 13:14:16 +00:00
2.17.1
2020-01-03 23:36:11 +00:00