Re: [PATCH] proc.5: document /proc/[pid]/task/[tid]/children

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 04, 2016 at 12:52:54AM +0200, Jann Horn wrote:
...
> > 
> > Thanks for this! I tweaked your text somewhat, and added some
> > details about kernel configuration options, so that now the text
> > reads:
> > 
> >        /proc/[pid]/task/[tid]/children (since Linux 3.5)
> >               A  space-separated  list  of child tasks of this task.
> >               Each child task is represented by its TID.
> > 
> >               This option is intended for  use  by  the  checkpoint-
> >               restore (CRIU) system, and reliably provides a list of
> >               children only  if  all  of  the  child  processes  are
> >               stopped or frozen.  It does not work properly if chil‐
> >               dren of the target task exit while the file  is  being
> >               read!  Exiting children may cause non-exiting children
> >               to be omitted from the list.  This makes  this  inter‐
> >               face  even  more  unreliable  than  classic  PID-based
> >               approaches if the  inspected  task  and  its  children
> >               aren't  frozen,  and most code should probably not use
> >               this interface.

Hi! First of all, sorry for delay. Guys, this is not really true. The same
applies to plain "ls /proc". You can fetch pid from the procfs and then
process get dead just right after you've finished reading. So this interface
works "properly" all the time, but if one needs precise results it should
stop/freeze processes first. In contrary I think it worth switching into
children interface in user-space programs because it incredibly fast.

> > 
> >               Until Linux 4.2, the presence of this  file  was  gov‐
> >               erned by the CONFIG_CHECKPOINT_RESTORE kernel configu‐
> >               ration option.  Since Linux 4.2, it it is governed  by
> >               the CONFIG_PROC_CHILDREN option.
> > 
> > Look okay?
> 
> Looks good to me.



	Cyrill
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux