mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: qiwuchen55@gmail.com, peterz@infradead.org, mingo@kernel.org,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	chenqiwu@xiaomi.com
Subject: Re: [PATCH v2] kernel/exit: do panic earlier to get coredump if global init task exit
Date: Mon, 16 Dec 2019 18:44:11 +0100	[thread overview]
Message-ID: <20191216174410.xiqurqnqyipbuy4e@wittgenstein> (raw)
In-Reply-To: <20191216172841.GA10466@redhat.com>

On Mon, Dec 16, 2019 at 06:28:41PM +0100, Oleg Nesterov wrote:
> On 12/16, qiwuchen55@gmail.com wrote:
> >
> > +	 * If all threads of global init have exited, do panic imeddiately
> > +	 * to get the coredump to find any clue for init task in userspace.
> > +	 */
> > +	group_dead = atomic_dec_and_test(&tsk->signal->live);
> > +	if (unlikely(is_global_init(tsk) && group_dead))
> > +		panic("Attempted to kill init! exitcode=0x%08lx\n", code);
>                                                                     ^^^^
> 
> No, we should not throw out the useful info, please use
> 
> 	signal->group_exit_code ?: code
> 
> as the current code does.
> 
> And I am worried atomic_dec_and_test() is called too early...
> 
> Say, acct_process() can report the exit while some sub-thread sleeps

Hm, I'm not following here. I might just be slow. acct_process() doesn't
seem to report exit status and has been called after group_dead before.

Christian

  reply	other threads:[~2019-12-16 17:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  3:18 qiwuchen55
2019-12-16 10:27 ` Christian Brauner
2019-12-16 17:28 ` Oleg Nesterov
2019-12-16 17:44   ` Christian Brauner [this message]
2019-12-17 10:50     ` chenqiwu
2019-12-17 14:25       ` Oleg Nesterov
2019-12-17 14:56         ` chenqiwu
2019-12-17 15:23           ` Oleg Nesterov
2019-12-17 19:33             ` Peter Zijlstra
2019-12-18  8:08             ` chenqiwu
2019-12-17 14:14     ` Oleg Nesterov

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=20191216174410.xiqurqnqyipbuy4e@wittgenstein \
    --to=christian.brauner@ubuntu.com \
    --cc=chenqiwu@xiaomi.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qiwuchen55@gmail.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

all inboxes | Powered by JetHome®