[CRIU] [PATCH 13/14] restore: collect signals from zombies (v2)

Pavel Emelyanov xemul at parallels.com
Fri Jan 18 05:36:36 EST 2013


> +
> +	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?

> +
>  	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