Re: [PATCH v7 2/3] sched/task: Add the put_task_struct_atomic_safe() function

From: Oleg Nesterov
Date: Thu May 04 2023 - 11:24:23 EST


On 05/04, Wander Lairson Costa wrote:
>
> On Thu, May 4, 2023 at 11:34 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > static inline void put_task_struct(struct task_struct *t)
> > {
> > if (!refcount_dec_and_test(&t->usage))
> > return;
> >
> > if (IS_ENABLED(CONFIG_PREEMPT_RT) && !preemptible())
> > call_rcu(&t->rcu, __put_task_struct_rcu);
> >
> > __put_task_struct(t);
> > }
> >
>
> That's what v5 [1] does.

Yes, but as Sebastian explained CONFIG_PROVE_RAW_LOCK_NESTING won't like it.

https://lore.kernel.org/all/Y+zFNrCjBn53%2F+Q2@xxxxxxxxxxxxx/

Oleg.