[CRIU] [PATCH 13/14] restore: collect signals from zombies (v2)
Andrew Vagin
avagin at parallels.com
Fri Jan 18 07:20:23 EST 2013
On Fri, Jan 18, 2013 at 02:36:36PM +0400, Pavel Emelyanov wrote:
> > +
> > + for_each_pstree_item(pi) {
> > + if (pi->state == TASK_HELPER)
> > + continue;
> > + ret = (int) futex_get(&task_entries->nr_in_progress);
> > + if (ret < 0)
> > + goto out;
> > + futex_set_and_wake(&task_entries->pid, pi->pid.virt);
> > + pr_info("Wait %d\n", pi->pid.virt);
> > + futex_wait_while(&task_entries->nr_in_progress, ret);
> > + }
> > +
>
> > @@ -749,6 +755,10 @@ long __export_restore_task(struct task_restore_core_args *args)
> > act.rt_sa_restorer = cr_restore_rt;
> > sys_sigaction(SIGCHLD, &act, NULL, sizeof(rt_sigset_t));
> >
> > + restore_finish_stage(CR_STATE_RESTORE_PREP_ZOMBIES);
> > + futex_wait_until(&task_entries->pid, my_pid);
> > + restore_finish_stage(CR_STATE_RESTORE_ZOMBIES);
>
> Why do we need to serialize the alive tasks restoration?
Alive tasks handles SIGCHLD in sigzombie_handler.
crtools doesn't know who is alive and who is not alive.
>
> > +
> > sys_sigaction(SIGCHLD, &args->sigchld_act, NULL, sizeof(rt_sigset_t));
> >
> > ret = restore_signals(args->siginfo, args->siginfo_nr, 1);
> >
>
>
More information about the CRIU
mailing list