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

From: Wander Lairson Costa
Date: Thu May 04 2023 - 14:30:07 EST


On Thu, May 4, 2023 at 12:23 PM Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> 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/
>

I think that was my confusion in that thread. My understanding is that
CONFIG_PROVE_RAW_LOCK_NESTING will check lock ordering but not
context. I feel my ignorance is blocking me from seeing something that
is obvious to everyone else :/

> Oleg.
>