Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2024 19:39:41 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Justin Hibbits <jhibbits@freebsd.org>
Cc:        Ravi Pokala <rpokala@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>,  "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Direct dumped kernel cores
Message-ID:  <CANCZdfq-Q%2BZvsvzuWsN-1Ntvh549tL62O=u%2Bw=3pjF9yYHNP6g@mail.gmail.com>
In-Reply-To: <20241031210734.283a2fb5@ralga.knownspace>
References:  <20241031182354.14fa48aa@ralga.knownspace> <63B5260F-C835-4BFF-92ED-767AD0CEFE05@panasas.com> <20241031210734.283a2fb5@ralga.knownspace>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e9054b0625d00238
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 31, 2024, 7:07=E2=80=AFPM Justin Hibbits <jhibbits@freebsd.org>=
 wrote:

> On Thu, 31 Oct 2024 15:33:39 -0700
> Ravi Pokala <rpokala@freebsd.org> 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@)
> >
> > =EF=BB=BF-----Original Message-----
> > From: <owner-freebsd-arch@FreeBSD.org
> > <mailto:owner-freebsd-arch@FreeBSD.org>> on behalf of Justin Hibbits
> > <jhibbits@FreeBSD.org <mailto:jhibbits@FreeBSD.org>> Date: Thursday,
> > October 31, 2024 at 15:23 To: <freebsd-hackers@FreeBSD.org
> > <mailto:freebsd-hackers@FreeBSD.org>>, <freebsd-arch@freebsd.org
> > <mailto:freebsd-arch@freebsd.org>> 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
> >
> >
> >
> >
> >
> >
>
>
>

--000000000000e9054b0625d00238
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Thu, Oct 31, 2024, 7:07=E2=80=AFPM Justin Hibbits &=
lt;<a href=3D"mailto:jhibbits@freebsd.org">jhibbits@freebsd.org</a>&gt; wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex">On Thu, 31 Oct 2024 15:33:39 -0=
700<br>
Ravi Pokala &lt;<a href=3D"mailto:rpokala@freebsd.org" target=3D"_blank" re=
l=3D"noreferrer">rpokala@freebsd.org</a>&gt; wrote:<br>
<br>
&gt; Hi Justin,<br>
&gt; <br>
&gt; So, this is like the &#39;crashkernel&#39; thing Linux has, where it k=
exec()s<br>
&gt; an alternate kernel when the main one panics?<br>
<br>
If your description is accurate, then probably.=C2=A0 I don&#39;t know if t=
he<br>
crashkernel thing from Linux existed when this was started, and<br>
actually hadn&#39;t even heard of it until now.<br></blockquote></div></div=
><div dir=3D"auto"><br></div><div dir=3D"auto">Yeah. There&#39;s three type=
s of kernels: debug, crash, and replacement.=C2=A0</div><div dir=3D"auto"><=
br></div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">
&gt; <br>
&gt; I haven&#39;t looked at the patch -- most of it will be way out of my<=
br>
&gt; expertise -- but what, if anything, is done to make sure the on-disk<b=
r>
&gt; state of the target filesystem is okay, before the &quot;rescue&quot; =
kernel<br>
&gt; starts writing to it?<br>
<br>
Good question.=C2=A0 The rescue kernel embeds its own small rootfs it fscks=
<br>
the target fs before writing to it.<br></blockquote></div></div><div dir=3D=
"auto"><br></div><div dir=3D"auto">Yea. My loader.kboot loads the kernel an=
d initrd too...</div><div dir=3D"auto"><br></div><div dir=3D"auto">Warner</=
div><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex">
<br>
- Justin<br>
<br>
&gt; <br>
&gt; Thanks,<br>
&gt; <br>
&gt; Ravi (rpokala@)<br>
&gt; <br>
&gt; =EF=BB=BF-----Original Message-----<br>
&gt; From: &lt;owner-freebsd-arch@FreeBSD.org<br>
&gt; &lt;mailto:<a href=3D"mailto:owner-freebsd-arch@FreeBSD.org" target=3D=
"_blank" rel=3D"noreferrer">owner-freebsd-arch@FreeBSD.org</a>&gt;&gt; on b=
ehalf of Justin Hibbits<br>
&gt; &lt;jhibbits@FreeBSD.org &lt;mailto:<a href=3D"mailto:jhibbits@FreeBSD=
.org" target=3D"_blank" rel=3D"noreferrer">jhibbits@FreeBSD.org</a>&gt;&gt;=
 Date: Thursday,<br>
&gt; October 31, 2024 at 15:23 To: &lt;freebsd-hackers@FreeBSD.org<br>
&gt; &lt;mailto:<a href=3D"mailto:freebsd-hackers@FreeBSD.org" target=3D"_b=
lank" rel=3D"noreferrer">freebsd-hackers@FreeBSD.org</a>&gt;&gt;, &lt;<a hr=
ef=3D"mailto:freebsd-arch@freebsd.org" target=3D"_blank" rel=3D"noreferrer"=
>freebsd-arch@freebsd.org</a><br>
&gt; &lt;mailto:<a href=3D"mailto:freebsd-arch@freebsd.org" target=3D"_blan=
k" rel=3D"noreferrer">freebsd-arch@freebsd.org</a>&gt;&gt; Subject: Direct =
dumped kernel cores<br>
&gt; <br>
&gt; <br>
&gt; Hi everyone,<br>
&gt; <br>
&gt; <br>
&gt; At Juniper we&#39;ve been using a so-called &#39;rescue&#39; kernel fo=
r dumping<br>
&gt; vmcores directly to the filesystem after a panic. We&#39;re now<br>
&gt; contributing this feature, implemented by Klara Systems, to FreeBSD,<b=
r>
&gt; and looking for feedback. I posted a review<br>
&gt; at <a href=3D"https://reviews.freebsd.org/D47358" rel=3D"noreferrer no=
referrer" target=3D"_blank">https://reviews.freebsd.org/D47358</a><br>;
&gt; &lt;<a href=3D"https://reviews.freebsd.org/D47358" rel=3D"noreferrer n=
oreferrer" target=3D"_blank">https://reviews.freebsd.org/D47358</a>&gt; for=
 anyone interested.<br>
&gt; <br>
&gt; <br>
&gt; Interesting bits to keep in mind:<br>
&gt; * It requires a 2-stage build process, one to build the rescue kernel,=
<br>
&gt; the other to build the main kernel, which embeds the rescue kernel<br>
&gt; inside its image. This might need some further work.<br>
&gt; * Thus far it&#39;s been implemented for amd64 and arm64, once proven =
out,<br>
&gt; other architectures (powerpc64/le, riscv64) can follow suit.<br>
&gt; * Kernel environment bits to pass down to the rescue kernel are<br>
&gt; prefixed `debug.rescue.`, for instance<br>
&gt; `debug.rescue.vfs.root.mountfrom`.<br>
&gt; <br>
&gt; <br>
&gt; There are many more details in the review summary.<br>
&gt; <br>
&gt; <br>
&gt; We&#39;d love to get feedback from anyone interested.<br>
&gt; <br>
&gt; <br>
&gt; Thanks,<br>
&gt; Justin Hibbits<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
<br>
<br>
</blockquote></div></div></div>

--000000000000e9054b0625d00238--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfq-Q%2BZvsvzuWsN-1Ntvh549tL62O=u%2Bw=3pjF9yYHNP6g>