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>> 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 <<a href=3D"mailto:rpokala@freebsd.org" target=3D"_blank" re= l=3D"noreferrer">rpokala@freebsd.org</a>> wrote:<br> <br> > Hi Justin,<br> > <br> > So, this is like the 'crashkernel' thing Linux has, where it k= exec()s<br> > an alternate kernel when the main one panics?<br> <br> If your description is accurate, then probably.=C2=A0 I don't know if t= he<br> crashkernel thing from Linux existed when this was started, and<br> actually hadn't even heard of it until now.<br></blockquote></div></div= ><div dir=3D"auto"><br></div><div dir=3D"auto">Yeah. There'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"> > <br> > I haven't looked at the patch -- most of it will be way out of my<= br> > expertise -- but what, if anything, is done to make sure the on-disk<b= r> > state of the target filesystem is okay, before the "rescue" = kernel<br> > 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> > <br> > Thanks,<br> > <br> > Ravi (rpokala@)<br> > <br> > =EF=BB=BF-----Original Message-----<br> > From: <owner-freebsd-arch@FreeBSD.org<br> > <mailto:<a href=3D"mailto:owner-freebsd-arch@FreeBSD.org" target=3D= "_blank" rel=3D"noreferrer">owner-freebsd-arch@FreeBSD.org</a>>> on b= ehalf of Justin Hibbits<br> > <jhibbits@FreeBSD.org <mailto:<a href=3D"mailto:jhibbits@FreeBSD= .org" target=3D"_blank" rel=3D"noreferrer">jhibbits@FreeBSD.org</a>>>= Date: Thursday,<br> > October 31, 2024 at 15:23 To: <freebsd-hackers@FreeBSD.org<br> > <mailto:<a href=3D"mailto:freebsd-hackers@FreeBSD.org" target=3D"_b= lank" rel=3D"noreferrer">freebsd-hackers@FreeBSD.org</a>>>, <<a hr= ef=3D"mailto:freebsd-arch@freebsd.org" target=3D"_blank" rel=3D"noreferrer"= >freebsd-arch@freebsd.org</a><br> > <mailto:<a href=3D"mailto:freebsd-arch@freebsd.org" target=3D"_blan= k" rel=3D"noreferrer">freebsd-arch@freebsd.org</a>>> Subject: Direct = dumped kernel cores<br> > <br> > <br> > Hi everyone,<br> > <br> > <br> > At Juniper we've been using a so-called 'rescue' kernel fo= r dumping<br> > vmcores directly to the filesystem after a panic. We're now<br> > contributing this feature, implemented by Klara Systems, to FreeBSD,<b= r> > and looking for feedback. I posted a review<br> > at <a href=3D"https://reviews.freebsd.org/D47358" rel=3D"noreferrer no= referrer" target=3D"_blank">https://reviews.freebsd.org/D47358</a><br> > <<a href=3D"https://reviews.freebsd.org/D47358" rel=3D"noreferrer n= oreferrer" target=3D"_blank">https://reviews.freebsd.org/D47358</a>> for= anyone interested.<br> > <br> > <br> > Interesting bits to keep in mind:<br> > * It requires a 2-stage build process, one to build the rescue kernel,= <br> > the other to build the main kernel, which embeds the rescue kernel<br> > inside its image. This might need some further work.<br> > * Thus far it's been implemented for amd64 and arm64, once proven = out,<br> > other architectures (powerpc64/le, riscv64) can follow suit.<br> > * Kernel environment bits to pass down to the rescue kernel are<br> > prefixed `debug.rescue.`, for instance<br> > `debug.rescue.vfs.root.mountfrom`.<br> > <br> > <br> > There are many more details in the review summary.<br> > <br> > <br> > We'd love to get feedback from anyone interested.<br> > <br> > <br> > Thanks,<br> > Justin Hibbits<br> > <br> > <br> > <br> > <br> > <br> > <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>