Method for processing operating system failure, and accelerator card
By obtaining and utilizing the dump configuration information of the operating system and directly accessing and saving physical memory data, the problem of resource reservation and secondary restart failure of the kernel dump mechanism is solved, and efficient and reliable operating system exception dumps are achieved.
Patent Information
- Application Number
- PCT/CN2024/076220
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-24
- Filing Date
- 2024-02-06
- Publication Date
- 2024-08-29
AI Technical Summary
When an exception occurs in existing operating systems, the kernel dump mechanism needs to reserve resources in advance, and the second restart may fail, resulting in the failure to complete the dump.
By obtaining the dump configuration information of the operating system, determine the physical address space and virtual address space, use the DMA engine to directly access the physical memory when detecting anomalies, save the running data to a non-volatile storage device, and send a restart after the data storage is completed. instructions to avoid reserving memory in advance and restarting twice.
It improves the reliability and efficiency of operating system exception dumps, improves the convenience of on-site operation and maintenance, and ensures the integrity and resource utilization of the dump process.
Smart Images

Figure CN2024076220_29082024_PF_FP_ABST
Abstract
Description
Operating system failure handling method and accelerator card
[0001] Cross-references
[0002] This application claims priority to a Chinese patent application filed with the Patent Office of China on February 24, 2023, with application number 202310196378.2 and application name “Method for handling operating system failures and accelerator card”. The entire contents of the application are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present application relate to the technical field of operating system fault location, and in particular to a method for processing operating system faults and an accelerator card. Background Art
[0004] The operating system is the bottom layer of the software stack in a computer system. When an exception occurs, especially a kernel exception, the entire system may become inaccessible, and no obvious exception logs are output to the console or other devices. Even if some exception logs can be obtained, due to the complexity of the operating system kernel technology, it is often difficult to accurately locate the fault based on only a small number of exception logs.
[0005] Based on this, existing operating systems, such as Linux, typically use a kernel dump (kdump) mechanism to dump memory when an operating system exception occurs. Specifically, a block of memory tens to hundreds of megabytes is reserved during system startup, and a kernel image (dump kernel) is loaded into this reserved memory. When an exception occurs, the system jumps to the dump kernel and restarts the system. The dump kernel copies the memory data used by the original faulty system to facilitate comprehensive fault analysis.
[0006] However, during the above dump process, the operating system needs to reserve resources in advance, and although the second restart does not involve a complete startup, it is still possible that the startup fails due to driver or hardware problems, and thus the dump cannot be completed.
[0007] Summary of the Invention
[0008] An embodiment of the present application provides a method for handling operating system failures and an acceleration card to at least solve the problem in related technologies that the kernel dump mechanism requires pre-reserved resources in the operating system, and the second restart may fail to start, resulting in the inability to complete the dump.
[0009] In order to solve the above technical problems, this application is implemented as follows:
[0010] In a first aspect, an embodiment of the present application provides a method for handling an operating system failure, comprising: obtaining dump configuration information of the host operating system, the dump configuration information including a physical address space; determining a virtual address space corresponding to the physical address space based on the dump configuration information; upon detecting an abnormality in the operating system, accessing running data in the physical memory of the operating system based on the virtual address space; and saving the running data to a non-volatile storage device.
[0011] In one possible implementation, the dump configuration information also includes a processor architecture, a kernel page table address, and memory management metadata; accessing the running data in the physical memory of the operating system based on the virtual address space includes: parsing the page table entries in the global page directory corresponding to the operating system in hierarchical order according to the type of the processor architecture; when it is determined, based on the kernel page table address and memory management metadata, that the memory page corresponding to the last-level page table entry in the parsed page table entries is for kernel use, converting the target physical address corresponding to the memory page into a target virtual address; and accessing the running data in the physical memory of the operating system based on the target virtual address.
[0012] In one possible implementation, the dump configuration information also includes a priority dump address space; accessing the running data in the physical memory of the operating system based on the virtual address space includes: configuring an access priority for the virtual address space corresponding to the priority dump address space; and accessing the running data in the physical memory of the operating system in sequence according to the access priority corresponding to the virtual address space.
[0013] In one possible implementation, accessing the running data in the physical memory of the operating system according to the virtual address space includes: dividing the virtual address space into multiple virtual address subspaces; and accessing the running data in the physical memory of the operating system in parallel according to the multiple virtual address subspaces.
[0014] In a possible implementation, after the operation data is saved in a non-volatile storage device, the method further includes: when it is determined that the operation data has been stored, sending a restart instruction to the operating system, wherein the restart instruction is used to trigger the operating system to perform a restart operation.
[0015] In one possible implementation, the dump configuration information also includes a dump duration limit; when it is determined that the running data has been stored, sending a restart instruction to the operating system includes: when the storage time of the running data reaches the dump duration limit, sending a restart instruction to the operating system.
[0016] In one possible embodiment, the non-volatile storage device includes a first non-volatile storage device and a second non-volatile storage device; saving the operating data in the non-volatile storage device includes: performing data preprocessing operations on the operating data, wherein the data preprocessing operations include encryption processing and compression processing; saving the operating data after the data preprocessing operations to the first non-volatile storage device; or, sending the operating data after the data preprocessing operations to the second non-volatile storage device of the cloud management platform for storage.
[0017] In a possible implementation, detecting that an abnormality has occurred in the operating system includes: receiving a handshake message periodically sent by the host; and determining that an abnormality has occurred in the operating system when no handshake message is received from the host within a preset time.
[0018] In a possible implementation, detecting that an abnormality has occurred in the operating system includes: upon receiving an abnormality instruction sent by the host, determining that an abnormality has occurred in the operating system.
[0019] In a second aspect, an embodiment of the present application provides an acceleration card, comprising: a dump module for obtaining dump configuration information of an operating system of a host, the dump configuration information including a physical address space; determining a virtual address space corresponding to the physical address space based on the dump configuration information; when an abnormality is detected in the operating system, accessing the running data in the physical memory of the operating system based on the virtual address space; a DMA engine for saving the running data in a non-volatile storage device; and a non-volatile storage device for storing the running data in the physical memory of the operating system.
[0020] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the above-mentioned method for handling operating system failures.
[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned method for handling operating system failures.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] FIG1 shows a schematic diagram of a possible application scenario;
[0025] FIG2 is a schematic diagram showing a flow chart of a method for handling an operating system failure provided by an embodiment of the present application;
[0026] FIG3 shows another flow chart of a method for handling an operating system failure according to an embodiment of the present application;
[0027] FIG4 shows another flow chart of a method for handling an operating system failure according to an embodiment of the present application;
[0028] FIG5 shows one of the structural diagrams of the accelerator card provided in an embodiment of the present application;
[0029] FIG6 shows a second schematic diagram of the structure of the accelerator card provided in an embodiment of the present application;
[0030] FIG7 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0032] Because server hosts carry a wide variety of services and carry heavy loads, operating system kernel failures are often difficult to reproduce. Therefore, it's necessary to copy the entire kernel's memory for analysis and fault location. A dump, when an operating system failure occurs, copies all operating data from the entire operating system, particularly the kernel's memory, to facilitate more comprehensive fault analysis and determine the cause. Reliable and efficient dumps are crucial for locating operating system kernel failures and improving field availability.
[0033] The present application embodiment proposes the use of an external accelerator card to complete the dump of the server host operating system. Figure 1 shows a schematic diagram of a possible application scenario. As shown in the figure, the accelerator card 120 is connected to the server host 110 via an interconnect bus. The interconnect bus can be a PCIe (PCI Express) bus or other interconnect technologies such as the Compute Express Link (CXL) protocol. The accelerator card 120 is configured through the dump driver inside the server host 110. When an operating system exception occurs, the accelerator card 120 can directly access the operating data in the server host 110 memory and complete the dump.
[0034] FIG2 is a flow chart of a method for handling an operating system failure according to an embodiment of the present application. As shown in the figure, the method 200 for handling an operating system failure can be applied to the accelerator card 120 and includes the following steps:
[0035] S201: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space.
[0036] S202: Determine a virtual address space corresponding to the physical address space according to the dump configuration information.
[0037] S203: When it is detected that an abnormality occurs in the operating system, access the running data in the physical memory of the operating system according to the virtual address space.
[0038] S204: Save the operating data to a non-volatile storage device.
[0039] Through the above steps, since the physical address space of the host operating system is obtained and the virtual address space corresponding to the physical address space is determined, when an operating system exception is detected, the server host's memory can be accessed via Direct Memory Access (DMA) to complete the dump. This eliminates the need to reserve memory in advance on the host system to configure kernel dumps, and when an operating system exception occurs, a secondary restart is not required to complete the dump. This improves the reliability and efficiency of operating system exception dumps and enhances the convenience of on-site operation and maintenance.
[0040] This will be explained with reference to a specific example. The operating system of the server host 110 boots up, loads the dump driver, and configures the IOMMU page corresponding to the server host's input / output memory management unit (IOMMU). This maps the entire physical address space of the server host 110, using a direct mapping of the input / output virtual address (IOVA) to the physical address. The IOMMU is used to convert the virtual address accessed by the device into a physical address.
[0041] After the IOMMU page configuration is complete, the dump driver sends dump configuration information to the accelerator card 120. The dump configuration information includes the physical address space, namely the starting physical address and length of the server host 110's memory, and the IOVA starting value mapped by the corresponding IOMMU page table. Because the host's physical memory addressing may be discontinuous, the physical address space sent by the dump driver to the accelerator card 120 is a list of starting addresses and lengths.
[0042] The accelerator card 120 starts to detect abnormalities on the server host. There are two implementation schemes, and the detailed steps are as follows:
[0043] The first implementation:
[0044] S2031a: Receive a handshake message periodically sent by the host.
[0045] S2031b: When no handshake message is received from the host within a preset time, it is determined that an abnormality occurs in the operating system.
[0046] In this way, the accelerator card 120 actively performs abnormality detection using a watchdog mechanism, that is, the server host 110 periodically sends a handshake message to the accelerator card 120. When the accelerator card 120 does not receive a handshake message from the server host 110 within a preset time, it is determined that an abnormality has occurred in the operating system of the server host 110.
[0047] The second implementation:
[0048] S2032: Upon receiving the exception instruction from the host, determining that an exception has occurred in the operating system. Specifically, upon sensing an exception in the operating system, the dump driver on the server host 110 sends an exception instruction to the accelerator card 120. Upon receiving the exception instruction from the host, the accelerator card 120 determines that an exception has occurred in the operating system of the server host 110.
[0049] When the accelerator card 120 detects an operating system exception, it starts dumping, copies the running data in all physical memories of the server host 110 according to the obtained IOVA address space list, and saves it to a non-volatile storage device.
[0050] In a possible implementation, the dump configuration information further includes a processor architecture, a kernel page table address, and memory management metadata; and accessing the operating data in the physical memory of the operating system according to the virtual address space includes:
[0051] S2033a: According to the type of the processor architecture, parse the page table entries in the global page directory corresponding to the operating system in order of levels.
[0052] S2033b: When it is determined, based on the kernel page table address and the memory management metadata, that the memory page corresponding to the last-level page table entry in the parsed page table entries is for kernel use, converting the target physical address corresponding to the memory page into a target virtual address.
[0053] S2033c: Access the running data in the physical memory of the operating system according to the target virtual address.
[0054] Through the above steps, the accelerator card 120 can traverse the kernel page table according to the configured processor architecture, kernel page table address and memory management metadata, and only save the memory used by the kernel, which can reduce the amount of dump data and improve the availability of running data.
[0055] This is explained with reference to specific examples. DMA is controlled to read the page table entries of the global page directory (PGD). Based on the type of processor architecture obtained, each entry in the PGD is parsed to determine whether it is valid. If valid, the address of the next-level page table directory is further parsed, and the content of the entry is continued to be read until the last-level page table entry is read. When it is determined based on the kernel page table address and memory management metadata that the memory page corresponding to the last-level page table entry in the parsed page table entry is for kernel use, the target physical address corresponding to the memory page is converted into a target virtual address. Based on the target virtual address, the running data in the physical memory of the operating system is accessed and saved in a non-volatile storage device.
[0056] The above filtered dump of kernel memory usage can also take into account the size of the entire host memory. After all host memory is dumped, further filtering can be performed locally on the accelerator card.
[0057] In a possible implementation, the dump configuration information further includes a priority dump address space; and accessing the running data in the physical memory of the operating system according to the virtual address space includes:
[0058] S2034a: Configure an access priority for the virtual address space corresponding to the priority dump address space.
[0059] S2034b: Access the running data in the physical memory of the operating system in sequence according to the access priority corresponding to the virtual address space.
[0060] Through the above steps, by configuring the virtual address space for dumping priority, the operating data that needs to be dumped first is accessed and saved to the non-volatile storage device, and then the operating data corresponding to other virtual address spaces is accessed. In this way, when the storage space of the non-volatile storage device is limited, the operating data that needs to be dumped first can be saved first, thereby ensuring the availability of the dumped data.
[0061] In one possible implementation, accessing the operating data in the physical memory of the operating system according to the virtual address space includes:
[0062] S2035a: Divide the virtual address space into multiple virtual address subspaces.
[0063] S2035b: Accessing the running data in the physical memory of the operating system in parallel according to the multiple virtual address subspaces.
[0064] Through the above steps, the virtual address space that needs to be dumped or the page table entries in the global page directory corresponding to the operating system are split in a multi-tasking manner. Multiple tasks concurrently access and store the running data in the physical memory of the operating system, which can speed up the dump rate.
[0065] FIG3 shows another flowchart of a method for handling an operating system failure provided by an embodiment of the present application. As shown in the figure, the method 300 for handling an operating system failure includes the following steps:
[0066] S301: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space.
[0067] S302: Determine a virtual address space corresponding to the physical address space according to the dump configuration information.
[0068] S303: When an abnormality is detected in the operating system, access the operating data in the physical memory of the operating system according to the virtual address space.
[0069] S304: Save the operating data to a non-volatile storage device.
[0070] S305: When it is determined that the operation data has been stored, a restart instruction is sent to the operating system, where the restart instruction is used to trigger the operating system to perform a restart operation.
[0071] This will be explained with reference to a specific example. After determining that all operating data has been stored, the accelerator card 120 notifies the server host 110 to restart the operating system. This notification can be achieved by interacting with a dump driver through an interrupt or memory write, with the dump driver triggering the operating system to restart. Alternatively, the notification can be achieved by directly notifying an out-of-band controller such as a baseboard management controller (BMC) to restart the operating system.
[0072] In a possible implementation, the dump configuration information also includes a dump duration limit; when it is determined that the operation data has been stored, sending a restart instruction to the operating system includes: S3051: when the storage time of the operation data reaches the dump duration limit, sending a restart instruction to the operating system. That is, the accelerator card 120 can send a restart instruction to the operating system in advance when the storage time of the operation data reaches the dump duration limit. In particular, the accelerator card 120 can dump the full amount of operation data after completing the dump of the operation data corresponding to the priority dump address space, and send a restart instruction to the operating system in advance when the storage time of the operation data reaches the dump duration limit, without waiting until the full amount of operation data dump is completed, so as to minimize the impact on service interruption.
[0073] FIG4 shows another flow chart of a method for handling an operating system failure provided by an embodiment of the present application. As shown in the figure, the method 400 for handling an operating system failure includes the following steps:
[0074] S401: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space.
[0075] S402: Determine a virtual address space corresponding to the physical address space according to the dump configuration information.
[0076] S403: When an abnormality is detected in the operating system, access the operating data in the physical memory of the operating system according to the virtual address space.
[0077] S404: Perform data preprocessing on the operating data.
[0078] The data preprocessing operation includes encryption processing and compression processing.
[0079] S405: Save the operating data after the data preprocessing operation to the first non-volatile storage device; or send the operating data after the data preprocessing operation to the second non-volatile storage device of the cloud management platform for storage.
[0080] This is explained with reference to specific examples. When the accelerator card 120 detects an operating system anomaly, it accesses the operating data in the physical memory of the operating system according to the virtual address space, performs data preprocessing on the operating data, and then stores the data in a first non-volatile storage device. Here, the first non-volatile storage device can be set on the accelerator card 120, and the operating data is compressed and stored in the first non-volatile storage device. The accelerator card 120 can also compress and encrypt the operating data and send it to the second non-volatile storage device of the cloud management platform for storage, wherein the cloud management platform and the accelerator card 120 are in communication with each other.
[0081] Figure 5 shows one of the structural diagrams of the acceleration card provided in an embodiment of the present application. As shown in the figure, the acceleration card 120 includes: a dump module 121, which is used to obtain dump configuration information of the host's operating system, where the dump configuration information includes a physical address space; determining a virtual address space corresponding to the physical address space based on the dump configuration information; when an abnormality is detected in the operating system, accessing the operating data in the physical memory of the operating system based on the virtual address space; a direct memory access (DMA) engine 122, which is used to save the operating data to a non-volatile storage device; and a non-volatile storage device 123, which is used to store the operating data in the physical memory of the operating system.
[0082] In one possible embodiment, the dump configuration information also includes a processor architecture, a kernel page table address, and memory management metadata; when the dump module 121 is used to access the running data in the physical memory of the operating system according to the virtual address space, it is specifically used to: parse the page table entries in the global page directory corresponding to the operating system in sequence according to the level according to the type of the processor architecture; when it is determined according to the kernel page table address and the memory management metadata that the memory page corresponding to the last-level page table entry in the parsed page table entries is for kernel use, convert the target physical address corresponding to the memory page into a target virtual address; and access the running data in the physical memory of the operating system according to the target virtual address.
[0083] In one possible implementation, the dump configuration information also includes a priority dump address space; when the dump module 121 is used to access the running data in the physical memory of the operating system according to the virtual address space, it is specifically used to: configure an access priority for the virtual address space corresponding to the priority dump address space; and access the running data in the physical memory of the operating system in sequence according to the access priority corresponding to the virtual address space.
[0084] In one possible embodiment, when the dump module 121 is used to access the operating data in the physical memory of the operating system based on the virtual address space, it is specifically configured to: divide the virtual address space into multiple virtual address subspaces; and access the operating data in the physical memory of the operating system in parallel based on the multiple virtual address subspaces. Furthermore, when the dump module 121 is used to detect an abnormality in the operating system, it is specifically configured to: receive handshake messages periodically sent by the host; and determine that an abnormality has occurred in the operating system if no handshake message is received from the host within a preset time.
[0085] Alternatively, when the dump module 121 is used to detect an abnormality in the operating system, it is specifically used to: determine that an abnormality has occurred in the operating system when an abnormality instruction sent by the host is received.
[0086] In a possible implementation, the acceleration card 120 further includes: an instruction sending module, configured to send a restart instruction to the operating system when it is determined that the operation data has been stored, wherein the restart instruction is used to trigger the operating system to perform a restart operation.
[0087] In one possible implementation, the dump configuration information also includes a dump time limit; when the instruction sending module is used to send a restart instruction to the operating system when it is determined that the operating data has been stored, it is specifically used to: when the storage time of the operating data reaches the dump time limit, send a restart instruction to the operating system.
[0088] In one possible implementation, as shown in FIG6 , the acceleration card 120 further includes an encryption module 124, a compression module 125, and a network transmission module 126; the non-volatile storage device 123 includes a first non-volatile storage device 1231 and a second non-volatile storage device; the operating data acquired by the dump module 121 can be compressed by the compression module 125 and then saved in the first non-volatile storage device 1231; the operating data acquired by the dump module 121 can also be encrypted by the encryption module 124, compressed by the compression module 125, and then sent to the second non-volatile storage device of the cloud management platform through the network transmission module 126 for storage.
[0089] An embodiment of the present application provides an accelerator card, which includes a dump module, a DMA engine, and a non-volatile storage device. The dump module obtains the dump configuration information of the host's operating system, and the dump configuration information includes a physical address space; according to the dump configuration information, a virtual address space corresponding to the physical address space is determined; when an abnormality is detected in the operating system, the operating data in the physical memory of the operating system is accessed according to the virtual address space; and the operating data is then saved to the non-volatile storage device through the DMA engine. Through the embodiment of the present application, the host system does not need to reserve memory in advance due to the configuration of the kernel dump, which can improve the resource utilization of the host system, and there is no need to restart the operating system twice in the event of an abnormal dump, which can improve the reliability and dump efficiency of the operating system abnormal dump.
[0090] FIG7 shows a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application. Referring to the figure, at the hardware level, the electronic device includes a processor, and optionally, an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage device. Of course, the computer device may also include hardware required for other services.
[0091] The processor, network interface, and memory can be interconnected via an internal bus, such as an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. These buses can be classified as address buses, data buses, and control buses. For ease of illustration, the figure uses only one bidirectional arrow, but this does not imply that there is only one bus or only one type of bus.
[0092] The memory stores programs. Specifically, the programs may include program code, which includes computer operating instructions. The memory may include internal memory and non-volatile memory, and provides instructions and data to the processor.
[0093] The processor reads the corresponding computer program from the non-volatile memory into the internal memory and then runs it, logically forming a device for locating the target user. The processor executes the program stored in the memory and specifically performs the methods disclosed in the embodiments shown in Figures 2-4 and implements the functions and benefits of the various methods described in the method embodiments above, which will not be repeated here.
[0094] The methods disclosed in the embodiments shown in Figures 2-4 of the present application can be implemented in a processor or by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0095] The computer device can also execute the methods described in the above method embodiments and realize the functions and beneficial effects of the methods described in the above method embodiments, which will not be repeated here.
[0096] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0097] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device executes the method disclosed in the embodiments shown in Figures 2-4 and realizes the functions and beneficial effects of the various methods described in the previous method embodiments, which will not be repeated here.
[0098] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0099] Furthermore, an embodiment of the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the functions and beneficial effects of the various methods described in the above method embodiments are implemented, which will not be repeated here.
[0100] In short, the above description is only a preferred embodiment of the present application and does not limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
[0101] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0102] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, parallel RAM (PRAM), static RAM (SRAM), dynamic RAM (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable ROM (EEPROM), flash memory or other memory technologies, compact disc-ROM (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0103] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0104] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
Claims
1. A method for handling an operating system failure, comprising: Obtaining dump configuration information of an operating system of a host, wherein the dump configuration information includes a physical address space; Determine, according to the dump configuration information, a virtual address space corresponding to the physical address space; When detecting that an abnormality occurs in the operating system, accessing the operating data in the physical memory of the operating system according to the virtual address space; The operating data is saved in a non-volatile storage device.
2. The method according to claim 1, wherein: The dump configuration information also includes a processor architecture, a kernel page table address, and memory management metadata; and accessing the operating data in the physical memory of the operating system according to the virtual address space includes: According to the type of the processor architecture, the page table entries in the global page directory corresponding to the operating system are parsed in order according to the level; When it is determined, based on the kernel page table address and the memory management metadata, that the memory page corresponding to the last-level page table entry in the parsed page table entry is for kernel use, converting the target physical address corresponding to the memory page into a target virtual address; According to the target virtual address, the running data in the physical memory of the operating system is accessed.
3. The method according to claim 1, wherein: The dump configuration information also includes a priority dump address space; and accessing the operating data in the physical memory of the operating system according to the virtual address space includes: Configuring an access priority for a virtual address space corresponding to the priority dump address space; The operating data in the physical memory of the operating system are accessed in sequence according to the access priority corresponding to the virtual address space.
4. The method according to claim 1, wherein: Accessing the operating data in the physical memory of the operating system according to the virtual address space includes: Dividing the virtual address space into a plurality of virtual address subspaces; According to the multiple virtual address subspaces, the operating data in the physical memory of the operating system is accessed in parallel.
5. The method according to claim 1, wherein: After the operation data is saved in the non-volatile storage device, the method further includes: When it is determined that the operation data has been stored, a restart instruction is sent to the operating system, where the restart instruction is used to trigger the operating system to perform a restart operation.
6. The method according to claim 5, wherein: The dump configuration information also includes a dump time limit; and when it is determined that the operation data has been stored, sending a restart instruction to the operating system includes: When the storage time of the operating data reaches the dump time limit, a restart instruction is sent to the operating system.
7. The method according to claim 1, wherein: The non-volatile storage device comprises a first non-volatile storage device and a second non-volatile storage device; The step of storing the operating data in a non-volatile storage device comprises: Performing data preprocessing operations on the operation data, wherein the data preprocessing operations include encryption processing and compression processing; The operating data after the data preprocessing operation is saved in the first non-volatile storage device; or, the operating data after the data preprocessing operation is sent to the second non-volatile storage device of the cloud management platform for storage.
8. The method according to claim 1, wherein: The detecting that an abnormality occurs in the operating system includes: Receiving a handshake message periodically sent by the host; When no handshake message is received from the host within a preset time, it is determined that an abnormality occurs in the operating system.
9. The method according to claim 1, wherein: The detecting that an abnormality occurs in the operating system includes: When receiving the abnormal instruction sent by the host, it is determined that an abnormality occurs in the operating system.
10. An accelerator card, comprising: A dump module, used to obtain dump configuration information of an operating system of a host, wherein the dump configuration information includes a physical address space; Determine a virtual address space corresponding to the physical address space according to the dump configuration information; and when detecting that an abnormality occurs in the operating system, access the operating data in the physical memory of the operating system according to the virtual address space; A DMA engine, used for storing the operation data in a non-volatile storage device; A non-volatile storage device is used to store the operating data in the physical memory of the operating system.
11. An electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method for handling operating system failure as described in any one of claims 1 to 9 are implemented.
12. A readable storage medium storing a program or an instruction, wherein the program or the instruction, when executed by a processor, implements the steps of the method for processing an operating system failure according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method for treating crash dump of Linux operation system based on loongson server
CN102929747A
A method and device for processing information
CN109597677A
File processing method and device
CN114020709A
Preemptive page fault handling
US20200293456A1
