[PATCH v2] pstore: add a KHO backend
Michał Cłapiński
mclapinski at google.com
Fri Jun 12 11:49:22 PDT 2026
On Fri, Jun 12, 2026 at 8:38 PM Pasha Tatashin
<pasha.tatashin at soleen.com> wrote:
>
> On 06-12 19:57, Michał Cłapiński wrote:
> > On Fri, Jun 12, 2026 at 7:21 PM Pasha Tatashin
> > <pasha.tatashin at soleen.com> wrote:
> > >
> > > On 06-12 17:42, Mike Rapoport wrote:
> > > > Hi,
> > > >
> > > > On Fri, Jun 05, 2026 at 02:10:40PM +0200, Michal Clapinski wrote:
> > > > > Up to this point to preserve late shutdown logs in memory, users had to
> > > > > predefine a memory region using ramoops. This commit changes this by
> > > > > preserving a buffer using kexec-handover.
> > > > >
> > > > > pstore_kho supports preserving only 1 dmesg buffer.
> > > > > It gets replaced with the new buffer on every kexec, so the user has to
> > > > > copy the file out of pstore after every kexec.
> > > > > There is no erase() support.
> > > >
> > > > Sorry I didn't jump at v1.
> > > >
> > > > pstore does not really need a KHO backend. It can use ram backend with
> > > > reserve_mem and reserve_mem can be preserved with KHO already.
> > >
> > > I just tested it, and it works well, I think it would be fine for
> > > Google's requirements:
> > >
> > > CONFIG_PSTORE=y
> > > CONFIG_PSTORE_RAM=y
> > > CONFIG_PSTORE_CONSOLE=y
> >
> > Is it common to write to this console? I think what I typically see in
> > the console are error logs that are also in dmesg, so if I preserve
> > console logs and dmesg I just have 2 files where one is a subset of
> > lines from the other.
>
> We need either your KHO backend, or the following patch:
> https://lore.kernel.org/all/20260612172623.1218280-1-pasha.tatashin@soleen.com/
>
> We need all dmesg messages.
We get all of the dmesg messages if you compile with
CONFIG_PSTORE=y
CONFIG_PSTORE_RAM=y
and the cmdline:
reserve_mem=2M:2M:dmesg_buffer ramoops.mem_name=dmesg_buffer
ramoops.max_reason=5 ramoops.console_size=0
ramoops.record_size=2097152 ramoops.ftrace_size=0 ramoops.pmsg_size=0
(the diff between yours and mine is I set console_size to 0 and
record_size to 2M, you do it the other way round).
Dmesg is kept in "record_size". We don't need to preserve the console
at all (unless there is something in console that isn't in dmesg but
I've never seen that).
> >
> > > With the following parameters:
> > > 'reserve_mem=2M:2M:dmesg_buffer ramoops.mem_name=dmesg_buffer ramoops.max_reason=5 ramoops.console_size=2097152 ramoops.record_size=0 ramoops.ftrace_size=0 ramoops.pmsg_size=0'
> > >
> > > KHO preserves pstore properly. However, we need one patch that would
> > > allow for ramoops console to capture the output even when quiet is
> > > provided.
> > >
> > > Pasha
More information about the kexec
mailing list