Re: [RFC PATCH 1/1] sched/proxy_exec: detect cycles in proxy walks
From: Peter Zijlstra
Date: Tue Sep 22 2026 - 03:20:25 EST
On Mon, Sep 21, 2026 at 11:06:52PM -0700, John Stultz wrote:
> > So if we are eventually planning on returning -EDEADLK to userspace
> > (context: https://lore.kernel.org/lkml/20260917153649.GK4121339@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/)
> > do we care where the chain starts or can we return -EDEADLK anywhere
> > in the chain?
>
> So returning EDEADLK to userland seems like a new feature to me, as I
> don't believe existing futexes (which can still have dependency cycles
> or just ABA style usage) currently do this.
git grep -e DEADLK -e DEADLOCK kernel/{futex,locking}
We definitely return -EDEADLK for PI futexes and rt_mutex. And given the
whole proxy thing hard relies on the block graph being acyclic, it
seems rather mandatory we enforce this before exposing it to userspace.