Re: patch: do_wait: make PIDTYPE_PID case O(1) instead of O(n)

From: Jim Newsome
Date: Tue Mar 09 2021 - 11:19:03 EST


Thanks for the quick review!

On 3/9/21 02:56, Oleg Nesterov wrote:
> I'd suggest to put this PIDTYPE_PID code into the new function.

Done

> No, you don't need rcu lock, tasklist_lock is sufficient

Done

> This is wrong, you forgot to drop tasklist_lock.

Done

>> + real_parent = !target->real_parent ? target->parent :
>> + target->real_parent;
>
> Hmm, I don't understand the line above... perhaps it connects to the
> question below.

I'd mistakenly thought `real_parent` was NULL if the target wasn't being
traced (or was being traced by the real parent). It looks like indeed
this should always be set, though.

> Afaics, parent/real_parent can't be NULL if pid_task() succeeds.

Done

> Please redo and send V2 ;)

Sent with subject "[PATCH v2] do_wait: make PIDTYPE_PID case O(1)
instead of O(n)"