From: Breno Leitao <leitao@debian.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <baoquan.he@linux.dev>,
Mike Rapoport <rppt@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
Dave Young <ruirui.yang@linux.dev>
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, kernel-team@meta.com,
Breno Leitao <leitao@debian.org>
Subject: [PATCH] vmcore: report the release of the crashed kernel
Date: Mon, 21 Sep 2026 03:45:42 -0700 [thread overview]
Message-ID: <20260921-kdump_print-v1-1-e445fec3177c@debian.org> (raw)
kdump runs in a very small environment and cut-down set of drivers, and
it can die before the dump lands: it runs out of memory, a device hangs
on reset, or a watchdog fires while the dump is still being written out.
This happens about a single high digit percentage on most of big scale
datacenters.
When that happens the only evidence left is what the capture kernel
printed to the console, and that does not say which kernel crashed.
A fleet typically pins one kdump image and boots it after crashes from
many different production kernels, and it is useful to understand what
are the combination of crashed kernel panic and succesful kdump
collection.
Whether the dump completes at all tends to depend on the kernel that
died: memory pinned, devices in flight, dump size.
The release is already recorded. crash_save_vmcoreinfo_init() puts
OSRELEASE= in the VMCOREINFO note, and by the time vmcore_init() has run
parse_crash_elf_headers() that note sits in elfnotes_buf. Walk the notes
for it and print:
vmcore: dump is from kernel 7.3.0-rc3-next-20260917
Given this is cheap and useful, I think it is worth adding to vmcore, to
improve kdump monitoring.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
fs/proc/vmcore.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 44d15436439fd9..406898247d7af1 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -1709,6 +1709,24 @@ static void vmcore_free_device_dumps(void)
#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
}
+#define VMCOREINFO_OSRELEASE_KEY "OSRELEASE="
+
+static void __init vmcore_report_crashed_release(void)
+{
+ const char *ver, *eol;
+
+ ver = strnstr(elfnotes_buf, VMCOREINFO_OSRELEASE_KEY, elfnotes_sz);
+ if (!ver)
+ return;
+
+ ver += sizeof(VMCOREINFO_OSRELEASE_KEY) - 1;
+ eol = memchr(ver, '\n', elfnotes_buf + elfnotes_sz - ver);
+ if (!eol)
+ return;
+
+ pr_notice("dump is from kernel %.*s\n", (int)(eol - ver), ver);
+}
+
/* Init function for vmcore module. */
static int __init vmcore_init(void)
{
@@ -1733,6 +1751,8 @@ static int __init vmcore_init(void)
elfcorehdr_free(elfcorehdr_addr);
elfcorehdr_addr = ELFCORE_ADDR_ERR;
+ vmcore_report_crashed_release();
+
proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &vmcore_proc_ops);
if (proc_vmcore)
proc_vmcore->size = vmcore_size;
---
base-commit: 3f2425f5b5bbbdd991ca9cdfd5502e68d8895998
change-id: 20260918-kdump_print-861a49b856ca
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-09-21 10:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 10:45 Breno Leitao [this message]
2026-09-21 10:52 ` sashiko-bot
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=20260921-kdump_print-v1-1-e445fec3177c@debian.org \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=kernel-team@meta.com \
--cc=kexec@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=ruirui.yang@linux.dev \
/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®