From: Bradley Morgan <include@grrlz.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Kees Cook <kees@kernel.org>, Baoquan He <baoquan.he@linux.dev>,
linux-kernel@vger.kernel.org, brads@mainlining.org
Subject: [PATCH 2/2] kexec: log the task that initiated the kexec reboot
Date: Thu, 27 Aug 2026 22:57:08 +0000 [thread overview]
Message-ID: <20260827225708.6831-2-include@grrlz.net> (raw)
In-Reply-To: <20260827225708.6831-1-include@grrlz.net>
From: Bradley Morgan <brads@mainlining.org>
Give the kexec path the same treatment as the reboot syscall.
Log the comm and pid of the calling task after kexec_in_progress is set
to true but before kernel_restart_prepare() shuts down devices, so the
message survives even if device shutdown hangs, e.g:
reboot: initiated by systemd-shutdow[1]
kexec: Starting new kernel
The existing "Starting new kernel" line is left untouched, so anything
parsing dmesg today keeps working.
Signed-off-by: Bradley Morgan <brads@mainlining.org>
---
kernel/kexec_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index dc770b9a6d05..d940b0c29f86 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1189,6 +1189,7 @@ int kernel_kexec(void)
#endif
{
kexec_in_progress = true;
+ reboot_log_initiator();
kernel_restart_prepare("kexec reboot");
migrate_to_reboot_cpu();
syscore_shutdown();
--
2.47.3
prev parent reply other threads:[~2026-08-27 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 22:57 [PATCH 1/2] reboot: log the task that initiated the reboot Bradley Morgan
2026-08-27 22:57 ` Bradley Morgan [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=20260827225708.6831-2-include@grrlz.net \
--to=include@grrlz.net \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=brads@mainlining.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.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 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.