Switching Kernels without Rebooting?
Hi, i was just thinking about if it would be possible to switch kernels without haveing to restart the entire system. Sort of a "Live kernel replacement". It sort of goes along with the hot-swap-everything ideas. I was thinking something like
- Take all the structs related to userspace memory and processes
- Save them to a reserved area of memory
- Halt the kernel, mostly
- Wipe kernel-space memory clean to avoid confusion
- Load new kernel into memory
- Replace all saved structures
- Start kernel running agin
This seems like the easiest way to do it. The biggest problem is that there would be somewhere about 30 seconds where all processes would be frozen. This could cause problems with tcp/ip connections timeing out say on a webserver, but it would be more managable than a few minutes downtime to restart the machine. There is one other way i can think of, something like
- Copy entire kernel memory to another reserved area of memory
- Start new kernel running as a "secondary kernel"
- Transfer control from "Primary kernel" to "Secondary Kernel"
- Load new kernel where the kernel was previously located
- Start new kernel running as a "Secondary Kernel" agin
- Transfer control between kernels
- Kill and remove temporary kernel
This system could result in nearly zero downtime, but would require more memory, be more complicated, and would require significant modifications to allow for a "Secondary Kernel" to be runing. Anyways, I think this could be a nice feature of the kernel in situations where zero downtime is required. Yes, it might be a case of "creeping featurism", but if you think so, then tell me. If you would be interested in helping with it, send me a message, if there is any support for it. Please CC: me any messages, it would be quite helpful since i do not recieve the mailing list due to the excessive volume. If you don't I will pick it up in the archives, but not as soon. Thanks.
Colin
On Tue, Jul 10, 2001 at 02:42:12PM -0400, C. Slater wrote:
Hi, i was just thinking about if it would be possible to switch kernels without haveing to restart the entire system.
Pre-solaris 8 sun were promising this
Sort of a "Live kernel replacement". It sort of goes along with the hot-swap-everything ideas. I was thinking something like
- Take all the structs related to userspace memory and processes
- Save them to a reserved area of memory
- Halt the kernel, mostly
what about timing critical things? you mention networking, but there are others
- Wipe kernel-space memory clean to avoid confusion
- Load new kernel into memory
- Replace all saved structures
what if the layout of these changes as it often does?
- Start kernel running agin
This seems like the easiest way to do it. The biggest problem is that there would be somewhere about 30 seconds where all processes would be frozen.
It seems like difficult to implement solution for little gain. Linux can be booted _very_ quickly on modern machines, probably about 15s for most hardware. If you use burn linux into the rom of use a flashdisk (or similar solution), you can have everything rebooted in under five seconds.
The zflinux chips/machines probably boot in half that, maybe less (as tested on a prototype many months ago).
--cw
Quoted 3 lines · C. Slater
Hi, i was just thinking about if it would be possible to switch kernels without haveing to restart the entire system. Sort of a "Live kernel replacement". It sort of goes along with the hot-swap-everything ideas. I
I actually suggested the exact same thing back in 1998 ( Link to post in archives: http://uwsg.iu.edu/hypermail/linux/kernel/9808.1/1282.html ), but I never recieved much response. As I remember it, the emails I recieved where along the line of; "too much effort for too little gain, use clustering instead". I would still be very interrested in such a feature, but like back in 1998 this is still *way* out of my league to try to implement (but I'd be happy to help in testing :).
Best regards,
Jesper Juhl
[email protected]