Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Sukadev Bhattiprolu
	<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Containers
	<containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH][cr]: Ghost tasks must not be detached in kernel
Date: Mon, 10 Jan 2011 20:51:20 -0500	[thread overview]
Message-ID: <4D2BB798.4050500@cs.columbia.edu> (raw)
In-Reply-To: <20101211033315.GA12292-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>


Merged into v23-rc1.

Thanks,

Oren.

On 12/10/2010 10:33 PM, Sukadev Bhattiprolu wrote:
> Oren,
> 
> As discussed (a while ago)
> 
> https://lists.linux-foundation.org/pipermail/containers/2010-November/025905.html
> 
> here is a patch. I will send a follow-on user-cr patch to mark
> the task detached in user-space.
> 
> ---
> 
> From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> Date: Fri, 10 Dec 2010 18:37:17 -0800
> Subject: [PATCH 1/1] Ghost tasks must not be detached in kernel
> 
> Ghost tasks are "temporary" tasks created during sys_restart() to
> restore "orphaned" sessions/process groups (i.e. those in which the
> original session/pgrp leader had exited before checkpoint but other
> processes exist in that session/pgrp).
> 
> We only create the ghost task so we have a valid session/pgrp that
> the other processes in the session/pgrp can use. Once those other
> processes are created, the ghost tasks must silently vanish (without
> sending another SIGCHLD).
> 
> do_ghost_task() was setting the exit_signal to -1 so the ghosts don't
> send a signal. But rather than set the ->exit_signal here, the caller
> (i.e user-space) can create the ghost task by explicitly setting the
> CSIGNAL mask to 0xFF. i.e it is not something the we need to do in the
> kernel.
> 
> The downside of marking the task detached in do_ghost_task() is that
> with current/older kernels container-init does not wait for detached
> tasks.  See:
> 
> 	http://lkml.org/lkml/2010/6/16/272
> 	http://lkml.org/lkml/2010/7/12/213
> 
> This can lead to a kernel crash if the container-init pre-deceases a
> ghost task.
> 
> Signed-off-by: Sukadev Bhattiprolu (sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org)
> ---
>  kernel/checkpoint/restart.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/checkpoint/restart.c b/kernel/checkpoint/restart.c
> index 17270b8..2bb7197 100644
> --- a/kernel/checkpoint/restart.c
> +++ b/kernel/checkpoint/restart.c
> @@ -972,7 +972,6 @@ static int do_ghost_task(void)
>  	if (ret < 0)
>  		ckpt_err(ctx, ret, "ghost restart failed\n");
>  
> -	current->exit_signal = -1;
>  	restore_debug_exit(ctx);
>  	ckpt_ctx_put(ctx);
>  	do_exit(0);

      parent reply	other threads:[~2011-01-11  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-11  3:33 [PATCH][cr]: Ghost tasks must not be detached in kernel Sukadev Bhattiprolu
     [not found] ` <20101211033315.GA12292-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2011-01-11  1:51   ` Oren Laadan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2BB798.4050500@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox