diff options
Diffstat (limited to 'debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch')
-rw-r--r-- | debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch index 4a00f4091..debc6c08a 100644 --- a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner <tglx@linutronix.de> Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> @@ -11,10 +11,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> include/linux/spinlock.h | 12 +++++++++++- include/linux/spinlock_api_smp.h | 4 +++- include/linux/spinlock_types.h | 11 ++++++++--- - kernel/locking/Makefile | 9 ++++++++- + kernel/locking/Makefile | 10 +++++++++- + kernel/locking/rwsem.h | 2 ++ kernel/locking/spinlock.c | 7 +++++++ kernel/locking/spinlock_debug.c | 5 +++++ - 8 files changed, 66 insertions(+), 13 deletions(-) + 9 files changed, 69 insertions(+), 13 deletions(-) --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -67,10 +68,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +#include <linux/rwsem-rt.h> +#else /* PREEMPT_RT_FULL */ + - struct rw_semaphore; - - #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK -@@ -114,6 +118,13 @@ static inline int rwsem_is_contended(str + /* + * For an uncontended rwsem, count and owner are the only fields a task + * needs to touch when acquiring the rwsem. So they are put next to each +@@ -109,6 +113,13 @@ static inline int rwsem_is_contended(str return !list_empty(&sem->wait_list); } @@ -86,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h -@@ -298,7 +298,11 @@ static inline void do_raw_spin_unlock(ra +@@ -307,7 +307,11 @@ static inline void do_raw_spin_unlock(ra }) /* Include rwlock functions */ @@ -99,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: -@@ -309,6 +313,10 @@ static inline void do_raw_spin_unlock(ra +@@ -318,6 +322,10 @@ static inline void do_raw_spin_unlock(ra # include <linux/spinlock_api_up.h> #endif @@ -110,7 +111,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Map the spin_lock functions to the raw variants for PREEMPT_RT=n */ -@@ -429,6 +437,8 @@ static __always_inline int spin_is_conte +@@ -438,6 +446,8 @@ static __always_inline int spin_is_conte #define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) @@ -156,7 +157,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> # and is generally not a function of system call inputs. KCOV_INSTRUMENT := n --obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o +-obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o rwsem-xadd.o +obj-y += semaphore.o percpu-rwsem.o ifdef CONFIG_FUNCTION_TRACER @@ -173,21 +174,35 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> obj-$(CONFIG_LOCKDEP) += lockdep.o ifeq ($(CONFIG_PROC_FS),y) obj-$(CONFIG_LOCKDEP) += lockdep_proc.o -@@ -25,8 +29,11 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o +@@ -25,6 +29,10 @@ obj-$(CONFIG_RT_MUTEXES) += rtmutex.o obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o +ifneq ($(CONFIG_PREEMPT_RT_FULL),y) - obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o - obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem-xadd.o ++obj-y += mutex.o rwsem.o rwsem-xadd.o +endif +obj-$(CONFIG_PREEMPT_RT_FULL) += mutex-rt.o rwsem-rt.o rwlock-rt.o obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o +--- a/kernel/locking/rwsem.h ++++ b/kernel/locking/rwsem.h +@@ -169,6 +169,7 @@ extern struct rw_semaphore *rwsem_down_w + extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); + extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); + ++#ifndef CONFIG_PREEMPT_RT_FULL + /* + * lock for reading + */ +@@ -302,3 +303,4 @@ static inline void __downgrade_write(str + if (tmp < 0) + rwsem_downgrade_wake(sem); + } ++#endif --- a/kernel/locking/spinlock.c +++ b/kernel/locking/spinlock.c -@@ -117,8 +117,11 @@ void __lockfunc __raw_##op##_lock_bh(loc +@@ -124,8 +124,11 @@ void __lockfunc __raw_##op##_lock_bh(loc * __[spin|read|write]_lock_bh() */ BUILD_LOCK_OPS(spin, raw_spinlock); @@ -199,7 +214,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #endif -@@ -202,6 +205,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_ +@@ -209,6 +212,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_ EXPORT_SYMBOL(_raw_spin_unlock_bh); #endif @@ -208,7 +223,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifndef CONFIG_INLINE_READ_TRYLOCK int __lockfunc _raw_read_trylock(rwlock_t *lock) { -@@ -346,6 +351,8 @@ void __lockfunc _raw_write_unlock_bh(rwl +@@ -353,6 +358,8 @@ void __lockfunc _raw_write_unlock_bh(rwl EXPORT_SYMBOL(_raw_write_unlock_bh); #endif @@ -235,7 +250,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void spin_dump(raw_spinlock_t *lock, const char *msg) { -@@ -135,6 +137,7 @@ void do_raw_spin_unlock(raw_spinlock_t * +@@ -139,6 +141,7 @@ void do_raw_spin_unlock(raw_spinlock_t * arch_spin_unlock(&lock->raw_lock); } @@ -243,7 +258,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static void rwlock_bug(rwlock_t *lock, const char *msg) { if (!debug_locks_off()) -@@ -224,3 +227,5 @@ void do_raw_write_unlock(rwlock_t *lock) +@@ -228,3 +231,5 @@ void do_raw_write_unlock(rwlock_t *lock) debug_write_unlock(lock); arch_write_unlock(&lock->raw_lock); } |