[CRIU] [PATCH 3/3] crtoools: add support of stopped tasks

Andrew Vagin avagin at parallels.com
Thu Sep 26 09:24:55 EDT 2013


On Thu, Sep 26, 2013 at 05:17:21PM +0400, Pavel Emelyanov wrote:
> On 09/26/2013 04:39 PM, Andrew Vagin wrote:
> > On Thu, Sep 26, 2013 at 04:10:01PM +0400, Pavel Emelyanov wrote:
> >> On 09/26/2013 02:37 PM, Andrey Vagin wrote:
> >>> @@ -909,8 +910,17 @@ static inline int fork_with_pid(struct pstree_item *item)
> >>>  
> >>>  		item->state = ca.core->tc->task_state;
> >>>  
> >>> -		if (item->state == TASK_DEAD)
> >>> +		switch (item->state) {
> >>> +		case TASK_ALIVE:
> >>> +		case TASK_STOPPED:
> >>> +			break;
> >>> +		case TASK_DEAD:
> >>>  			item->parent->rst->nr_zombies++;
> >>> +			break;
> >>> +		default:
> >>> +			pr_err("Unknown task state %d\n", item->state);
> >>> +			return -1;
> >>> +		}
> >>>  	} else
> >>>  		ca.core = NULL;
> >>>  
> >>> @@ -1389,7 +1399,8 @@ static void finalize_restore(int status)
> >>>  
> >>>  		xfree(ctl);
> >>>  
> >>> -		/* TODO restore the process state */
> >>
> >> Will it work with stopped threads?
> > 
> > A thread can't be stopped separatly.
> 
> O'RLY? Even with sys_tkill()? What if I from shell do kill -STOP $(THREAD_PID)?

The process with all threads will be stopped. If you are using
sys_tkill(), this signal will be delivered to the specified thread, but
the action is the same.

get_signal_to_deliver
	if (sig_kernel_stop(signr)) {
		do_signal_stop

 * do_signal_stop - handle group stop for SIGSTOP and other stop signals
 * @signr: signr causing group stop if initiating

> 
> > .
> > 
> 
> 


More information about the CRIU mailing list