Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2024 21:07:34 -0400
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        Ravi Pokala <rpokala@freebsd.org>
Cc:        <freebsd-hackers@FreeBSD.org>, <freebsd-arch@freebsd.org>
Subject:   Re: Direct dumped kernel cores
Message-ID:  <20241031210734.283a2fb5@ralga.knownspace>
In-Reply-To: <63B5260F-C835-4BFF-92ED-767AD0CEFE05@panasas.com>
References:  <20241031182354.14fa48aa@ralga.knownspace> <63B5260F-C835-4BFF-92ED-767AD0CEFE05@panasas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 31 Oct 2024 15:33:39 -0700
Ravi Pokala <rpokala@freebsd.org> wrote:

> Hi Justin,
>=20
> 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.

>=20
> 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.

- Justin

>=20
> Thanks,
>=20
> Ravi (rpokala@)
>=20
> =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
>=20
>=20
> Hi everyone,
>=20
>=20
> 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.
>=20
>=20
> 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`.
>=20
>=20
> There are many more details in the review summary.
>=20
>=20
> We'd love to get feedback from anyone interested.
>=20
>=20
> Thanks,
> Justin Hibbits
>=20
>=20
>=20
>=20
>=20
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20241031210734.283a2fb5>