diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-03-26 18:29:44 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-03-29 16:57:05 +0300 |
commit | a51a327f3bcdcb1a37ed9325ad07e1456cd4d426 (patch) | |
tree | a2ce5dfc355e3bf737fc8be0e0661ba40f2f46ec /kernel/locking/rtmutex.c | |
parent | c2c360ed7f28fd6b7eb7e39e70af2d2ae405f466 (diff) | |
download | linux-a51a327f3bcdcb1a37ed9325ad07e1456cd4d426.tar.xz |
locking/rtmutex: Clean up signal handling in __rt_mutex_slowlock()
The signal handling in __rt_mutex_slowlock() is open coded.
Use signal_pending_state() instead.
Aside of the cleanup this also prepares for the RT lock substituions which
require support for TASK_KILLABLE.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210326153944.533811987@linutronix.de
Diffstat (limited to 'kernel/locking/rtmutex.c')
-rw-r--r-- | kernel/locking/rtmutex.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index c68542dbbd0a..406818196a9f 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1146,18 +1146,13 @@ static int __sched __rt_mutex_slowlock(struct rt_mutex *lock, int state, if (try_to_take_rt_mutex(lock, current, waiter)) break; - /* - * TASK_INTERRUPTIBLE checks for signals and - * timeout. Ignored otherwise. - */ - if (likely(state == TASK_INTERRUPTIBLE)) { - /* Signal pending? */ - if (signal_pending(current)) - ret = -EINTR; - if (timeout && !timeout->task) - ret = -ETIMEDOUT; - if (ret) - break; + if (timeout && !timeout->task) { + ret = -ETIMEDOUT; + break; + } + if (signal_pending_state(state, current)) { + ret = -EINTR; + break; } raw_spin_unlock_irq(&lock->wait_lock); |