]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rtmutex: Check explicit for TASK_RTLOCK_WAIT.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 28 Sep 2021 15:00:05 +0000 (17:00 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 1 Oct 2021 11:57:52 +0000 (13:57 +0200)
rt_mutex_wake_q_add() needs to  need to distiguish between sleeping
locks (TASK_RTLOCK_WAIT) and normal locks which use TASK_NORMAL to use
the proper wake mechanism.

Instead of checking for != TASK_NORMAL make it more robust and check
explicit for TASK_RTLOCK_WAIT which is the reason why a different wake
mechanism is used.

No functional change.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210928150006.597310-2-bigeasy@linutronix.de
kernel/locking/rtmutex.c

index 6bb116c559b4a0a1d4052c7feccc88d21eefb556..cafc259ec59d39014b2f89984e530e2f6eddcb45 100644 (file)
@@ -449,7 +449,7 @@ static __always_inline void rt_mutex_adjust_prio(struct task_struct *p)
 static __always_inline void rt_mutex_wake_q_add(struct rt_wake_q_head *wqh,
                                                struct rt_mutex_waiter *w)
 {
-       if (IS_ENABLED(CONFIG_PREEMPT_RT) && w->wake_state != TASK_NORMAL) {
+       if (IS_ENABLED(CONFIG_PREEMPT_RT) && w->wake_state == TASK_RTLOCK_WAIT) {
                if (IS_ENABLED(CONFIG_PROVE_LOCKING))
                        WARN_ON_ONCE(wqh->rtlock_task);
                get_task_struct(w->task);