Re: [PATCH kexec-tools] util_lib/elf_info: stream lockless printk ring records

John Ogness <[email protected]> Fri, 31 Jul 2026 09:14:52 +0206
Newsgroups org.infradead.lists.kexec
Message-ID <[email protected]>
Hi Serapheim,

On 2026-07-29, Serapheim Dimitropoulos <[email protected]> wrote:
> From: Serapheim Dimitropoulos <[email protected]>
>
> 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.
>
> Stream the active records directly from the dump instead. We initially
> considered using exact reads for every field. That keeps memory use
> bounded, but turns every record into several small reads.

Is that really a problem? The code would be much simpler and easier to
review and verify if you did it this way.

At least, I would expect a patch that does this implementation
conversion first. Then, if you really need the caching optimiziation, a
second patch that adds the layer of caching.

Also, I would expect the caching to be a generic mechanism that can be
used for all kcore reading, not just the printk ringbuffer.

(I do not have any authoritative role for the kexec-tools. Just sharing
my thoughts on this patch.)

John Ogness