Re: [RESEND PATCH] sched: restore the behavior of put_task_struct() for non-rt

From: Sebastian Andrzej Siewior
Date: Mon Aug 11 2025 - 08:16:00 EST


On 2025-08-11 13:21:20 [+0200], Oleg Nesterov wrote:
> On 08/11, Sebastian Andrzej Siewior wrote:
> >
> > On 2025-08-11 12:40:34 [+0200], Oleg Nesterov wrote:
> > >
> > > What exactly do you think we could do regardless of PREEMPT_RT?
> >
> > Do what we do now and have one free path for task_struct regardless if
> > PREEMPT_RT is enabled or not. The one via RCU which delays the freeing
> > until after the grace period.
>
> Ah, got it. I won't really argue, but...
>
> call_rcu() is not free, it obviously delays free_task/etc. To me this
> !PREEMPT_RT optimization makes sense.
>
> But lets forget it for the moment. This patch
>
> https://lore.kernel.org/all/aGvTz5VaPFyj0pBV@xxxxxxxx
> [PATCH v6] sched: do not call __put_task_struct() on rt if pi_blocked_on is set
>
> removed that optimization by mistake, this doesn't even match the changelog.
> I think it should be restored, and this is what the new patch from Luis does.
>
> Then we can discuss this all again and possibly remove it, but this
> should be explicitly documented in the changelog.

Certainly. I am not saying we should keep it as is. The added comment
appears wrong but I am all for getting this merged and then sorting out
later.
Thank you for spotting this ;)

> Oleg.

Sebastian