summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-09-01 09:48:29 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2016-09-01 09:48:29 -0400
commit14625e96ff085f45532848b38c66d51b383e1e49 (patch)
treef6dd6506fb693d948e02096ec4f82e790bf6e138
parent37b31fe3706a00c13052794d9fa63fb625db441c (diff)
download4.8-rt-patches-14625e96ff085f45532848b38c66d51b383e1e49.tar.gz
add down_write variant
-rw-r--r--patches/rt-create-down_write_killable.patch55
-rw-r--r--patches/series1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches/rt-create-down_write_killable.patch b/patches/rt-create-down_write_killable.patch
new file mode 100644
index 00000000000000..4e4ded53552a16
--- /dev/null
+++ b/patches/rt-create-down_write_killable.patch
@@ -0,0 +1,55 @@
+From 9a6dd1fd4530aca9a8d9186e5146bb1c8698c41f Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 31 Aug 2016 11:18:32 -0400
+Subject: [PATCH] rt: create down_write_killable
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/include/linux/rwsem_rt.h b/include/linux/rwsem_rt.h
+index f97860b2e2a4..df9771f00540 100644
+--- a/include/linux/rwsem_rt.h
++++ b/include/linux/rwsem_rt.h
+@@ -59,6 +59,7 @@ extern void rt_down_write_nested_lock(struct rw_semaphore *rwsem,
+ extern void rt__down_read(struct rw_semaphore *rwsem);
+ extern void rt_down_read(struct rw_semaphore *rwsem);
+ extern int rt_down_write_trylock(struct rw_semaphore *rwsem);
++extern int rt_down_write_killable(struct rw_semaphore *rwsem);
+ extern int rt__down_read_trylock(struct rw_semaphore *rwsem);
+ extern int rt_down_read_trylock(struct rw_semaphore *rwsem);
+ extern void __rt_up_read(struct rw_semaphore *rwsem);
+@@ -105,6 +106,11 @@ static inline int down_write_trylock(struct rw_semaphore *sem)
+ return rt_down_write_trylock(sem);
+ }
+
++static inline int down_write_killable(struct rw_semaphore *sem)
++{
++ return rt_down_write_killable(sem);
++}
++
+ static inline void __up_read(struct rw_semaphore *sem)
+ {
+ __rt_up_read(sem);
+diff --git a/kernel/locking/rt.c b/kernel/locking/rt.c
+index d4ab61c1848b..c4e97e4e7dc2 100644
+--- a/kernel/locking/rt.c
++++ b/kernel/locking/rt.c
+@@ -351,6 +351,16 @@ int rt_down_write_trylock(struct rw_semaphore *rwsem)
+ }
+ EXPORT_SYMBOL(rt_down_write_trylock);
+
++int rt_down_write_killable(struct rw_semaphore *rwsem)
++{
++ int ret = rt_mutex_lock_killable(&rwsem->lock);
++
++ if (ret)
++ rwsem_acquire(&rwsem->dep_map, 0, 1, _RET_IP_);
++ return ret;
++}
++EXPORT_SYMBOL(rt_down_write_killable);
++
+ void rt_down_write(struct rw_semaphore *rwsem)
+ {
+ rwsem_acquire(&rwsem->dep_map, 0, 0, _RET_IP_);
+--
+2.5.0
+
diff --git a/patches/series b/patches/series
index 386d55adc54fa0..e507ef6ef5cff4 100644
--- a/patches/series
+++ b/patches/series
@@ -354,6 +354,7 @@ spinlock-types-separate-raw.patch
rtmutex-avoid-include-hell.patch
rtmutex_dont_include_rcu.patch
rt-add-rt-locks.patch
+rt-create-down_write_killable.patch
rtmutex-Use-chainwalking-control-enum.patch
rtmutex-add-a-first-shot-of-ww_mutex.patch
ptrace-fix-ptrace-vs-tasklist_lock-race.patch