Re: [RESEND][PATCH v21 2/6] sched/locking: Add blocked_on_state to provide necessary tri-state for proxy return-migration

From: K Prateek Nayak

Date: Thu Sep 18 2025 - 23:38:17 EST


Hello John,

On 9/19/2025 4:37 AM, John Stultz wrote:
> On Mon, Sep 15, 2025 at 2:05 AM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
>> On 9/4/2025 5:51 AM, John Stultz wrote:
>>> --- a/include/linux/sched.h
>>> +++ b/include/linux/sched.h
>>> @@ -815,6 +815,12 @@ struct kmap_ctrl {
>>> #endif
>>> };
>>>
>>> +enum blocked_on_state {
>>> + BO_RUNNABLE,
>>> + BO_BLOCKED,
>>> + BO_WAKING,
>>> +};
>>> +
>>> struct task_struct {
>>> #ifdef CONFIG_THREAD_INFO_IN_TASK
>>> /*
>>> @@ -1234,6 +1240,7 @@ struct task_struct {
>>> struct rt_mutex_waiter *pi_blocked_on;
>>> #endif
>>>
>>> + enum blocked_on_state blocked_on_state;
>>
>> Is there any use of the "blocked_on_state" outside of CONFIG_PROXY_EXEC?
>> If not, should we start thinking about putting the proxy exec specific
>> members behind CONFIG_PROXY_EXEC to avoid bloating the task_struct?
>
> So yeah, your suggestion is a decent one, though it gets a little
> messy in a few spots. I'm working on integrating this and propagating
> it through the full series, and hopefully I can clean it up further.
> There are a few spots where this and other proxy related values do get
> checked, so wrapping those up so they can be ifdef'ed out will require
> some extra logic.

Looking at the proxy-exec-6.17-rc4, most of the direct references to
"p->blocked_on_state" is already under CONFIG_PROXY_EXEC. Only the
functions that modify it needs a stub and a helper for the usage in
task_is_blocked()

--
Thanks and Regards,
Prateek