Operating system fault processing method and accelerator card
By obtaining and using the dump configuration information to directly access the physical memory of the operating system, it solves the problems in the existing technology that kernel dumps need to reserve resources in advance and may fail to start, and achieves efficient and reliable operating system exception dumps.
Patent Information
- Application Number
- CN202310196378.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-27
AI Technical Summary
When an exception occurs in existing operating systems, the kernel dump mechanism needs to reserve resources in advance, and a second restart may cause startup failure and the dump cannot be completed.
By obtaining the dump configuration information of the host, the physical address space and virtual address space are determined, and the running data in the physical memory of the operating system is directly accessed and saved to a non-volatile storage device to avoid reserving memory in advance and restarting twice.
It improves the host system resource utilization and the reliability and efficiency of operating system exception dumps, and can complete the dump without reserving memory and restarting twice.
Smart Images

Figure CN118550762A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of operating system fault location, and more particularly to an operating system fault processing method and an acceleration card. Background Art
[0002] 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 be inaccessible, and there is no obvious exception log 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 by relying on only a small number of exception logs.
[0003] Based on this, existing operating systems, such as Linux operating systems, usually use a kernel dump (kdump) mechanism to complete memory dumping when the operating system is abnormal. Specifically, a block of memory of tens to hundreds of megabytes is reserved when the system is started, and a kernel image (dump kernel) is loaded into the reserved memory. When the system is abnormal, it jumps to the dump kernel to restart the system. In the dump system, the memory data used by the original faulty system is copied out to facilitate comprehensive fault analysis.
[0004] However, in 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 reasons, and the dump cannot be completed. Summary of the invention
[0005] The embodiments of the present application provide a method for processing operating system failures and an acceleration card to at least solve the problem in the prior art that the kernel dump mechanism needs to reserve resources in the operating system in advance, and the second restart may fail to start, resulting in the inability to complete the dump.
[0006] In order to solve the above technical problems, this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for processing an operating system failure, including:
[0008] Obtaining dump configuration information of an operating system of a host, wherein the dump configuration information includes a physical address space;
[0009] Determine, according to the dump configuration information, a virtual address space corresponding to the physical address space;
[0010] 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;
[0011] The operating data is saved in a non-volatile storage device.
[0012] In a possible implementation manner, 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:
[0013] 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;
[0014] 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;
[0015] According to the target virtual address, the running data in the physical memory of the operating system is accessed.
[0016] In a possible implementation, the dump configuration information further 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:
[0017] Configuring an access priority for a virtual address space corresponding to the priority dump address space;
[0018] 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.
[0019] In a possible implementation, accessing the operating data in the physical memory of the operating system according to the virtual address space includes:
[0020] Dividing the virtual address space into a plurality of virtual address subspaces;
[0021] According to the multiple virtual address subspaces, the operating data in the physical memory of the operating system is accessed in parallel.
[0022] In a possible implementation manner, after the operation data is saved in a non-volatile storage device, the method further includes:
[0023] 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.
[0024] In a possible implementation manner, the dump configuration information further 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:
[0025] When the storage time of the operating data reaches the dump time limit, a restart instruction is sent to the operating system.
[0026] In a possible implementation, the non-volatile storage device includes a first non-volatile storage device and a second non-volatile storage device; and the step of storing the operating data in the non-volatile storage device includes:
[0027] Performing data preprocessing operations on the operation data, wherein the data preprocessing operations include encryption processing and compression processing;
[0028] 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.
[0029] In a possible implementation, detecting that an abnormality occurs in the operating system includes:
[0030] Receiving a handshake message periodically sent by the host;
[0031] When no handshake message is received from the host within a preset time, it is determined that an abnormality occurs in the operating system.
[0032] In a possible implementation, detecting that an abnormality occurs in the operating system includes:
[0033] When receiving the abnormal instruction sent by the host, it is determined that an abnormality occurs in the operating system.
[0034] In a second aspect, an embodiment of the present application provides an accelerator card, including:
[0035] A dump module, used for obtaining dump configuration information of an operating system of a host, wherein the dump configuration information includes a physical address space; determining a virtual address space corresponding to the physical address space according to the dump configuration information; and accessing running data in a physical memory of the operating system according to the virtual address space when an abnormality is detected in the operating system;
[0036] A DMA engine, used for storing the operation data in a non-volatile storage device;
[0037] A non-volatile storage device is used to store the operating data in the physical memory of the operating system.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising 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.
[0039] 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, and the computer program is loaded and executed by a processor to implement the above-mentioned method for processing operating system failures.
[0040] The technical solution provided by this application may have the following beneficial effects:
[0041] The method for processing operating system failure provided by the embodiment of the present application obtains the dump configuration information of the operating system of the host, and the dump configuration information includes the physical address space; according to the dump configuration information, the virtual address space corresponding to the physical address space is determined; when an abnormality occurs 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 saved in a non-volatile storage device. Furthermore, a comprehensive fault analysis can be performed based on the operating data stored in the non-volatile storage device to locate the cause of the fault.
[0042] It can be seen that compared with the existing operating system dump method, the method provided in the embodiment of the present application does not need to reserve memory in advance on the host system due to the configuration of the kernel dump, which can improve the resource utilization of the host system. In addition, when an operating system exception is detected, the running data in the physical memory of the operating system is directly accessed and stored through the virtual address space, and the operating system does not need to be restarted for a second time, which can improve the reliability and dump efficiency of the operating system exception dump.
[0043] 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
[0044] 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.
[0045] Figure 1 A schematic diagram of a possible application scenario is shown;
[0046] Figure 2 A schematic diagram of a process for processing an operating system failure provided by an embodiment of the present application is shown;
[0047] Figure 3Another schematic diagram of a process for processing an operating system failure provided by an embodiment of the present application is shown;
[0048] Figure 4 Another schematic diagram of a process of a method for processing an operating system failure provided by an embodiment of the present application is shown;
[0049] Figure 5 One of the structural schematic diagrams of the acceleration card provided in the embodiment of the present application is shown;
[0050] Figure 6 The second structural schematic diagram of the acceleration card provided in the embodiment of the present application is shown;
[0051] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0053] Due to the variety of services carried by the server host and the heavy load, the abnormal failure of the operating system kernel is often difficult to reproduce, so it is necessary to copy all the memory used by the entire kernel for analysis to locate the fault. When an abnormality occurs in the operating system, the dump is to copy all the operating data in the memory used by the entire operating system, especially the kernel, to facilitate a more comprehensive analysis of the fault and determine the cause of the fault. Reliable and efficient dump plays an important role in locating the efficiency of operating system kernel faults and improving the availability of on-site operations.
[0054] The embodiment of the present application proposes using an external acceleration card to complete the dump of the server host operating system. Figure 1 A schematic diagram of a possible application scenario is shown. As shown in the figure, the accelerator card 120 is connected to the server host 110 through an interconnect bus. The interconnect bus can be a PCIe bus, or other interconnect technologies such as the CXL protocol. The accelerator card 120 is configured through a dump driver inside the server host 110. When an exception occurs in the operating system, the accelerator card 120 can directly access the operating data in the memory of the server host 110 and complete the dump.
[0055] Figure 2A flowchart of a method for processing an operating system failure provided by an embodiment of the present application is shown. As shown in the figure, the method 200 for processing an operating system failure can be applied to an accelerator card 120 and includes the following steps:
[0056] S201: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space;
[0057] S202: Determine a virtual address space corresponding to the physical address space according to the dump configuration information;
[0058] S203: 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;
[0059] S204: Save the operating data to a non-volatile storage device.
[0060] 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 abnormality is detected in the operating system, the memory of the server host can be accessed by direct memory access (DMA) to complete the dump. In this way, there is no need to reserve memory in advance on the host system for configuring kernel dumps, and there is no need to restart the operating system for a second time when an abnormality occurs, and the dump can be completed, thereby improving the reliability and efficiency of the operating system abnormality dump, while improving the convenience of on-site operation and maintenance.
[0061] The specific example is used for explanation. The operating system of the server host 110 is started, the dump driver is loaded, and the IOMMU page corresponding to the input / output memory management unit (IOMMU) of the server host is configured, and the physical address space of the server host 110 is mapped in its entirety, where the input / output virtual address (IOVA) is directly mapped to the physical address. Here, the IOMMU is used to convert the virtual address accessed by the device into a physical address.
[0062] After the IOMMU page configuration is completed, the dump driver sends dump configuration information to the accelerator card 120. The dump configuration information includes the physical address space, that is, the memory start physical address and length of the server host 110, and the IOVA start value mapped by the corresponding IOMMU page table. Here, since the physical memory addressing of the host may be discontinuous, the physical address space sent by the dump driver to the accelerator card 120 is a list of a series of start addresses and lengths.
[0063] The accelerator card 120 starts to detect abnormalities on the server host. There are two implementation schemes, and the detailed steps are as follows:
[0064] The first implementation:
[0065] S2031a: receiving a handshake message periodically sent by the host;
[0066] 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.
[0067] In this way, the watchdog mechanism is adopted by the acceleration card 120 to actively perform abnormality detection, that is, the server host 110 periodically sends a handshake message to the acceleration card 120. When the acceleration card 120 does not receive the handshake message from the server host 110 within the preset time, it is determined that the operating system of the server host 110 is abnormal.
[0068] The second implementation:
[0069] S2032: upon receiving the abnormal instruction sent by the host, determining that the operating system is abnormal, that is, after the dump driver on the server host 110 senses that the operating system is abnormal, it sends an abnormal instruction to the acceleration card 120, and upon receiving the abnormal instruction sent by the host, the acceleration card 120 determines that the operating system of the server host 110 is abnormal.
[0070] When the accelerator card 120 detects an abnormality in the operating system, it starts dumping, and 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.
[0071] 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:
[0072] 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;
[0073] 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;
[0074] S2033c: Access the running data in the physical memory of the operating system according to the target virtual address.
[0075] Through the above steps, the acceleration 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.
[0076] This is explained with specific examples. Control DMA to read the page table entries of the global page directory (PGD), and parse whether each entry in PGD is valid according to the type of processor architecture obtained. If valid, further parse the address of the next-level page table directory, and continue to read the content of the entry until the last-level page table entry is read. When it is determined that the memory page corresponding to the last-level page table entry in the parsed page table entry is for kernel use based on the kernel page table address and memory management metadata, the target physical address corresponding to the memory page is converted into a target virtual address, and the operating data in the physical memory of the operating system is accessed according to the target virtual address, and saved to a non-volatile storage device.
[0077] The above filtering dump of kernel memory usage can also take into account the size of the overall host memory. After all host memories are dumped, further filtering is performed locally on the accelerator card.
[0078] In a possible implementation, the dump configuration information further 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:
[0079] S2034a: configuring an access priority for the virtual address space corresponding to the priority dump address space;
[0080] S2034b: Access the operating data in the physical memory of the operating system in sequence according to the access priority corresponding to the virtual address space.
[0081] Through the above steps, by configuring the virtual address space for dumping first, the operation data that needs to be dumped first is accessed first and saved in the non-volatile storage device, and then the operation 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 operation data that needs to be dumped first can be saved first, thereby ensuring the availability of the dumped data.
[0082] In a possible implementation, accessing the operating data in the physical memory of the operating system according to the virtual address space includes:
[0083] S2035a: Divide the virtual address space into a plurality of virtual address subspaces;
[0084] S2035b: Access the operating data in the physical memory of the operating system in parallel according to the multiple virtual address subspaces.
[0085] Through the above steps, the virtual address space 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 dumping rate.
[0086] Figure 3 Another flowchart of a method for processing an operating system failure provided by an embodiment of the present application is shown. As shown in the figure, the method 300 for processing an operating system failure includes the following steps:
[0087] S301: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space;
[0088] S302: Determine a virtual address space corresponding to the physical address space according to the dump configuration information;
[0089] S303: 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;
[0090] S304: Saving the operation data to a non-volatile storage device;
[0091] 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.
[0092] The following is explained with reference to a specific example. After determining that all the operation data has been stored, the accelerator card 120 notifies the server host 110 to restart the operating system. The notification here can be to interact with the dump driver through an interrupt or memory write, and the dump driver triggers the operating system to restart, or it can be to directly notify an out-of-band controller such as a baseboard management controller (BMC) to restart the operating system.
[0093] In a possible implementation manner, the dump configuration information further 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:
[0094] S3051: When the storage time of the operating data reaches the dump duration limit, a restart instruction is sent to the operating system. That is, the acceleration card 120 can send a restart instruction to the operating system in advance when the storage time of the operating data reaches the dump duration limit. In particular, the acceleration card 120 can dump the full amount of operating data after completing the dump of the operating 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 operating data reaches the dump duration limit, without waiting until the full amount of operating data dump is completed, so as to minimize the impact on service interruption.
[0095] Figure 4 Another flowchart of a method for processing an operating system failure provided by an embodiment of the present application is shown. As shown in the figure, the method 400 for processing an operating system failure includes the following steps:
[0096] S401: Obtain dump configuration information of an operating system of a host, where the dump configuration information includes a physical address space;
[0097] S402: Determine a virtual address space corresponding to the physical address space according to the dump configuration information;
[0098] S403: 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;
[0099] S404: performing a data preprocessing operation on the operation data, wherein the data preprocessing operation includes encryption processing and compression processing;
[0100] 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.
[0101] The following is explained with reference to specific examples. When the accelerator card 120 detects an abnormality in the operating system, 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 stores the data in the 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 saved in the first non-volatile storage device; the accelerator card 120 can also compress and encrypt the operating data, and then 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 connected to each other in communication.
[0102] Figure 5One of the structural schematic diagrams of the acceleration card provided in the embodiment of the present application is shown. As shown in the figure, the acceleration card 120 includes:
[0103] The dump module 121 is used to obtain dump configuration information of the operating system of the 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 access running data in the physical memory of the operating system according to the virtual address space when an abnormality occurs in the operating system;
[0104] A DMA engine 122, for storing the operation data in a non-volatile storage device;
[0105] The non-volatile storage device 123 is used to store the operating data in the physical memory of the operating system.
[0106] In a possible implementation, the dump configuration information further includes a processor architecture, a kernel page table address, and memory management metadata; when the dump module 121 is used to access the operating data in the physical memory of the operating system according to the virtual address space, it is specifically used to:
[0107] 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;
[0108] 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;
[0109] According to the target virtual address, the running data in the physical memory of the operating system is accessed.
[0110] In a possible implementation, the dump configuration information further includes a priority dump address space; when the dump module 121 is used to access the operating data in the physical memory of the operating system according to the virtual address space, it is specifically used to:
[0111] Configuring an access priority for a virtual address space corresponding to the priority dump address space;
[0112] 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.
[0113] In a possible implementation manner, when the dump module 121 is used to access the operating data in the physical memory of the operating system according to the virtual address space, it is specifically used to:
[0114] Dividing the virtual address space into a plurality of virtual address subspaces;
[0115] According to the multiple virtual address subspaces, the operating data in the physical memory of the operating system is accessed in parallel.
[0116] When the dump module 121 is used to detect an abnormality in the operating system, it is specifically used to: receive a handshake message sent periodically by the host; and determine that an abnormality has occurred in the operating system when no handshake message is received from the host within a preset time.
[0117] Alternatively, when the dump module 121 is used to detect that an abnormality occurs in the operating system, it is specifically used to: determine that an abnormality occurs in the operating system when an abnormality instruction sent by the host is received.
[0118] In a possible implementation manner, the acceleration card 120 further includes:
[0119] The instruction sending module is used to send a restart instruction to the operating system when it is determined that the operation data has been stored, and the restart instruction is used to trigger the operating system to perform a restart operation.
[0120] In a possible implementation, the dump configuration information further 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 operation data has been stored, it is specifically used to:
[0121] When the storage time of the operating data reaches the dump time limit, a restart instruction is sent to the operating system.
[0122] In a possible implementation, Figure 6 As shown in, the acceleration card 120 also includes an encryption module 124, a compression module 125 and a network transmission module 126, and the non-volatile storage device 123 includes a first non-volatile storage device 1231 and a second non-volatile storage device; the operating data obtained 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 obtained by the dump module 121 can also be encrypted by the encryption module 124 and 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.
[0123] The embodiment of the present application provides an acceleration card, which includes a dump module, a DMA engine and a non-volatile storage device. The dump module is used to obtain 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 because of the configuration of the kernel dump, which can improve the resource utilization of the host system, and the operating system does not need to be restarted twice in the event of an abnormal dump, which can improve the reliability and dump efficiency of the operating system abnormal dump.
[0124] Figure 7 A schematic diagram of the hardware structure of an electronic device that implements the embodiments of the present application is shown. 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. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the computer device may also include hardware required for other services.
[0125] The processor, the network interface and the memory may be interconnected through an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0126] The memory stores the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0127] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating the target user at the logical level. The processor executes the program stored in the memory and specifically performs: Figure 2-4The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0128] The above application Figure 2-4 The method disclosed in the illustrated embodiment may be implemented in a processor or by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0129] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0130] Of course, in addition to software implementation methods, the electronic device of the present 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.
[0131] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 2-4The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0132] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0133] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 1-3 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0134] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0135] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with 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 smart phone, 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.
[0136] Computer readable media include 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, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape 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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0137] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0138] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A method for processing an operating system failure, characterized in that: include: 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, characterized in that 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, characterized in that: 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, characterized in that: 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, characterized in that 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, characterized in that 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, characterized in that 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, characterized in that 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, characterized in that: 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, characterized in that: include: 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, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method for processing operating system failure as described in any one of claims 1 to 9 are implemented.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is 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.
Citation Information
Cited By
Fault positioning method and device, storage medium and computer program product
CN119003225A
System testing method, device, equipment and medium
CN122777446A
