Re: [PATCH] pid: use READ_ONCE() in pid_alive()
From: David Laight
Date: Mon Oct 05 2026 - 14:47:09 EST
On Mon, 5 Oct 2026 17:03:42 +0200
Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> On 10/04, David Laight wrote:
...
> > If the 'add code' all the readers and have to hold the lock then does that
> > leave anything other than task exit doing an rcu-delete.
> > I wouldn't have though acquiring the lock in the task exit code would
> > be noticeable.
>
> Still can't understand. The exiting task does take tasklist when it calls
> detach_pid().
I think I've confused myself :-)
The delete needs the lock to avoid corrupting the list.
It would be safe for an rcu protected reader - but it doesn't help you.
David