diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-03-22 06:35:51 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-23 14:10:07 -0400 |
commit | 5293c2efda37775346885c7e924d4ef7018ea60b (patch) | |
tree | 77868b67d43f614989c465d06415d6e1a90f5c4b /kernel/locking/rtmutex_common.h | |
parent | fffa954fb528963c2fb7b0c0084eb77e2be7ab52 (diff) |
futex,rt_mutex: Provide futex specific rt_mutex API
Part of what makes futex_unlock_pi() intricate is that
rt_mutex_futex_unlock() -> rt_mutex_slowunlock() can drop
rt_mutex::wait_lock.
This means it cannot rely on the atomicy of wait_lock, which would be
preferred in order to not rely on hb->lock so much.
The reason rt_mutex_slowunlock() needs to drop wait_lock is because it can
race with the rt_mutex fastpath, however futexes have their own fast path.
Since futexes already have a bunch of separate rt_mutex accessors, complete
that set and implement a rt_mutex variant without fastpath for them.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: juri.lelli@arm.com
Cc: bigeasy@linutronix.de
Cc: xlpang@redhat.com
Cc: rostedt@goodmis.org
Cc: mathieu.desnoyers@efficios.com
Cc: jdesfossez@efficios.com
Cc: dvhart@infradead.org
Cc: bristot@redhat.com
Link: http://lkml.kernel.org/r/20170322104151.702962446@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/locking/rtmutex_common.h')
-rw-r--r-- | kernel/locking/rtmutex_common.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h index 856dfff5c33a..af667f61ebcb 100644 --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h | |||
@@ -109,9 +109,14 @@ extern int rt_mutex_start_proxy_lock(struct rt_mutex *lock, | |||
109 | extern int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, | 109 | extern int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, |
110 | struct hrtimer_sleeper *to, | 110 | struct hrtimer_sleeper *to, |
111 | struct rt_mutex_waiter *waiter); | 111 | struct rt_mutex_waiter *waiter); |
112 | |||
112 | extern int rt_mutex_timed_futex_lock(struct rt_mutex *l, struct hrtimer_sleeper *to); | 113 | extern int rt_mutex_timed_futex_lock(struct rt_mutex *l, struct hrtimer_sleeper *to); |
113 | extern bool rt_mutex_futex_unlock(struct rt_mutex *lock, | 114 | extern int rt_mutex_futex_trylock(struct rt_mutex *l); |
114 | struct wake_q_head *wqh); | 115 | |
116 | extern void rt_mutex_futex_unlock(struct rt_mutex *lock); | ||
117 | extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, | ||
118 | struct wake_q_head *wqh); | ||
119 | |||
115 | extern void rt_mutex_adjust_prio(struct task_struct *task); | 120 | extern void rt_mutex_adjust_prio(struct task_struct *task); |
116 | 121 | ||
117 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 122 | #ifdef CONFIG_DEBUG_RT_MUTEXES |