From: Thomas Gleixner Date: Sat, 18 Dec 2021 09:57:03 +0000 (+0100) Subject: Merge branch 'locking/urgent' into locking/core X-Git-Tag: v5.17-rc1~120^2 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/f16cc980d649e664b8f41e1bbaba50255d24e5d1?hp=-c Merge branch 'locking/urgent' into locking/core Pick up the spin loop condition fix. Signed-off-by: Thomas Gleixner --- f16cc980d649e664b8f41e1bbaba50255d24e5d1 diff --combined kernel/locking/rtmutex.c index 0c1f2e3f019a,1f25a4d7de27..8555c4efe97c --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@@ -1103,11 -1103,8 +1103,11 @@@ static int __sched task_blocks_on_rt_mu * the other will detect the deadlock and return -EDEADLOCK, * which is wrong, as the other waiter is not in a deadlock * situation. + * + * Except for ww_mutex, in that case the chain walk must already deal + * with spurious cycles, see the comments at [3] and [6]. */ - if (owner == task) + if (owner == task && !(build_ww_mutex() && ww_ctx)) return -EDEADLK; raw_spin_lock(&task->pi_lock); @@@ -1382,8 -1379,9 +1382,8 @@@ static bool rtmutex_spin_on_owner(struc * for CONFIG_PREEMPT_RCU=y) * - the VCPU on which owner runs is preempted */ - if (!owner->on_cpu || need_resched() || - !rt_mutex_waiter_is_top_waiter(lock, waiter) || - vcpu_is_preempted(task_cpu(owner))) { + if (!owner_on_cpu(owner) || need_resched() || - rt_mutex_waiter_is_top_waiter(lock, waiter)) { ++ !rt_mutex_waiter_is_top_waiter(lock, waiter)) { res = false; break; }