Fault processing method and computing device
By storing multi-bit ECC fault information in the computing device for restart processing, the problem of long multi-bit ECC fault location time is solved and the efficiency of fault processing is improved.
Patent Information
- Application Number
- CN202410533813.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-04-29
AI Technical Summary
When using multi-bit ECC fault processing, the computing device needs to spend a lot of time locating the fault, resulting in low processing efficiency.
When a multi-bit ECC fault is detected, a restart command is triggered and the fault information is stored in a non-volatile storage space so that the computing device can perform fault processing based on this information after restarting, shortening fault location time and improving processing efficiency.
By storing fault information in non-volatile storage space, the computing device can quickly locate the cause of the fault and handle it after restarting, significantly improving the processing efficiency of multi-bit ECC faults.
Smart Images

Figure CN118550758A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of computing devices, and in particular, to a fault handling method and a computing device. Background Art
[0002] When a fault is detected in a computing device, the fault needs to be handled in a timely manner.
[0003] In the related art, the faults in the computing device can be processed by the Error Checking and Correcting (ECC) technology. For example, the computing device includes hardware ECC, as well as random access memory (RAM) and flash memory and other memories. The hardware ECC can detect and correct the ECC errors in the memory to ensure the integrity and reliability of the data and program codes in these memories. During the data storage and transmission process, when a single bit in the memory has an error, the hardware ECC can calculate the correct value through the redundant bits in the memory and write the correct value back to the corresponding memory; when multiple bits in the memory have an error, the hardware ECC usually reports the error information to the computing device by triggering an error interrupt, so that the computing device can handle the error.
[0004] However, when using the ECC technology to process multi-bit ECC faults, the computing device needs to spend a lot of time to locate the multi-bit ECC faults, resulting in low efficiency in processing the multi-bit ECC faults. Summary of the invention
[0005] The embodiments of the present application provide a fault handling method and a computing device. After a multi-bit ECC fault occurs in the computing device, fault information of the multi-bit ECC fault is stored in a non-volatile storage space, so that after the computing device is restarted, the fault can be handled according to the fault information in the non-volatile storage space, thereby shortening the location time of the multi-bit ECC fault and improving the fault handling efficiency.
[0006] In a first aspect, an embodiment of the present application provides a fault handling method, including:
[0007] triggering a restart instruction upon detecting a multi-bit error checking and correcting (ECC) failure in the computing device;
[0008] Calling a target callback function based on the restart instruction, the target callback function is used to obtain fault information of a multi-bit ECC fault, and store the fault information in a target storage space, the target storage space being a non-volatile storage space;
[0009] The computing device is restarted, and the multi-bit ECC fault is processed based on the fault information in the target storage space.
[0010] In the above technical solution, after a multi-bit ECC fault occurs in a computing device, the fault information of the multi-bit ECC fault is stored in a non-volatile storage space, so that after the computing device is restarted, the fault can be processed according to the fault information in the non-volatile storage space, thereby shortening the locating time of the multi-bit ECC fault and improving the fault processing efficiency.
[0011] In a possible implementation, determining a target callback function includes:
[0012] Invoking a target notification chain based on the restart instruction;
[0013] Determine the target callback function corresponding to the target notification chain, and execute the target callback function;
[0014] Wherein, the target notification chain and the target callback function are pre-registered.
[0015] In the above technical scheme, the target callback function can be queried based on the target notification chain corresponding to the restart instruction, so that before the computing device is restarted, the fault information of the multi-bit ECC fault can be stored in the target storage space based on the target callback function, so that after the computing device is restarted, the fault processing can be performed according to the fault information in the non-volatile storage space, thereby shortening the locating time of the multi-bit ECC fault and improving the fault processing efficiency.
[0016] In a possible implementation, executing the target callback function includes:
[0017] Acquiring the fault information through an information recording code, wherein the information recording code is loaded into the computing device after the computing device is powered on;
[0018] The target storage space is determined, and the fault information is stored in the target storage space.
[0019] In the above technical scheme, fault information can be obtained based on the information recording code loaded after the computing device is powered on, and the fault information can be stored in the target storage space, so that after the computing device is subsequently restarted, the cause of the multi-bit ECC fault can be quickly located according to the fault information in the target storage space, so as to speed up the fault handling efficiency of the multi-bit ECC fault.
[0020] In a possible implementation manner, determining the target storage space includes:
[0021] Determine a storage space identifier based on the target callback function;
[0022] The target storage space is determined according to the storage space identifier.
[0023] In the above technical solution, the target storage space can be quickly determined based on the storage space identifier in the target callback function, so as to speed up the storage of fault information in the target storage space.
[0024] In a possible implementation, performing fault processing on the multi-bit ECC fault based on the fault information in the target storage space includes:
[0025] Acquire the fault information in the target storage space;
[0026] Performing fault location processing on the multi-bit ECC fault according to the fault information to obtain a fault cause of the multi-bit ECC fault;
[0027] Fault processing is performed on the multi-bit ECC fault based on the fault cause.
[0028] In the above technical solution, after the computing device is restarted, the cause of the multi-bit ECC fault can be quickly located according to the fault information in the target storage space, so as to speed up the fault handling efficiency of the multi-bit ECC fault.
[0029] In a possible implementation, before calling the target callback function based on the restart instruction, the method further includes:
[0030] In response to a power-on instruction of the computing device, loading information recording code;
[0031] The information recording code is executed to register a target notification chain and the target callback function corresponding to the target notification chain.
[0032] In the above technical solution, after the computing device is powered on, the information recording code can be loaded and executed to register the target notification chain and the target callback function, so that after a multi-bit ECC failure occurs, the computing device can store the fault information of the multi-bit ECC failure to the target storage space based on the target callback function, so that after the computing device is restarted, the fault processing can be performed according to the fault information in the non-volatile storage space, thereby shortening the locating time of the multi-bit ECC failure and improving the fault processing efficiency.
[0033] In a possible implementation, the method further includes:
[0034] Unloading the information recording code based on the uninstall instruction;
[0035] The target notification chain and the target callback function are deleted in the registration information.
[0036] In the above technical solution, the loading information recording code can be canceled based on the uninstall instruction, and the target notification chain and the target callback function can be deleted in the registration information, so that the loading of the information recording code is more flexible.
[0037] In a possible implementation, the method further includes:
[0038] When a single-bit ECC fault is detected in the computing device, determining a fault number corresponding to the single-bit ECC fault;
[0039] When it is determined that the number of failures is greater than or equal to a preset threshold, an alarm message is generated, where the alarm message is used to prompt processing of the single-bit ECC failure.
[0040] In the above technical solution, it is possible to detect whether a computing device has a single-bit ECC fault, and to issue an alarm for a single-bit ECC fault that occurs multiple times, so that maintenance personnel can handle the single-bit ECC fault in a timely manner.
[0041] In a second aspect, an embodiment of the present application provides a fault handling device, including:
[0042] A trigger module, configured to trigger a restart instruction upon detecting a multi-bit error checking and correcting (ECC) failure in the computing device;
[0043] A calling module, used to call a target callback function based on the restart instruction, wherein the target callback function is used to obtain fault information of a multi-bit ECC fault and store the fault information in a target storage space, wherein the target storage space is a non-volatile storage space;
[0044] A restart module, used to restart the computing device;
[0045] A fault processing module is used to perform fault processing on the multi-bit ECC fault based on the fault information in the target storage space.
[0046] In a possible implementation, the calling module is specifically used to:
[0047] Invoking a target notification chain based on the restart instruction;
[0048] Determine the target callback function corresponding to the target notification chain, and execute the target callback function;
[0049] Wherein, the target notification chain and the target callback function are pre-registered.
[0050] In a possible implementation, the calling module is further configured to:
[0051] Acquiring the fault information through an information recording code, wherein the information recording code is loaded into the computing device after the computing device is powered on;
[0052] The target storage space is determined, and the fault information is stored in the target storage space.
[0053] In a possible implementation, the calling module is further configured to:
[0054] Determine a storage space identifier based on the target callback function;
[0055] The target storage space is determined according to the storage space identifier.
[0056] In a possible implementation, the fault processing module is specifically used to:
[0057] Acquire the fault information in the target storage space;
[0058] Performing fault location processing on the multi-bit ECC fault according to the fault information to obtain a fault cause of the multi-bit ECC fault;
[0059] Fault processing is performed on the multi-bit ECC fault based on the fault cause.
[0060] In a possible implementation, the fault handling device further includes a loading module and an execution module; before calling the target callback function based on the restart instruction, the loading module is used to load the information recording code in response to the power-on instruction of the computing device;
[0061] The execution module is used to execute the information recording code to register the target notification chain and the target callback function corresponding to the target notification chain.
[0062] In a possible implementation, the fault handling device further includes an uninstallation module and a deletion module; wherein:
[0063] The uninstall module is used to cancel the loading of the information recording code based on the uninstall instruction;
[0064] The deleting module is used to delete the target notification chain and the target callback function in the registration information.
[0065] In a possible implementation, the fault handling device further includes a determination module and a generation module; wherein:
[0066] The determination module is used to determine the number of failures corresponding to the single-bit ECC failure when a single-bit ECC failure is detected in the computing device;
[0067] The generating module is used to generate alarm information when it is determined that the number of failures is greater than or equal to a preset threshold, and the alarm information is used to prompt to process the single-bit ECC failure.
[0068] In a third aspect, an embodiment of the present application provides a computing device, including: a processor and a memory; the processor and the memory are coupled;
[0069] The memory is used to store computer instructions;
[0070] The processor is configured to execute computer instructions stored in the memory to perform the method as described in any one of the first aspects.
[0071] In a fourth aspect, an embodiment of the present application provides a chip, wherein the chip is used to execute the method as described in any one of the first aspects.
[0072] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer, the method as described in any one of the first aspects is implemented.
[0073] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements a method as described in any one of the first aspects.
[0074] The fault handling method and computing device provided by the embodiment of the present application can trigger a restart instruction when a multi-bit ECC fault is detected in the computing device; call a target callback function based on the restart instruction to obtain fault information of the multi-bit ECC fault, and store the fault information in a target storage space; restart the computing device, and perform fault handling on the multi-bit ECC fault based on the fault information in the target storage space. The target storage space is a non-volatile storage space, so that after the computing device is restarted, the multi-bit ECC fault can be quickly handled based on the fault information in the target storage space, which is conducive to accelerating the fault location speed of the multi-bit ECC fault based on the fault information, and thus is conducive to improving the processing efficiency of the multi-bit ECC fault. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0076] Figure 1 A schematic diagram of a software architecture of a computing device provided in an embodiment of the present application;
[0077] Figure 2 A flowchart of a fault handling method provided in an embodiment of the present application;
[0078] Figure 3 A flowchart of another fault handling method provided in an embodiment of the present application;
[0079] Figure 4 A schematic diagram of an implementation process of an ECC information recording module provided in an embodiment of the present application;
[0080] Figure 5 A schematic diagram of the structure of a fault handling device provided in an embodiment of the present application;
[0081] Figure 6 A schematic diagram of the structure of another fault handling device provided in an embodiment of the present application;
[0082] Figure 7 A schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0083] 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, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0084] First, the relevant terms involved in the embodiments of the present application are explained.
[0085] ECC technology: In the computer field, data is stored in various types of memories (for example, RAM and Flash memories). The integrity and reliability of the data in the memory can be guaranteed by hardware ECC technology to avoid data corruption when the memory is subject to various external interferences (for example, electromagnetic interference, electrical noise or circuit short circuit, etc.).
[0086] Hardware ECC: refers to hardware with ECC error correction capability. Hardware ECC can add additional storage units outside the memory area open to users to store ECC calculation results, so ECC usually does not occupy additional RAM space. When data is read, hardware ECC will verify the correctness of the data to be read in real time. When an ECC error is detected, hardware ECC will automatically correct the data to be read in a timely manner, or generate an ECC error notification and implement corresponding safety mechanisms.
[0087] Typically, ECC errors are caused by bit flips or corruption in the chip's memory or cache, and these chips usually have hardware ECC support to protect data integrity.
[0088] Cache: A storage medium that may have ECC errors. For example, the cache in a processor chip is divided into L1 / L2 / L3 levels, and each level may have ECC errors. In some scenarios (for example, when there are multiple bit errors), ECC errors may not be able to be repaired, resulting in data corruption in the cache or system crashes. In view of this, measures need to be taken to regularly back up and monitor the data in the cache to minimize data corruption issues.
[0089] In some implementations, faults in computing devices can be processed by ECC technology. For example, a computing device includes hardware ECC and memory, and the hardware ECC can detect and correct ECC errors in the memory to ensure the integrity and reliability of the data and program codes in these memories. Specifically, during data storage and transmission, when a single bit in the memory has an error, the hardware ECC can automatically calculate the correct value through the redundant bits in the memory and write the correct value back to the corresponding memory; when multiple bits in the memory have an error, the hardware ECC usually reports the error information to the computing device by triggering an error interrupt, so that the computing device can handle the error. However, when using ECC technology to handle multi-bit ECC faults, the computing device needs to spend a lot of time to locate the multi-bit ECC faults, resulting in low efficiency in handling multi-bit ECC faults.
[0090] In view of this, an embodiment of the present application provides a fault handling method, which can trigger a restart instruction when a multi-bit ECC fault is detected in a computing device, call a target callback function based on the restart instruction, and store the fault information of the multi-bit ECC fault in a target storage space through the target callback function; restart the computing device, and perform fault handling on the multi-bit ECC fault based on the fault information in the target storage space. The target storage space is a non-volatile storage space, so that after the computing device is restarted, the multi-bit ECC fault can be quickly handled based on the fault information in the target storage space, which is conducive to accelerating the fault location speed of the multi-bit ECC fault based on the fault information, and thus is conducive to improving the processing efficiency of the multi-bit ECC fault.
[0091] For ease of understanding, the fault handling method provided in the embodiment of the present application is described below in conjunction with Figure 1 , the software architecture of the computing device involved in the embodiments of the present application is described.
[0092] Figure 1 A software architecture diagram of a computing device provided in an embodiment of the present application. Figure 1 , a kernel reset module and an ECC information recording module are provided in the computing device, wherein,
[0093] The kernel reset module is used to perform a restart process on the computing device, and the restart process includes a normal restart process (reboot), a restart process under abnormal conditions (panic and oops), and a watchdog restart process.
[0094] In one scenario, fault detection processing can be performed on a computing device. When a multi-bit ECC fault is detected in the computing device, a restart instruction can be triggered to control the kernel reset module to restart the computing device under abnormal circumstances based on the restart instruction.
[0095] The kernel reset module can provide a callback function registration interface to the outside. For any module in the kernel, the notification chain corresponding to the module and the callback function corresponding to the notification chain can be registered in the kernel reset module through the registration interface. In response to the restart instruction of the computing device, the kernel reset module can call the callback function corresponding to each notification chain to enable each module to execute the callback function.
[0096] The ECC information recording module is used to, in response to a restart instruction of the computing device, determine a target notification chain corresponding to the restart instruction, and execute a target callback function corresponding to the target notification chain, so as to obtain fault information of a multi-bit ECC fault through the target callback function, and store the fault information in a target storage space.
[0097] It should be noted that, in some examples, the "callback function" in the embodiments of the present application may also be referred to as a "hook function".
[0098] For example, in Figure 1 In the embodiment, the ECC information recording module can register the notification chain 1 and the callback function 1 corresponding to the notification chain 1 in the kernel reset module through the registration interface. According to the restart instruction of the kernel reset module, the notification chain 1 corresponding to the ECC information recording module and the callback function 1 corresponding to the notification chain 1 are called.
[0099] The ECC information recording module is a flexibly registered kernel module, which can be flexibly loaded when the computing device is powered on based on different business needs of the user. For example, if the ECC information recording module is loaded based on the business needs of the user, the notification chain corresponding to the ECC information recording module and the callback function corresponding to the notification chain can be registered in the kernel reset module. If it is determined that the ECC information recording module does not need to be loaded based on the business needs of the user, there is no need to register the corresponding notification chain and the callback function corresponding to the notification chain in the kernel reset module.
[0100] In one example, based on user needs, the ECC information recording module can be uninstalled, and after the uninstallation is completed, the notification chain corresponding to the ECC information recording module and the callback function corresponding to the notification chain are deleted in the kernel reset module.
[0101] The callback function corresponding to the ECC information recording module can be implemented based on the ECC information recording module. The ECC information recording module can be used to receive multiple callback functions input by the user. These multiple callback functions can correspond to different business requirements to implement various functions through the callback functions. When the callback function is executed through the ECC information recording module, the fault information (e.g., ECC information) in the computing device can be recorded, and the recorded fault information can be stored in the target storage space, which is a non-volatile storage space.
[0102] The technical solutions of the embodiments of the present application are described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0103] Figure 2 This is a flowchart of a fault handling method provided in an embodiment of the present application. Figure 2 , the method specifically comprises:
[0104] S201. When a multi-bit ECC fault is detected in a computing device, a restart instruction is triggered.
[0105] The execution entity of this method can be Figure 1 The computing device in the embodiment may be Figure 1 Executed by a processor in a computing device in the.
[0106] The computing device includes but is not limited to an independent physical server or server node, or a server cluster consisting of multiple physical servers, or a smart phone, tablet computer, laptop computer, desktop computer, portable computer, etc.
[0107] When a multi-bit ECC fault is detected in a computing device, an error interrupt may be triggered. Based on the error interrupt, the computing device may trigger a restart instruction (eg, a panic instruction) in an abnormal situation.
[0108] S202: Call a target callback function based on the restart instruction.
[0109] The target callback function is used to obtain the fault information of the multi-bit ECC fault and store the fault information in the target storage space.
[0110] The fault information of the multi-bit ECC fault may include: when the multi-bit ECC fault occurs, each level (eg, level L1, level L2, and level L3) of the processor caches corresponding register values.
[0111] In some scenarios, a computing device may also have a single-bit ECC fault. During the process of calling the target callback function, fault information of the single-bit ECC fault may also be obtained based on the target callback function.
[0112] The failure information of the single-bit ECC failure may include: multiple types of single-bit ECC failures, and the number of occurrences and failure information of each type of single-bit ECC failure.
[0113] Can be based on Figure 1 The ECC information recording module in the embodiment obtains the fault information of the multi-bit ECC fault and the fault information of the single-bit ECC fault. The ECC information recording module can provide a configuration service of the fault information to the user, so that the user can configure different information recording methods corresponding to the fault information for different types of ECC faults in the ECC information recording module based on the configuration service. Exemplarily, different types of ECC faults may include: single-bit ECC faults, multi-bit ECC faults, and other types of ECC faults.
[0114] For example, for a multi-bit ECC fault, the user needs to know the register values corresponding to each level of cache of the processor when the multi-bit ECC fault occurs, then the user can configure the information recording method of the multi-bit ECC fault in the ECC information recording module as follows: record the register values corresponding to each level of cache of the processor; for different types of single-bit ECC faults, the user needs to know the number of times each type of single-bit ECC fault occurs in the computing device, then the user can configure the information recording method of the single-bit ECC fault in the ECC information recording module as follows: record the number of times each type of single-bit ECC fault occurs and the fault information.
[0115] The target storage space is a non-volatile storage space, and the fault information in the target storage space is used to perform fault processing on the computing device after the computing device is restarted.
[0116] Optionally, an association relationship between a restart instruction and a target callback function can be established. When the computing device restarts (including normal restart, restart under abnormal conditions, and restart after watchdog reset, etc.), the target callback function can be called to obtain fault information corresponding to various types of ECC faults, so that the health status of the hardware ECC can be monitored in time after each restart of the computing device. For example, after a normal restart process, the computing device can obtain the number of faults of different types of single-bit ECC faults based on the target callback function, and perform alarm processing when the number of faults is greater than or equal to a preset threshold.
[0117] S203: Restart the computing device, and perform fault processing on the multi-bit ECC fault based on the fault information in the target storage space.
[0118] Can be based on Figure 1 The kernel reset module in the embodiment restarts the computing device.
[0119] It can be understood that after the computing device is restarted, the computing device can read the fault information in the target storage space, and can also quickly locate the fault cause corresponding to the multi-bit fault based on the fault information read by the computing device, and perform fault processing on the multi-bit ECC fault based on the fault cause.
[0120] The fault handling method provided in the embodiment of the present application can trigger a restart instruction when a multi-bit ECC fault is detected in a computing device, and call a target callback function based on the restart quality, so that the fault information of the multi-bit ECC fault is stored in a target storage space through the target callback function; the computing device is restarted, and the multi-bit ECC fault is handled based on the fault information in the target storage space. The target storage space is a non-volatile storage space, so that the computing device can still find the fault information in the target storage space after the computing device is restarted, and the cause of the multi-bit ECC fault is quickly located based on the fault information, and the multi-bit ECC fault is handled, which is conducive to speeding up the speed of locating the multi-bit ECC fault, and further conducive to improving the processing efficiency of the multi-bit ECC fault.
[0121] Figure 3 This is a flowchart of another fault handling method provided in the embodiment of the present application. Figure 3 , the method may specifically include:
[0122] S301: Perform fault detection processing on a computing device.
[0123] In an example, a hardware ECC may be provided in the computing device, and the hardware ECC may be used to detect whether the computing device has an ECC fault, and the ECC fault may include a multi-bit ECC fault and a single-bit ECC fault.
[0124] For example, when the hardware ECC detects a multi-bit ECC fault caused by a multi-bit error in the cache, an error interrupt can be triggered and fault information of the multi-bit ECC fault can be reported to the core of the computing device to remind the computing device to take corresponding fault handling measures.
[0125] S302: When a multi-bit ECC failure is detected, trigger a restart instruction.
[0126] It should be noted that the specific execution process of step S302 can refer to the specific execution process of step S201, which will not be repeated here.
[0127] S303: Call the target notification chain based on the restart instruction.
[0128] S304: Determine the target callback function corresponding to the target notification chain.
[0129] Among them, the target notification chain and target callback function are pre-registered.
[0130] See also Figure 1 The kernel reset module in the computing device can provide a callback function registration interface to other modules in the computing device, and other modules can register corresponding notification chains and callback functions based on the registration interface. The kernel reset module can record the notification chains and callback functions corresponding to each module in the computing device based on the registration information. The kernel reset module can query the target callback function corresponding to the target notification chain in the registration information based on the target notification chain.
[0131] In one implementation, before determining the target callback function, the target callback function may be registered in the following manner: in response to a power-on instruction of the computing device, loading an information recording code; executing the information recording code to register a target notification chain and a target callback function.
[0132] In another implementation, the loading information recording code may be canceled based on the uninstall instruction; and the target notification chain and the target callback function may be deleted from the registration information.
[0133] The information recording code can be flexibly loaded when the computing device is powered on based on different business needs of the user. It is understandable that when the information recording code is successfully loaded, the information recording code takes effect.
[0134] The information recording code can be provided in the form of a kernel ko, for example, in Figure 1 In the example, the information recording code may be provided in the form of an ECC information recording module (cache_ecc.ko).
[0135] The ECC information recording module (cache_ecc.ko) can be flexibly loaded or unloaded. For example, the configuration parameters of the computing device can be configured based on the configuration instructions input by the user, so that the computing device can load the ECC information recording module (cache_ecc.ko) after power-on startup. Based on the unloading instruction input by the user, the ECC information recording module (cache_ecc.ko) can be unloaded to delete the function corresponding to the ECC information recording module (cache_ecc.ko), and the notification chain corresponding to the ECC information recording module and the callback function corresponding to the notification chain are deleted in the registration information (e.g., notification chain list) of the kernel reset module to achieve flexible adjustment of functions.
[0136] The ECC information recording module may also register the association relationship between its corresponding notification chain and the restart instruction, so that when the restart instruction is triggered, the notification chain of the module may be called.
[0137] For example, the module is an ECC information recording module, the notification chain corresponding to the ECC information recording module is a target notification chain, and the callback function is a target callback function. The ECC information recording module can register the target notification chain, the target callback function, and the association between the target notification chain and the restart instruction to the kernel reset module based on the registration interface, so that when the restart instruction of the kernel reset module is triggered, the target notification chain corresponding to the ECC information recording module can be called, and the target callback function corresponding to the target notification chain can be determined based on the registration information.
[0138] S305. Obtain fault information through the information recording code.
[0139] The information recording code may be loaded into the computing device after the computing device is powered on. In the kernel of the computing device, the information recording code may exist in the form of a software module, for example, in Figure 1 In the embodiment, the information recording code may exist in the form of an ECC information recording module.
[0140] The information recording code may include methods for obtaining fault information of different types of faults. When a multi-bit ECC fault is detected, a target method for obtaining the fault information of the multi-bit ECC fault may be determined according to the information recording code, and the fault information of the multi-bit ECC fault may be obtained according to the target method.
[0141] S306: Determine a target storage space, and store the fault information in the target storage space.
[0142] In one implementation, the storage space identifier may be determined based on the target callback function; and the target storage space may be determined according to the storage space identifier.
[0143] The target callback function may include a storage space identifier. In an example, the storage space identifier may be quickly determined in the target callback function based on a keyword search or the like.
[0144] In one example, the storage space identifier may be stored as a name or address of the storage space.
[0145] According to different types of ECC faults, fault information corresponding to each type of ECC fault may be classified and stored in the target storage space. For example, fault information corresponding to a multi-bit ECC fault and fault information corresponding to a single-bit ECC fault may be stored separately.
[0146] S307: Restart the computing device.
[0147] Can be Figure 1 The kernel reset module in performs a restart operation of the computing device.
[0148] S308: Obtain fault information in the target storage space.
[0149] Optionally, after the computing device is restarted, the computing device may receive a control instruction input by a maintenance person, where the control instruction is used to obtain fault information in the target storage space.
[0150] S309: Perform fault location processing on the multi-bit ECC fault according to the fault information to obtain the fault cause of the multi-bit ECC fault.
[0151] The fault information of the multi-bit ECC fault may include register values corresponding to each level of cache cached before the multi-bit ECC fault. For example, the cache generally includes L1 cache, L2 cache and L3 cache, and each level of cache may include a tag and data. When a multi-bit ECC fault occurs in the cache in the processor, the fault information of the multi-bit ECC fault may include register value 1 corresponding to the L1 cache, register value 2 corresponding to the L2 cache and register value 3 corresponding to the L3 cache.
[0152] The fault information of multi-bit ECC fault can be used to quickly locate whether there is a data interruption (cache data abort) exception in the cache. If there is a data interruption (cache data abort) exception, it can be determined whether the L1 cache in the cache is abnormal according to register value 1, and whether the L2 cache is abnormal according to register value 2. After finding that any one of the above two levels of cache is abnormal, corresponding measures can be taken to handle the fault.
[0153] When the multi-bit ECC interrupt of the L3 cache in the computing device is turned on, if the computing device detects the multi-bit ECC interrupt, the multi-bit ECC failure of the L3 cache can be recorded in the form of a log and a restart operation of the computing device can be performed.
[0154] S310: Perform fault processing on the multi-bit ECC fault based on the fault cause.
[0155] A corresponding fault handling method may be determined based on the fault cause, and the multi-bit ECC fault may be handled based on the fault handling method.
[0156] In one implementation, the method may include the following steps:
[0157] S311. When a single-bit ECC fault is detected in a computing device, determine the number of faults corresponding to the single-bit ECC fault.
[0158] The fault information of various types of single-bit ECC faults may be recorded by the ECC information recording module, and the fault times corresponding to various types of single-bit ECC faults may be determined according to the fault information of the single-bit ECC faults.
[0159] The failure information of the single-bit ECC failure may include: multiple types of single-bit ECC failures, and the number of occurrences and the failure cause of each type of single-bit ECC failure.
[0160] S312: When it is determined that the number of failures is greater than or equal to a preset threshold, generate an alarm message.
[0161] The alarm information is used to prompt the user to handle the single-bit ECC failure.
[0162] Based on the fault information of the single-bit ECC fault recorded by the ECC information recording module, the computing device can realize timely monitoring of the health status of the computing device and issue an early warning. For example, when it is found that the number of failures of a certain type of single-bit ECC fault is greater than or equal to a preset threshold, an alarm can be issued to the processor in the computing device (or the processing system running on the processor) so that the single-bit ECC fault of this type can be processed in time to ensure the health status of the computing device.
[0163] The computing device may record the fault information of each ECC fault in the form of a log. For example, the computing device may use a periodic polling method (e.g., a frequency of 1 second) to discover single-bit parity and ECC errors of each level of cache (L1, L2, or L3 level), and record the parity and ECC errors in the form of a log.
[0164] The fault handling method provided in the embodiment of the present application can perform fault detection processing on the computing device, and when a multi-bit ECC fault is detected, trigger a restart instruction, call the target notification chain according to the restart instruction, and execute the target callback function corresponding to the target notification chain, so as to store the fault information in the target storage space through the target callback function; after the computing device is restarted, the fault information can be obtained in the target storage space, and based on the fault information, the multi-bit ECC fault can be fault located, so as to quickly locate the cause of the multi-bit ECC fault, which is conducive to improving the fault handling efficiency.
[0165] Next, combine Figure 4 , the implementation process of the ECC information recording module is explained.
[0166] Figure 4 A schematic diagram of the implementation process of an ECC information recording module provided in an embodiment of the present application. Figure 4 , the process may include:
[0167] S401. Add an ECC information recording module in a computing device.
[0168] S402: Configure a target notification chain corresponding to the ECC information recording module and a target callback function corresponding to the target notification chain.
[0169] The callback function may include the type of fault information to be obtained and a storage space identifier, where the storage space identifier is used to indicate a target storage space corresponding to the fault information.
[0170] S403: Call the registration interface of the callback function in the kernel reset module, and register the target notification chain of the ECC information recording module and the target callback function corresponding to the target notification chain to the kernel reset module through the registration interface.
[0171] After the notification chain corresponding to the ECC information recording module and the callback function corresponding to the notification chain are configured, the computing device can receive instructions input by the developer to enable the computing device to call the registration interface of the notification chain in the kernel reset module (see Figure 1 ), and registers the notification chain of the ECC information recording module and the callback function corresponding to the notification chain to the kernel reset module through the registration interface.
[0172] S404 . In response to a power-on instruction of the computing device, load an ECC information recording module.
[0173] By loading the ECC information recording module, it is convenient for the kernel reset module to call the ECC information recording module through the registered callback function.
[0174] During the implementation of the ECC information recording module provided in the embodiment of the present application, various functions of the ECC information recording module (for example, a notification chain, a callback function, the type and method of obtaining fault information, etc.) can be flexibly configured based on the information input by the user, so that the different business needs of the user can be met based on the callback function, and the loading status of the ECC information recording module can be flexibly adjusted.
[0175] Figure 5 This is a schematic diagram of the structure of a fault handling device provided in an embodiment of the present application. Figure 5 , the fault handling device 10 may include:
[0176] A trigger module 11 is used to trigger a restart instruction when a multi-bit error checking and correcting ECC failure is detected in the computing device;
[0177] A calling module 12, configured to call a target callback function based on the restart instruction, wherein the target callback function is configured to obtain fault information of a multi-bit ECC fault and store the fault information in a target storage space, wherein the target storage space is a non-volatile storage space;
[0178] A restart module 13, used to restart the computing device;
[0179] The fault processing module 14 is used to perform fault processing on the multi-bit ECC fault based on the fault information in the target storage space.
[0180] In a possible implementation, the calling module 12 is specifically used for:
[0181] Invoking a target notification chain based on the restart instruction;
[0182] Determine the target callback function corresponding to the target notification chain, and execute the target callback function;
[0183] Wherein, the target notification chain and the target callback function are pre-registered.
[0184] In a possible implementation, the calling module 12 is further configured to:
[0185] Acquiring the fault information through an information recording code, wherein the information recording code is loaded into the computing device after the computing device is powered on;
[0186] The target storage space is determined, and the fault information is stored in the target storage space.
[0187] In a possible implementation, the calling module 12 is further configured to:
[0188] Determine a storage space identifier based on the target callback function;
[0189] The target storage space is determined according to the storage space identifier.
[0190] In a possible implementation, the fault processing module 14 is specifically configured to:
[0191] Acquire the fault information in the target storage space;
[0192] Performing fault location processing on the multi-bit ECC fault according to the fault information to obtain a fault cause of the multi-bit ECC fault;
[0193] Fault processing is performed on the multi-bit ECC fault based on the fault cause.
[0194] The fault handling device provided in the embodiment of the present application can implement the fault handling method described in the above method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0195] Figure 6 This is a schematic diagram of another fault handling device provided in an embodiment of the present application. Figure 6 ,exist Figure 5 Based on the structure of the fault processing device 10 shown, the fault processing device 10 may further include a loading module 15, an execution module 16, an unloading module 17, a deletion module 18, a determination module 19 and a generation module 20, wherein:
[0196] Before calling the target callback function based on the restart instruction, the loading module 15 is used to load the information recording code in response to the power-on instruction of the computing device;
[0197] The execution module 16 is used to execute the information recording code to register the target notification chain and the target callback function corresponding to the target notification chain.
[0198] In a possible implementation, the uninstall module 17 is used to cancel the loading of the information recording code based on the uninstall instruction;
[0199] The deleting module 18 is used to delete the target notification chain and the target callback function in the registration information.
[0200] In a possible implementation, the determination module 19 is used to determine the number of failures corresponding to the single-bit ECC failure when a single-bit ECC failure is detected in the computing device;
[0201] The generating module 20 is used to generate alarm information when it is determined that the number of failures is greater than or equal to a preset threshold, and the alarm information is used to prompt to process the single-bit ECC failure.
[0202] The fault handling device provided in the embodiment of the present application can implement the fault handling method described in the above method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0203] Figure 7 A hardware structure diagram of a computing device provided in an embodiment of the present application. Figure 7 The computing device 20 may include a processor 21 and a memory 22, and the processor 21 and the memory 22 are coupled. The processor 21 and the memory 22 may communicate with each other; illustratively, the processor 21 and the memory 22 communicate with each other via a communication bus 23.
[0204] The memory 22 is used to store computer instructions;
[0205] The processor 21 is used to execute the computer instructions stored in the memory 22 to implement the technical solution shown in the above method embodiment.
[0206] Optionally, the computing device 20 may further include a communication interface, which may include a transmitter and / or a receiver.
[0207] Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0208] An embodiment of the present application provides a computer-readable storage medium, on which computer-executable instructions are stored; when the computer-executable instructions are executed by a processor, they are used to implement the fault handling method described in the above embodiment.
[0209] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer executes the fault handling method described in the above embodiment.
[0210] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.
[0211] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0212] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0213] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0214] In the embodiments of the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". In the embodiments of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the embodiments of the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.
[0215] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, rather than to limit them. Although the embodiments of the present application have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A fault handling method, characterized in that: include: triggering a restart instruction upon detecting a multi-bit error checking and correcting (ECC) failure in the computing device; Calling a target callback function based on the restart instruction, the target callback function is used to obtain fault information of a multi-bit ECC fault, and store the fault information in a target storage space, the target storage space being a non-volatile storage space; The computing device is restarted, and the multi-bit ECC fault is processed based on the fault information in the target storage space.
2. The method according to claim 1, characterized in that Calling a target callback function based on the restart instruction includes: Invoking a target notification chain based on the restart instruction; Determine the target callback function corresponding to the target notification chain, and execute the target callback function; Wherein, the target notification chain and the target callback function are pre-registered.
3. The method according to claim 2, characterized in that Executing the target callback function includes: Acquiring the fault information through an information recording code, wherein the information recording code is loaded into the computing device after the computing device is powered on; The target storage space is determined, and the fault information is stored in the target storage space.
4. The method according to claim 3, characterized in that Determining the target storage space includes: Determine a storage space identifier based on the target callback function; The target storage space is determined according to the storage space identifier.
5. The method according to any one of claims 1 to 4, characterized in that: Performing fault processing on the multi-bit ECC fault based on the fault information in the target storage space includes: Acquire the fault information in the target storage space; Performing fault location processing on the multi-bit ECC fault according to the fault information to obtain a fault cause of the multi-bit ECC fault; Fault processing is performed on the multi-bit ECC fault based on the fault cause.
6. The method according to any one of claims 1 to 5, characterized in that: Before calling the target callback function based on the restart instruction, the method further includes: In response to a power-on instruction of the computing device, loading information recording code; The information recording code is executed to register a target notification chain and the target callback function corresponding to the target notification chain.
7. The method according to claim 6, characterized in that The method further comprises: Unloading the information recording code based on the uninstall instruction; The target notification chain and the target callback function are deleted in the registration information.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When a single-bit ECC fault is detected in the computing device, determining a fault number corresponding to the single-bit ECC fault; When it is determined that the number of failures is greater than or equal to a preset threshold, an alarm message is generated, where the alarm message is used to prompt processing of the single-bit ECC failure.
9. A computing device, characterized in that include: Processor and memory; The processor is coupled to the memory; The memory is used to store computer instructions; The processor is configured to execute computer instructions stored in the memory to perform the method according to any one of claims 1 to 8.
10. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for acquiring kernel error messages of Android system
CN102662785A
Method for positioning faulted memory in linux system
CN103198000A
Memory fault repairing method, CPU, OS, BIOS and server
CN115705261A
Error repair method and device, equipment and storage medium
CN117472657A
Hardware error processing method and computing device
CN117931493A
