Re: Direct dumped kernel cores

Warner Losh <[email protected]>
Newsgroups gmane.os.freebsd.devel.hackers,gmane.os.freebsd.architechture
Message-ID <CANCZdfq-Q+ZvsvzuWsN-1Ntvh549tL62O=u+w=3pjF9yYHNP6g@mail.gmail.com>
On Thu, Oct 31, 2024, 7:07 PM Justin Hibbits <[email protected]> wrote:

> On Thu, 31 Oct 2024 15:33:39 -0700
> Ravi Pokala <[email protected]> wrote:
>
> > Hi Justin,
> >
> > So, this is like the 'crashkernel' thing Linux has, where it kexec()s
> > an alternate kernel when the main one panics?
>
> If your description is accurate, then probably.  I don't know if the
> crashkernel thing from Linux existed when this was started, and
> actually hadn't even heard of it until now.
>

Yeah. There's three types of kernels: debug, crash, and replacement.

>
> > I haven't looked at the patch -- most of it will be way out of my
> > expertise -- but what, if anything, is done to make sure the on-disk
> > state of the target filesystem is okay, before the "rescue" kernel
> > starts writing to it?
>
> Good question.  The rescue kernel embeds its own small rootfs it fscks
> the target fs before writing to it.
>

Yea. My loader.kboot loads the kernel and initrd too...

Warner


> - Justin
>
> >
> > Thanks,
> >
> > Ravi (rpokala@)
> >
> > -----Original Message-----
> > From: <[email protected]
> > <mailto:[email protected]>> on behalf of Justin Hibbits
> > <[email protected] <mailto:[email protected]>> Date: Thursday,
> > October 31, 2024 at 15:23 To: <[email protected]
> > <mailto:[email protected]>>, <[email protected]
> > <mailto:[email protected]>> Subject: Direct dumped kernel cores
> >
> >
> > Hi everyone,
> >
> >
> > At Juniper we've been using a so-called 'rescue' kernel for dumping
> > vmcores directly to the filesystem after a panic. We're now
> > contributing this feature, implemented by Klara Systems, to FreeBSD,
> > and looking for feedback. I posted a review
> > at https://reviews.freebsd.org/D47358
> > <https://reviews.freebsd.org/D47358> for anyone interested.
> >
> >
> > Interesting bits to keep in mind:
> > * It requires a 2-stage build process, one to build the rescue kernel,
> > the other to build the main kernel, which embeds the rescue kernel
> > inside its image. This might need some further work.
> > * Thus far it's been implemented for amd64 and arm64, once proven out,
> > other architectures (powerpc64/le, riscv64) can follow suit.
> > * Kernel environment bits to pass down to the rescue kernel are
> > prefixed `debug.rescue.`, for instance
> > `debug.rescue.vfs.root.mountfrom`.
> >
> >
> > There are many more details in the review summary.
> >
> >
> > We'd love to get feedback from anyone interested.
> >
> >
> > Thanks,
> > Justin Hibbits
> >
> >
> >
> >
> >
> >
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.