Re: [RFC PATCH v1 5/8] sched/proxy: Clear blocked_donor when the donor stops donating
From: Mathieu Desnoyers
Date: Tue Nov 17 2026 - 08:22:35 EST
On 2026-11-16 18:16, John Stultz wrote:
> That said, Its not immediately obvious to me why clearing on
> move_queued_task() is needed? Mostly because: why would a proxy
> blocked task be migrated before wakeup? If a proxy-blocked task were
> migrated away, __schedule() would just proxy migrate it back to the
> current lock owner's rq.
Another task can move it. For example, sched_setaffinity() on the
donor: affine_move_task() calls move_queued_task() for a task that is
queued and not running. The donor is then queued on another runqueue.
If it is woken there, the clear at wake-up runs on that runqueue. It
does not see the owner. The owner still runs on the old CPU, with
blocked_donor pointing at the donor. Your proxy_needs_return()
clear has the same limit. The proxy migration back that you describe
only happens if the new CPU picks the donor before it is woken.
> as you mentioned there's no test case in your test for this logic.
Right. It was found by reading, and I did not try to reproduce it. The
owner would have to stay in the kernel without scheduling while the
donor exits and is freed.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com