[CRIU] [PATCH v7 1/9] restore: Use pstree_pid_cmp helper in pid_rst_prio

Andrey Vagin avagin at virtuozzo.com
Tue Jun 5 01:26:30 MSK 2018


On Mon, Jun 04, 2018 at 10:28:04PM +0300, Cyrill Gorcunov wrote:
> On Mon, Jun 04, 2018 at 11:45:51AM -0700, Andrey Vagin wrote:
> > On Wed, May 23, 2018 at 07:06:07PM +0300, Cyrill Gorcunov wrote:
> > > The pid number is absolutely not a guarantee to
> > > introduce order relationship into pid set because
> > > they might be reused. Instead we should consider
> > > parent->child relationship.
> > 
> > I don't understand this. Could you elaborate with more details?
> > 
> > > 
> > > Otherwise we might get
> > > 
> > >  |  31964  31964  31964       epoll
> > >  |    585  31964  31964           epoll
> > >  |    586  31964  31964           epoll
> > >  |...
> > >  | (04.797121)    585: Error (criu/eventpoll.c:180): epoll: Unexpected state for tfd (id 0 fd 8)
> 
> An example tree is above: comparing only pid numbers we will
> choose 586 as a master and 31964 as a slave, which is wrong
> of course. Instead we should walk over the pid tree and
> find which pid is a master (parent) and which is slave (children)

Why is it wrong? Why is the parent better than a child?


More information about the CRIU mailing list