4 ms·
What's Inside a Linux Kernel Core Dump
- elitistphoenix 3y agoIs it just me that feels dirty learning about the linux kernel from an Oracle page?
- PenguinCoder 3y agoFeels wrong, but the information density and presentation are pretty good for this. Easy to understand I think.
- unmole 3y agoIt's just you.
- jakogut 3y agoAs a counter-example, Zstd is created and primarily developed by a Meta employee. I also felt the same way upon opening the article, but companies are made of individuals, and often individuals do valuable and insightful work, even inside of bureaucratic and Kafkaesque organizations like Oracle.
- Twirrim 3y agoFor what it's worth, Oracle is one of the largest contributors to the kernel, especially if you filter out the drivers subtree, which tends to skew the metrics for various reasons (lots of large generated code, almost identical arm SoC variants etc) It would be really odd if they couldn't teach you about the kernel.
- tyingq 3y agoA bit, but there's plenty of very smart people there, and this particular page seems controlled by the engineers and not the leadership.
- saagarjha 3y ago> On a system which is configured for kexec crash dumps, some memory is reserved at boot time for a second Linux kernel (the “kdump kernel”). On startup, the system uses kexec_load(2) to load a kernel image into this reserved memory region. If a panic occurs, all CPUs are halted and control is transferred to the kdump kernel. Is there really no better way to do this than to have an entire second kernel ready to take over? Like a more specialized piece of code that only handles kernel coredumps?
- jclulow 3y agoThat is in fact how crash dump works on illumos systems. Once you enter a kernel panic, interrupts are disabled, all other CPUs are brought to rest, etc. Then the panic code takes the pages to write to the dump and passes them to a special routine in the driver for the dump device: usually either a slice on a disk or a zvol). That driver is responsible for getting the device into a state where polled I/O can be performed, and to write the pages out. At the end the system reboots, and on the next boot a program called savecore inspects the dump device to see if there is a new dump, and if there is it transfers it into a new file.
- deleted 3y ago[deleted]
- loeg 3y agoFreeBSD does the same thing (probably some shared 80s BSD heritage?). One challenge is actually providing that special routine for the dump device in a way that is safe at crash time. You don't know how bad a state your crashed kernel is in, and some buses may not have a polled IO mode (USB?). The Linux kexec process kind of elegantly restarts into a known state, with the known drawback of hogging some memory. It's definitely a different set of tradeoffs and both seem vaguely reasonable.
- askl 3y ago> Like a more specialized piece of code that only handles kernel coredumps? Can't the kdump kernel be exactly that? You can build a second kernel separate from the normal one, that only has the necessary options enabled to handle the coredump stuff. This way it can be relatively small and you can reuse the required driver code.