public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Daniel Lezcano <daniel.lezcano@free.fr>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pidns: reboot_pid_ns: use SEND_SIG_FORCED instead of force_sig()
Date: Wed, 18 Apr 2012 02:29:56 +0000	[thread overview]
Message-ID: <20120418022956.GA1919@mail.hallyn.com> (raw)
In-Reply-To: <20120417183513.GA1037@redhat.com>

Quoting Oleg Nesterov (oleg@redhat.com):
> On 04/16, Oleg Nesterov wrote:
> >
> > I'll investigate and report tomorrow.
> 
> Thanks again Serge, everything is clear.

Phew :)

>  Afaics this needs another
> (almost off-topic) patch.
> 
> Please forget about sys_reboot() for the moment. There is a minor
> and known problem with SIGKILL && SIGNAL_UNKILLABLE. If you send
> SIGKILL from the parent namespace to cinit, this doesn't make it
> SIGNAL_GROUP_EXIT immediately. Only after cinit actually dequeues
> SIGKILL it does do_group_exit() and set this flag. This should be
> fixed anyway, but not now.
> 
> And this explain the problem. Note that your test-case does
> sys_reboot() from the init process, and reboot_pid_ns() does
> 
> 	kill(pid_ns->child_reaper, SIGKILL);
> 
> 	do_exit(0);
> 
> so it sends SIGKILL to itself and exit. This means that cinit
> (current) obviously can't dequeue SIGKILL, and without
> SIGNAL_GROUP_EXIT wait_task_zombie() ignores
> signal->group_exit_code.
> 
> That is why the patch makes a difference.
> 
> But why reboot_pid_ns() does do_exit? Yes, it was copied from
> sys_reboot() and I didn't notice. It should use do_group_exit(),
> and sys_reboot() too. This is the patch I am going to send, but
> I'll try to think a bit more.
> 
> Thanks!
> 
> Oleg.

Great, glad it makes sense!  :)

I'll test when you have a patch ready.  Thanks, Oleg.

-serge

      reply	other threads:[~2012-04-18  2:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  0:44 [PATCH] pidns: reboot_pid_ns: use SEND_SIG_FORCED instead of force_sig() Oleg Nesterov
2012-04-13 18:20 ` Serge Hallyn
2012-04-13 19:24   ` Oleg Nesterov
2012-04-13 19:34     ` Serge Hallyn
2012-04-16 13:59     ` Serge Hallyn
2012-04-16 15:38       ` Oleg Nesterov
2012-04-16 16:24         ` Serge Hallyn
2012-04-16 21:26           ` Oleg Nesterov
2012-04-17 18:35             ` Oleg Nesterov
2012-04-18  2:29               ` Serge E. Hallyn [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=20120418022956.GA1919@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.lezcano@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=serge.hallyn@canonical.com \
    /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