Re: [PATCH] proc: Expose /proc/<pid>/task/<tid>/children unconditionally

From: Andy Lutomirski
Date: Tue Jun 25 2013 - 18:02:01 EST


On Tue, Jun 25, 2013 at 2:52 PM, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
> On Tue, Jun 25, 2013 at 02:36:31PM -0700, Andy Lutomirski wrote:
>> On Tue, Jun 25, 2013 at 1:17 PM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>> > On 06/26, Cyrill Gorcunov wrote:
>> >>
>> >> On Tue, Jun 25, 2013 at 12:51:45PM -0700, Andy Lutomirski wrote:
>> >> > This is currently only available if CONFIG_CHECKPOINT_RESTORE, which
>> >> > is hidden under CONFIG_EXPERT. It's generally useful functionality,
>> >> > though, so expose it unconditionally.
>> >> >
>> >> > Cc: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
>> >> > Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
>> >> Acked-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
>> >
>> > I didn't see the patch but I guess it is trivial and I agree with intent ;)
>>
>> The patch works, but "children" is only listed under task/<tid>, not
>> under /proc/<pid>. Is that intentional? Fixing it would be a
>> one-liner.
>
> Yeah, it's intentional. Here some explanations from Oleg (check out
> the whole thread, it's not that big https://lkml.org/lkml/2011/12/9/220)
> in short this might require some more code, but i'll re-check tomorrow.

This is a little strange. It looks like ppid (in status) shows the
tgid, but the actual real_parent can refer to a thread (as opposed to
a thread group leader), and task/tid/children respects that. So the
tree that you get by following task/tid/ children won't be quite the
same as the tree you get by following ppid.

I wonder if the ptid should be added to status. Is there anything
(other than task/tid/children) that cased which thread is the parent
of a given task?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/