Kernel reboot method
AssigneeHuawei Technologies Co., Ltd.
InventorsLing Zhu, Yan Sang
Life of this patent
Estimating the term…
Abstract
This application provides a kernel reboot method, to reserve an internal memory for storing an entry address of a physical code and a code segment for the physical core. A kernel hotswap scenario is used as an example. When a computer system stops executing an old kernel, an interrupt is sent to the physical core, so that the physical core enters a busy waiting state. When the computer system starts a new kernel, the entry address of the physical core is modified. When finding that the entry address is modified, the physical core in the busy waiting state exits the busy waiting state, performs an initialization procedure of the physical core, and receives task scheduling of the new kernel.
Claims15
A kernel reboot method for a processor comprising a primary physical core and at least two secondary physical cores for loading a new kernel, comprising:
- loading the new kernel by the primary core, and modifying in an internal memory of the primary core, entry addresses for the at least two secondary physical cores and a corresponding code segment to perform an initialization procedure for the at least two secondary physical cores;
- receiving, by the at least two secondary physical cores, a request to stop executing an old kernel, wherein the request is sent from the primary physical core in parallel to the at least two secondary physical cores;
- in response to receiving the request, setting a state of the at least two secondary physical cores to a busy waiting state;
- querying and determining, by the at least two secondary physical cores in the busy waiting state, that the respective entry addresses of the at least two secondary physical cores are modified as compared to previous entry addresses of the at least two secondary physical cores;
- and
- setting, by the at least two secondary physical cores after determining that the respective entry addresses of the at least two secondary physical cores are modified, the state of the at least two secondary physical cores to exit the busy waiting state;
- wherein exiting the busy waiting state comprises performing the initialization procedure of the at least two secondary physical cores by jumping to executing the code segment indicated by the respective modified entry addresses.
A kernel reboot apparatus, comprising:
- at least one processor comprising a primary physical core and at least two secondary physical cores for loading a new kernel;
- and
- one or more memories coupled to the at least one processor and storing programming instructions for execution by the at least one processor to cause the apparatus to:
- load the new kernel by the primary core, and modify in an internal memory of the primary core, entry addresses for the at least two secondary physical cores and a corresponding code segment to perform an initialization procedure for the at least two secondary physical cores;
- receive, from the primary physical core, a request to stop executing an old kernel;
- in response to receiving the request, set a state of the at least two secondary physical cores to a busy waiting state;
- query and determine, by the at least two secondary physical cores in the busy waiting state, that the respective entry addresses of the at least two secondary physical cores are modified as compared to previous entry addresses of the at least two secondary physical cores;
- and
- set, by the at least two secondary physical cores after determining that the respective entry addresses of the at least two secondary physical cores are modified, the state of the at least two secondary physical cores to exit the busy waiting state;
- wherein exiting the busy waiting state comprises perform the initialization procedure of the at least two secondary physical cores by jumping to executing the code segment indicated by the respective modified entry addresses.
A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and a processor executes the computer instructions to:
- load a new kernel by a primary core, and modify in an internal memory of the primary core, entry addresses for at least two secondary physical cores and a corresponding code segment to perform an initialization procedure for the at least two secondary physical cores;
- receive, by the at least two secondary physical cores of the processor, a request to stop executing an old kernel, wherein the request is sent from the primary physical core of the processor in parallel to the at least two secondary physical cores;
- in response to receiving the request, set a state of the at least two secondary physical cores to a busy waiting state;
- query and determine, by the at least two secondary physical cores in the busy waiting state, that the respective entry addresses of the at least two secondary physical cores are modified as compared to previous entry addresses of the at least two secondary physical cores;
- and
- set, by the at least two secondary physical cores after determining that the respective entry addresses of the at least two secondary physical cores are modified, the state of the at least two secondary physical cores to exit the busy waiting state;
- wherein exiting the busy waiting state comprises perform the initialization procedure of the at least two secondary physical cores by jumping to executing the code segment indicated by the respective modified entry addresses.
Dependencies are inferred from the claim text.