Re: [PATCH 3/4] tty: Iterate only thread group leaders in __do_SAK()

From: Kirill Tkhai
Date: Fri Jan 12 2018 - 03:54:16 EST


On 11.01.2018 21:34, Oleg Nesterov wrote:
> On 01/11, Kirill Tkhai wrote:
>>
>> Since threads can't have additional fd in comparison
>> to thread group leader
> ...
>> as they definitely have the same
>> files struct, as thread group leader.
>
> Hmm. Why? Iirc CLONE_THREAD doesn't require CLONE_FILES?

Oh, it's really so. Surprise. Thanks for pointing that.
I'll try to find a way, how we can iterate threads fds using rcu.

> Also. The group leader can exit, in this case its ->files == NULL
> but other threads can be alive.

Sure, thanks, Oleg.

Kirill