From: Oleg Nesterov <oleg@redhat.com>
To: "Tze-nan Wu (吳澤南)" <Tze-nan.Wu@mediatek.com>
Cc: "Bobule Chang (張弘義)" <bobule.chang@mediatek.com>,
"brauner@kernel.org" <brauner@kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
wsd_upstream <wsd_upstream@mediatek.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"chenqiwu@xiaomi.com" <chenqiwu@xiaomi.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>
Subject: Re: [RFC PATCH] exit: Skip panic in do_exit() during poweroff
Date: Mon, 14 Apr 2025 18:50:44 +0200 [thread overview]
Message-ID: <20250414165043.GG28345@redhat.com> (raw)
In-Reply-To: <249567d33e088a340780456c7ecd3ef3ee1433a1.camel@mediatek.com>
On 04/14, Tze-nan Wu (吳澤南) wrote:
>
> On Thu, 2025-04-10 at 23:05 +0200, Oleg Nesterov wrote:
> >
> > As for sys_reboot(), I think that kernel_power_off() must be
> > __noreturn,
> > and sys_reboot() should use BUG() after
> > LINUX_REBOOT_CMD_POWER_OFF/_HALT
> > instead of do_exit().
> >
>
> Yes, kernel_power_off() should not return, but this is the case only if
> kernel_power_off() is invoked by PID 1 through sys_reboot().
> If kernel_power_off() is invoked by a kernel thread (e.g., the thermal
> kernel module) other than PID 1, then do_exit() could possibly be
> invoked by PID 1 after kernel_power_off() on another CPU.
Yes sure, this is clear.
I have mentioned sys_reboot() because (unless I am totally confused)
this connects to the previous report from Breno.
And I agree that we should do stop_other_cpus() first, but let me
say this again: I can't help ;)
But in any case, rightly or not I still think that the init process
should not exit/crash due to POWER_OFF/HALT. We should not mask this
problem in do_exit().
Oleg.
next prev parent reply other threads:[~2025-04-14 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 14:39 [RFC PATCH] exit: Skip panic in do_exit() during poweroff Tze-nan Wu
2025-04-10 21:05 ` Oleg Nesterov
2025-04-11 14:06 ` Oleg Nesterov
2025-04-14 13:02 ` Tze-nan Wu (吳澤南)
2025-04-14 16:50 ` Oleg Nesterov [this message]
2025-04-15 8:41 ` Christian Brauner
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=20250414165043.GG28345@redhat.com \
--to=oleg@redhat.com \
--cc=Tze-nan.Wu@mediatek.com \
--cc=akpm@linux-foundation.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bobule.chang@mediatek.com \
--cc=brauner@kernel.org \
--cc=chenqiwu@xiaomi.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=wsd_upstream@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.