Re: [PATCH v9 21/33] rtmutex: Continue the walk when the owner's top waiter changes lock
From: Mathieu Desnoyers
Date: Fri Nov 20 2026 - 14:39:48 EST
> Can this !task_has_pi_waiters(task) check still stop a deboost chain walk
> early and leave the next owner with a stale priority or dangling
> SCHED_DEADLINE donor?
Yes, but not in this order. When X times out first, its
remove_waiter() makes W's waiter the top pi waiter of M. So step 2
goes on.
The walk does stop if W times out first. O, M and X are SCHED_OTHER
tasks. W is a SCHED_DEADLINE task. Another task, S, changes the policy
of W:
O M S W X
locks L2 locks L1
blocks on L2
blocks on L1
M, O get W's parameters
blocks on L1
sched_setscheduler(W)
walk at L1: W behind X,
M deboosted
times out on L1
not top waiter: no walk
times out on L1
M: no pi waiters
walk from M:
preempted
walk at M:
no pi waiters, stops
exits
O keeps W's parameters until X's walk reaches it.
v10 will remove this check too, as you propose. Then S's walk requeues
M's waiter on L2 and deboosts O. But a walk from a waiter that leaves
can still come late, with no help from this check. So v10 will also
hold a reference on the donor's task_struct while a boost points at
it. The new patch is "sched/deadline: Hold a reference on the deadline
donor of a boosted task".
No case will test this order. It needs a walk preempted at the right
step.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com