From: Simon Horman <horms@kernel.org>
To: Serapheim Dimitropoulos <serapheimd@gmail.com>
Cc: kexec@lists.infradead.org,
John Ogness <john.ogness@linutronix.de>,
Petr Mladek <pmladek@suse.com>, Philipp Rudo <prudo@redhat.com>,
Baoquan He <bhe@redhat.com>,
Serapheim Dimitropoulos <sdimitropoulos@coreweave.com>
Subject: Re: [PATCH kexec-tools v3] util_lib/elf_info: stream lockless printk ring records
Date: Mon, 24 Aug 2026 16:38:06 +0100 [thread overview]
Message-ID: <20260824153806.GB102316@horms.kernel.org> (raw)
In-Reply-To: <20260818-vmcore-dmesg-stream-upstream-v3-1-d721a5482f24@coreweave.com>
On Tue, Aug 18, 2026 at 10:29:39AM -0400, Serapheim Dimitropoulos wrote:
> From: Serapheim Dimitropoulos <sdimitropoulos@coreweave.com>
>
> We came across this while testing kdump on an arm64 system with a 64 MiB
> printk text ring and an 850 MiB capture kernel. vmcore-dmesg was run from
> the capture kernel before makedumpfile, but it was killed with SIGKILL
> before it could produce any output.
>
> The lockless ringbuffer reader copies the complete descriptor, info, and
> text rings before it starts processing records. For the above setup these
> copies raised peak RSS to about 345 MiB. This is a significant part of the
> memory available to the capture kernel, and most of the copied data is only
> visited once.
>
> Keep the ring file offsets and read each active record directly instead.
> Allocate space for one descriptor, one info record, and one text record.
> Leave the existing ring geometry parsing, types, traversal, and
> record-state handling unchanged.
>
> The old and new readers produced byte-identical output for committed and
> finalized records, missed and empty records, wrapped text, non-printable
> bytes, descriptor ID wraparound, and a dense 100000-record fixture.
>
> For the dense fixture with a 64 MiB text ring, peak RSS dropped from
> 345276 KiB to 1276 KiB. Runtime increased from 1.98 to 2.09 seconds due to
> the per-record reads.
>
> Fixes: 4149df9005f2 ("printk: add support for lockless ringbuffer")
> Signed-off-by: Serapheim Dimitropoulos <sdimitropoulos@coreweave.com>
> ---
> Changes in v3:
> - Keep the patch focused on changing where ring data is read.
> - Remove the new validation and overflow-checking framework, and retain the
> existing types, ring geometry parsing, arithmetic, traversal, and
> record-state handling.
> - Use direct pread() calls and the same error handling style as the existing
> reader.
> - Re-run make distcheck, byte-for-byte small and dense fixture comparisons,
> peak RSS measurements, and ASan/UBSan tests of the printk-ring path.
> - Link to v2: https://lore.kernel.org/r/20260803-vmcore-dmesg-stream-upstream-v2-1-cb7f7449bc1b@coreweave.com
Thanks, applied.
- util_lib/elf_info: stream lockless printk ring records
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=2bcd7801948d
prev parent reply other threads:[~2026-08-24 15:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 14:29 [PATCH kexec-tools v3] util_lib/elf_info: stream lockless printk ring records Serapheim Dimitropoulos
2026-08-24 15:38 ` Simon Horman [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=20260824153806.GB102316@horms.kernel.org \
--to=horms@kernel.org \
--cc=bhe@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=kexec@lists.infradead.org \
--cc=pmladek@suse.com \
--cc=prudo@redhat.com \
--cc=sdimitropoulos@coreweave.com \
--cc=serapheimd@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