Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1491283
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH -v2 4/9] rtmutex: Remove rt_mutex_fastunlock() |
| Date | 2016-09-26 14:50 +0200 |
| Message-ID | <slDw6-3SS-29@gated-at.bofh.it> (permalink) |
| References | <slDw5-3SS-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
There is but a single user and the previous patch mandates slowfn must
be rt_mutex_slowunlock(), so fold the lot together and save a few
lines.
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/locking/rtmutex.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1377,24 +1377,6 @@ rt_mutex_fasttrylock(struct rt_mutex *lo
return slowfn(lock);
}
-static inline void
-rt_mutex_fastunlock(struct rt_mutex *lock,
- bool (*slowfn)(struct rt_mutex *lock,
- struct wake_q_head *wqh))
-{
- WAKE_Q(wake_q);
-
- if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {
- rt_mutex_deadlock_account_unlock(current);
-
- } else {
- bool deboost = slowfn(lock, &wake_q);
-
- rt_mutex_postunlock(&wake_q, deboost);
- }
-}
-
-
/*
* Undo pi boosting (if necessary) and wake top waiter.
*/
@@ -1501,7 +1483,16 @@ EXPORT_SYMBOL_GPL(rt_mutex_trylock);
*/
void __sched rt_mutex_unlock(struct rt_mutex *lock)
{
- rt_mutex_fastunlock(lock, rt_mutex_slowunlock);
+ WAKE_Q(wake_q);
+
+ if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) {
+ rt_mutex_deadlock_account_unlock(current);
+
+ } else {
+ bool deboost = rt_mutex_slowunlock(lock, &wake_q);
+
+ rt_mutex_postunlock(&wake_q, deboost);
+ }
}
EXPORT_SYMBOL_GPL(rt_mutex_unlock);
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH -v2 0/9] PI and assorted failings Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
[PATCH -v2 5/9] rtmutex: Clean up Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
Re: [PATCH -v2 5/9] rtmutex: Clean up Steven Rostedt <rostedt@goodmis.org> - 2016-09-26 18:20 +0200
Re: [PATCH -v2 5/9] rtmutex: Clean up Thomas Gleixner <tglx@linutronix.de> - 2016-09-29 17:00 +0200
[PATCH -v2 3/9] sched/deadline/rtmutex: Dont miss the dl_runtime/dl_period update Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
Re: [PATCH -v2 3/9] sched/deadline/rtmutex: Dont miss the dl_runtime/dl_period update Steven Rostedt <rostedt@goodmis.org> - 2016-09-26 18:10 +0200
Re: [PATCH -v2 3/9] sched/deadline/rtmutex: Dont miss the dl_runtime/dl_period update Thomas Gleixner <tglx@linutronix.de> - 2016-09-29 17:00 +0200
[PATCH -v2 8/9] rtmutex: Fix PI chain order integrity Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
[PATCH -v2 6/9] sched/rtmutex: Refactor rt_mutex_setprio() Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
Re: [PATCH -v2 6/9] sched/rtmutex: Refactor rt_mutex_setprio() Steven Rostedt <rostedt@goodmis.org> - 2016-09-26 19:00 +0200
[PATCH -v2 7/9] sched,tracing: Update trace_sched_pi_setprio() Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
Re: [PATCH -v2 7/9] sched,tracing: Update trace_sched_pi_setprio() Steven Rostedt <rostedt@goodmis.org> - 2016-09-26 19:10 +0200
Re: [PATCH -v2 7/9] sched,tracing: Update trace_sched_pi_setprio() Peter Zijlstra <peterz@infradead.org> - 2016-09-27 09:50 +0200
[PATCH -v2 4/9] rtmutex: Remove rt_mutex_fastunlock() Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
Re: [PATCH -v2 4/9] rtmutex: Remove rt_mutex_fastunlock() Thomas Gleixner <tglx@linutronix.de> - 2016-09-29 17:00 +0200
[PATCH -v2 9/9] rtmutex: Fix more prio comparisons Peter Zijlstra <peterz@infradead.org> - 2016-09-26 14:50 +0200
csiph-web