Use Case:

AVL 8.1 Fast Linux restart bypassing BIOS

Version 0.1

Last Modified Date: 04/18/2005

Editor: Khalid Aziz

Copyright (c) 2005 by The Open Source Development Lab, Inc. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is available at http://www.opencontent.org/openpub/). In addition, draft copies of this document may not be posted publicly without permission from the Open Source Development Lab (OSDL) , Inc. (http://www.osdl.org)

Table of Contents

Description	2

Target Acceptance	2

Participants/Roles/Actors	2

Scenarios	2

Implementation Notes	3

References	3

Description

A normal bootup sequence for a computer system involves hardware test and initialization by system firmware (e.g. BIOS, EFI) followed by the bootloader loading a kernel image in memory which then transfers control of the computer system to kernel. Kernel then completes hardware initialization and completes system boot up. Depending upon the system hardware and firmware, system firmware can take a significant amount of time to initalize the hardware. In a telco environment, when a system is brought down, either through a planned or unplanned down time, it must be brought back into service as soon as possible so as to not affect overall availability of the system significantly. There are three components to boot up time that can be tuned to reduce the complete system bootup time – (1) System firmware initialization, (2) Bootloader loading the kernel, and (3) Kernel boot up. Kernel bootup time can be reduced by carefully planning which minimal services need to be brought up in order to start up the application system is meant to run. It is the other two components that can be much harder to tune for a customer. One way to reduce system firmware initialization time is to alleviate the need to even re-run system firmware on a system reboot. If one could boot from one kernel into another kernel directly, two components can be eliminated from overall system boot time. This reboot process is often referred to as warm reboot as opposed to cold reboot where the system is reset and restarted as if it had just been powered up.

System firmware provides a fairly important service to enable system bootup. In the absence of system firmware providing these services, certain conditions must be true for a new kernel to boot up successfully:

Currently running kernel must shut down all hardware cleanly.

Newly booted kernel must not rely upon hardware being in any specific state other than minimally initialized state (e.g. PCI BARs must stay programmed correctly)

No system hardware should be hung for a successful reboot without a system reset and hence subsequent system firmware execution.

Target Acceptance

Ideally this functionality would go into mainline kernel on kernel.org. Failing that, ti should atleast be accepted by mainstream Linux distributions.

Participants/Roles/Actors

Kernel developers: Linux kernel would need enhancements to allow it to load another kernel image and then boot directly into the new image. Associated userspace tools would need to be developed to load a new kernel image and initiate a direct reboot into new image.

System Administrator: System administrator orchestrates a kernel reboot bypassing system firmware by loading a new kernel image and then initiating a reboot at appropriate time.

Scenarios

A basic use for this functionality will be to upgrade the kernel on a deployed telco system. System administrator gets a new kernel and needs to upgrade machines in field. Here is how this can be accomplished:

System administrator loads the new kernel on to the root disk of running system.

System administrator fails over to standby system if applicable.

System administrator loads the new kernel in memory in preparation for rebooting into new kernel.

Initiate a warm system reboot which shuts down currently running kernel and starts executing new kernel.

Another use for warm reboot is during unplanned down times. System unavailability outside of planned downtime can be significantly disruptive in telco environment. So it becomes even more important to return the system to service as soon as possible after system outage. Here is how a warm reboot can be accomplished in case of unplanned system outage:

System administrator loads another kernel image for the running kernel, in memory to be rebooted to in case of unplanned system reboot (for example kernel panic).

System administrator enables kernel to do a warm reboot automatically in case of a spontaneous kernel reboot.

If and when the kernel is forced to reboot due to an unexpected event, it automatically does a warm reboot.

There are cases where a warm reboot is simply not possible and a user needs to be aware of those conditions. Here are examples of some of those conditions:

System includes a hardware that can not be re-initialized by a Linux driver without going through a complete reset.

Kernel reboot is caused by a hard error that can not be cleared without a full paltform reset, for example I/O controller hang.

Kernel reboot is caused by condition that also causes I/O hardware to be reset, for example MCA on an Itanium platform will most likely reset I/O controller and cause PCI devices to lose PCI BAR configuration.

Implementation Notes

TBD

References

“Reboot Linux faster using kexec”, Hariprasad Nellitheertha, http://www-106.ibm.com/developerworks/linux/library/l-kexec.html?ca=dgr-lnxw02RebootFast

kexec README file, Eric Biederman, http://www.xmission.com/~ebiederm/files/kexec/README

kexec patches and tools - http://www.xmission.com/~ebiederm/files/kexec/

Use case: Using kexec to warm reboot a machine

Lynn de la Torre

2004-11-05T14:06:00