Re: [RFC PATCH v1 0/8] sched/proxy: fixes for proxy execution, with selftests
From: Mathieu Desnoyers
Date: Tue Nov 17 2026 - 08:16:15 EST
Hi John,
Thanks for running the tests on your tree. I answered on patches 1, 2,
4 and 5. The rest is below.
On 2026-11-17 01:28, John Stultz wrote:
>> 3 Stop the chain walk when the blocked_on chain is a cycle, so that a
>> mutex deadlock no longer locks up the CPU.
>
> Already have a fix for this.
deadlock_cycle (case 8) passes on your tree, so please drop mine.
>> 6 Check and admit a proxy-migrated deadline task in its own root
>> domain, so that sched_setattr() no longer fails with EPERM.
>
> This one I couldn't take as it was dependent on your other series.
Only one line of it depends on that series. On tip, that line becomes
task_home_cpu(p) in place of task_cpu(p) in sched_dl_overflow(). I can
post patch 6 on tip if you want to take it.
> Basically after the first two patches tests 6, and 7 continue to fail.
> Interestingly, 7 does pass with proxy-exec off, so I need to look
> closer to understand what is happening in that case that isn't
> dependent on your other DL patch series.
Case 7 is what patch 6 fixes. Its sched_setattr() checks the root
domain of the CPU the waiter was proxy-migrated to. That is the root
domain of the mutex owner, not the waiter's own.
You also see case 6 fail with proxy execution off. It fails the same
way on tip, so it is not a proxy execution bug. The waiter changes its
parameters and then leaves SCHED_DEADLINE while it is blocked. Its
bandwidth stays counted in its root domain:
# total_bw A: before 52428, at 300ms 262143, after 262143
My deadline series fixes this. With it, the case passes with proxy
execution off.
I also ran the selftest on your public proxy-exec-v33-7.4-pre-rc1
branch, with the test module added. The results match yours, except
for case 5: Yu-Ting's fix is not on that branch.
>> - Patch 3 also stops the donation on a ww_mutex cycle that the wound or
>> die path is about to break. The donor then sleeps on its mutex.
>
> Is this a concern or did you verify this occurs? I thought we
> wound/kill tasks before the cycle gets created (see
> __mutex_lock_common(), before we call set_task_blocked_on()). Maybe
> I'm forgetting something?
You are right, and it was not verified. I wrote it from reading, and
my was wrong. A task that wounds or kills another first clears
the blocked_on of that task. The victim sets its blocked_on again under
the wait_lock of its mutex. It then sees that it must back off, and
clears blocked_on before it drops that lock. The chain walk takes the
same lock before it follows the victim. So the walk never sees the
cycle. Please ignore that point.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com