Re: [PATCH v7 2/3] sched/task: Add the put_task_struct_atomic_safe() function
From: Oleg Nesterov
Date: Thu May 04 2023 - 08:30:57 EST
On 05/04, Peter Zijlstra wrote:
>
> Urgh.. that's plenty horrible. And I'm sure everybody plus kitchen sink
> has already asked why can't we just rcu free the thing unconditionally.
>
> Google only found me an earlier version of this same patch set, but I'm
> sure we've had that discussion many times over the past several years.
Yes... see for example
https://lore.kernel.org/lkml/CAHk-=whtj+aSYftniMRG4xvFE8dmmYyrqcJyPmzStsfj5w9r=w@xxxxxxxxxxxxxx/
We already have an rcu pass before put_task_struct(zombie), see
put_task_struct_rcu_user(), another one look unfortunate.
Oleg.