[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191216174410.xiqurqnqyipbuy4e@wittgenstein>
Date: Mon, 16 Dec 2019 18:44:11 +0100
From: Christian Brauner <christian.brauner@...ntu.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: qiwuchen55@...il.com, peterz@...radead.org, mingo@...nel.org,
kernel-team@...roid.com, linux-kernel@...r.kernel.org,
chenqiwu@...omi.com
Subject: Re: [PATCH v2] kernel/exit: do panic earlier to get coredump if
global init task exit
On Mon, Dec 16, 2019 at 06:28:41PM +0100, Oleg Nesterov wrote:
> On 12/16, qiwuchen55@...il.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
Powered by blists - more mailing lists