Fault-tolerant method for multi-kernel operating systems
By creating shadow service processes for service processes in a multi-kernel operating system and placing them in a work queue when a kernel failure occurs, the problem of complex fault tolerance mechanisms and significant performance impact during kernel failures in existing technologies is solved, achieving fast and low-resource-consumption service recovery.
Patent Information
- Application Number
- CN202110776463.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2041-07-09
AI Technical Summary
Existing multi-kernel operating systems have complex fault tolerance mechanisms that significantly impact performance when kernel failures occur. In particular, when transferring system services from a heavy kernel, it is necessary to copy state information and data, resulting in low efficiency.
In a multi-kernel operating system, a shadow service process is created for each service process. The shadow service process and its corresponding user address space are mapped to the same memory block. When a kernel failure occurs, the shadow service process is placed in a work queue. User processes can directly access the shadow service process through inter-process communication to quickly replace the service on the failed kernel.
It enables rapid service recovery in the event of a kernel failure. The mechanism is simple, consumes few system resources, has minimal performance impact, and avoids complex status information and data copying processes.
Smart Images

Figure CN115599609B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer operating system technology, specifically relating to a fault-tolerant method for multi-kernel operating systems. Background Technology
[0002] The operating system is a core component between computer hardware and applications. Currently, the computing performance of a computer's CPU mainly depends on the performance of a single CPU and the number of CPUs on the chip. Due to the limitations of physical device technology for a single CPU, multi-kernel systems are becoming increasingly widespread, and the number of cores they contain is also increasing. In order to run the operating system efficiently on a multi-kernel system and flexibly utilize its resources, researchers have designed and implemented multi-kernel operating systems. Andrew Baumann et al. designed a multi-kernel model in which different kernel nodes run on different cores, and programs running on them can interact through inter-process communication (see "The Multikernel: A new OS architecture for scalable multicore systems", SOSP'09).
[0003] In the design of multi-kernel operating systems, when one kernel fails or requires a system update, a fault tolerance mechanism is needed to ensure that programs running on that kernel can continue to provide services. Previous researchers have explored this area; Wang Lei et al. invented a failure control method that designs light and heavy kernels and achieves fault tolerance by transferring system services from the failed kernel to other healthy kernels (see "Failure Control Method and Device for Multi-Kernel Operating Systems," CN104657240A). However, when the heavy kernel fails, this method requires determining a new heavy kernel from among multiple light kernels, transferring system services, and updating the corresponding kernel state information in all kernels, making the mechanism relatively complex. Furthermore, transferring system services involves copying state information and data, which also impacts performance. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides a fault-tolerant method for multi-kernel operating systems, employing the following technical solution:
[0005] This invention provides a fault-tolerance method for multi-kernel operating systems, used to quickly recover services running on a faulty kernel of a multi-kernel operating system. The multi-kernel operating system includes: a first kernel running service processes, the service processes having a first user address space; a second kernel running at least user processes; and memory. The method is characterized by the following steps: Step S1, when a service process is created on the first kernel, a corresponding shadow service process is created on the second kernel, the shadow service process having a second user address space, and the first and second user address spaces are mapped to the same memory block; Step S2, when the service process modifies the content of the first user address space, the shadow service process modifies the content of the second user address space in the same way; Step S3, when a failure of the first kernel is detected, the second kernel moves the shadow service process into a work queue, causing user processes to switch from accessing the service process to accessing the shadow service process.
[0006] The fault-tolerant method for multi-kernel operating systems provided by this invention may also have the following technical feature: the multi-kernel operating system is a microkernel operating system.
[0007] The fault-tolerant method for multi-kernel operating systems provided by this invention may also have the following technical features: the service process further has a first thread control block; the shadow service process further has a second thread control block; the first thread control block is in the work queue of the first kernel; and the second thread control block is in the copy queue of the second kernel.
[0008] The fault-tolerant method for multi-kernel operating systems provided by this invention may also have the following technical feature: when the first kernel fails, the second kernel moves the second thread control block into the work queue.
[0009] The fault-tolerant method for multi-kernel operating systems provided by this invention may also have the following technical feature: user processes access service processes and shadow service processes through inter-process communication.
[0010] Invention Function and Effect
[0011] According to the fault-tolerance method for multi-kernel operating systems of the present invention, a shadow service process corresponding to the service process is prepared in advance. The user address spaces of both are mapped to the same memory block. When the service process interacts with its kernel and modifies the contents of its user address space, the shadow service process also modifies the contents of its user address space in the same way, thereby keeping the state information and data of both consistent. The shadow service process is in the replica queue and does not actually run. When the kernel where the service process is located fails, the shadow service process is placed in the work queue and becomes a normally running task. The user process can directly access the shadow service process using the original inter-process communication call. Therefore, this fault-tolerance method can quickly replace the original service running on the faulty kernel with the shadow service. The mechanism is simple, occupies less system resources, and does not require any copying process, thus having a smaller impact on performance. Attached Figure Description
[0012] Figure 1 This is a schematic diagram illustrating the operation of the service process and shadow service process according to an embodiment of the present invention;
[0013] Figure 2 This is a schematic diagram illustrating the operation of a multi-user service process according to an embodiment of the present invention;
[0014] Figure 3 This is a schematic diagram of the shadow service process running when an embodiment of the present invention fails. Detailed Implementation
[0015] To make the technical means, creative features, objectives and effects of this invention easy to understand, the following describes the fault-tolerant method for multi-kernel operating systems in detail with reference to embodiments and accompanying drawings.
[0016] <Example>
[0017] In this embodiment, the multi-kernel operating system is seL4, which runs on a multi-core hardware platform based on the x86 architecture.
[0018] Figure 1 This is a schematic diagram illustrating the operation of the service process and shadow service process in an embodiment of the invention.
[0019] like Figure 1 As shown, the multi-kernel operating system includes a first kernel 1, a second kernel 2, and memory 3. Each pair of kernels in this multi-kernel operating system can be either the first kernel 1 or the second kernel 2.
[0020] Service process 11 runs on the first kernel 1. Service process 11 has a first user address space 12 and a first thread control block (TCB) 13 on the first kernel 1.
[0021] The shadow service process 21 runs on the second kernel 2. The shadow service process 21 has a second user address space 22 and a second thread control block 23 on the second kernel 2.
[0022] To quickly restore a failed service, follow these steps:
[0023] Step S1: When service process 11 is created on the first kernel 1, a corresponding shadow service process 21 is created on the second kernel 2. The first user address space 12 and the second user address space 22 are mapped to the same memory block 3, that is, mapped to the same physical address space.
[0024] In step S2, when service process 11 interacts with the first kernel 1 and modifies the contents of the first user address space 12, shadow service process 21 also interacts with the second kernel 2 and modifies the contents of the second user address space 22 in the same way, ensuring consistency of memory data on both sides. The aforementioned permission management and data management are implemented through the capabilities of seL4. At this time, the second thread control block 23 is in the copy queue of the second kernel 2, meaning the shadow service process 21 is in the copy queue; it will not actually run and will not modify the contents of user memory.
[0025] Figure 2 This is a schematic diagram illustrating the operation of a multi-user service process according to an embodiment of the present invention.
[0026] like Figure 2 As shown, the first user process 14 runs on the first kernel 1, and the second user process 24 runs on the second kernel 2. Both the first user process 14 and the second user process 24 access the service process 11 on the first kernel 1 through inter-process communication (IPC).
[0027] Figure 3 This is a schematic diagram of the shadow service process running when an embodiment of the present invention fails.
[0028] Step S3, as follows Figure 3 As shown, when the first kernel 1 fails and service process 11 becomes unusable, the system detects the failure of the first kernel 1. The second kernel 2 then moves the second thread control block 23 into the second kernel 2's work queue, meaning the shadow service process 21 becomes a normally functioning task. The status information and data of the shadow service process 21 are consistent with those of the service process 11 before the failure. At this time, the first user process 14 on the first kernel 1 fails, while the second user process 24 on the second kernel 2 can access the shadow service process 21 through the exact same IPC calls (e.g., using the same seL4 privileges), thus enabling rapid recovery of the failed service for the second user process 24.
[0029] Functions and effects of the embodiments
[0030] According to the fault-tolerance method for multi-kernel operating systems provided in this embodiment, a shadow service process corresponding to the service process is prepared in advance. The user address spaces of both are mapped to the same memory block. When the service process interacts with its kernel and modifies the contents of its user address space, the shadow service process also modifies the contents of its user address space in the same way, so that the state information and data of both are consistent. The shadow service process is in the replica queue and does not actually run. When the kernel where the service process is located fails, the shadow service process is placed in the work queue and becomes a normally running task. The user process can directly access the shadow service process using the original inter-process communication call. Therefore, this fault-tolerance method can quickly replace the original service running on the faulty kernel with the shadow service. The mechanism is simple, occupies less system resources, and does not require any copying process, so the impact on performance is smaller.
[0031] The above embodiments are only used to illustrate specific implementations of the present invention, and the present invention is not limited to the scope of the description of the above embodiments.
[0032] In the above embodiments, the multi-kernel operating system is seL4. In other solutions of the present invention, other microkernel operating systems, such as Minix, can also be used to achieve the technical effects of the present invention.
[0033] In the above embodiments, a corresponding shadow service process is created for a service process. In other solutions of the present invention, multiple corresponding shadow service processes can also be created for a service process on multiple other kernels, which can also achieve the technical effect of the present invention.
[0034] In the above embodiments, a corresponding shadow service process is created for one service process. In other solutions of the present invention, corresponding shadow service processes can also be created for multiple service processes, which can also achieve the technical effects of the present invention.
Claims
1. A fault-tolerance method for multi-kernel operating systems, used to quickly recover services running on a faulty kernel of the multi-kernel operating system, the multi-kernel operating system comprising: The first kernel runs a service process, which has a first user address space on the first kernel; A second kernel must at least have user processes running. as well as Memory, The fault-tolerant method for multi-kernel operating systems is characterized by the following steps: Step S1: When the service process is created on the first kernel, a corresponding shadow service process is created on the second kernel. The shadow service process has a second user address space on the second kernel. The first user address space and the second user address space are mapped to the same memory. Step S2: When the service process modifies the content of the first user address space, the shadow service process modifies the content of the second user address space in the same way; Step S3: When the first kernel fails, the second kernel moves the shadow service process into the work queue, causing the user process to switch from accessing the service process to accessing the shadow service process. The service process also includes a first thread control block. The shadow service process also has a second thread control block. The first thread control block is in the work queue of the first kernel. The second thread control block is in the copy queue of the second kernel. When the first kernel fails, the second kernel moves the second thread control block into the work queue.
2. The fault-tolerant method for multi-kernel operating systems according to claim 1, characterized in that: in, The multi-kernel operating system is a microkernel operating system.
3. The fault-tolerant method for multi-kernel operating systems according to claim 1, characterized in that: in, The user process accesses the service process and the shadow service process through inter-process communication.
Citation Information
Patent Citations
Failure control method and failure control device of multi-kernel operating system
CN104657240A
Hypervisor isolation of processor cores
CN102713847A
Method and device for communication between user process and system service
CN104216862A
