When the time comes to boot into the new kernel, the Kexec code does the following: Shuts down the kernel, and tries to reset devices to a known state. The code does not unmount filesystems, kill processes, etc. Copies a small bit of assembly code into the reboot code buffer.
This code's job is to take the set of pages holding the new kernel and copy them into their real destination - typically overwriting the old kernel. Jumps via a return, actually into the new kernel. The original Kexec patch created a kexec system call which would load the new kernel image as described above, and immediately reboot into that image. That approach, however, wasn't quite what Linus had in mind , even though Linus likes the Kexec idea in general.
Why not, asked Linus, split up the operations of loading the new kernel and rebooting into it? The reasoning for splitting these operations has mostly to do with other possible uses for Kexec.
For example, one can imagine all kinds of things that could be done when the kernel panics: boot into a debugger or crash dump generator, or just bring up that old 2. The problem is that, when the system has gone into a panic, you really do not want it digging around in the filesystem looking for an image to boot; that needs to have been set up ahead of time.
And the only way to do that is to split the load and reboot steps. This version of Kexec still does not handle the panic case, but it has most of the infrastructure needed to do that. At any rate, this patch sounds really useful, potentially even more useful than the UML stuff which wowed me with the possibility of running a kernel in a debugger for direct debugging and whatnot not for me, of course, but the kernel hackers out there. This has much more of a direct impact on me as an end-user, and I simply can't wait to give it a shot.
User: Password:. Careful: next command will reload a new kernel and will impact running services! A very quick and unscientific benchmark of doing a yum update kernel with and without kexec. So you have a couple of seconds of the new kernel load, for big physical machines with lots of RAM, this will be even more as the entire POST check can be skipped with this method. You can sign up via email below. No spam. Mattias Geniar.
Kernel patching with kexec: updating a CentOS 7 kernel without a full reboot. Kexec-hardboot patch for Shamu. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters Show hidden characters. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. From d12d6adafbacbade Mon Sep 17
0コメント