Fault handling method and computing device
By storing the fault information of multi-bit ECC faults in non-volatile storage space before the computing device restarts, the problem of long fault location time in the prior art is solved, and fast fault handling is achieved.
Patent Information
- Application Number
- CN202410533813.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-04-29
AI Technical Summary
Existing technologies have low localization efficiency and take a lot of time when dealing with multi-bit ECC faults in computing devices, resulting in low processing efficiency.
When a multi-bit ECC fault is detected, a restart command is triggered and the target callback function is called to store the fault information in non-volatile storage space. After restarting, the fault is handled based on this information.
By storing fault information in non-volatile memory, the location time for multi-bit ECC faults is shortened, and fault handling efficiency is improved.
Smart Images

Figure CN118550758B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computing devices, and particularly relate to a fault processing method and a computing device. BACKGROUND
[0002] When a fault is detected in a computing device, the fault needs to be processed in a timely manner.
[0003] In related technologies, an Error Checking and Correcting (ECC) technology can be used to process faults in a computing device. For example, a computing device includes hardware ECC, as well as memories such as Random Access Memory (RAM) and Flash Memory. The hardware ECC can be used to detect and correct ECC errors in the memories, to ensure the integrity and reliability of data and program code in the memories. During data storage and transmission, when a single bit in the memories is erroneous, the hardware ECC can calculate the correct value by using redundant bits in the memories, and write the correct value back to the corresponding memories. When multiple bits in the memories are erroneous, the hardware ECC usually reports the error information to the computing device by triggering an error interrupt, so that the computing device can process 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
[0005] Embodiments of the present application provide a fault processing 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 the fault information can be used to process the fault after the computing device is restarted, the locating time of the multi-bit ECC fault is shortened, and the efficiency of fault processing is improved.
[0006] In a first aspect, embodiments of the present application provide a fault processing method, comprising:
[0007] detecting that a multi-bit Error Checking and Correcting (ECC) fault exists in a computing device;
[0008] calling a target callback function based on the restart instruction, the target callback function being configured to obtain fault information of the 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] restarting the computing device, and performing fault processing on the multi-bit ECC fault based on the fault information in the target storage space.
[0010] In the above technical solution, after the computing device has a multi-bit ECC fault, the fault information of the multi-bit ECC fault is stored in the non-volatile storage space, so that after the computing device is restarted, the fault information in the non-volatile storage space can be used for fault processing, the positioning time of the multi-bit ECC fault is shortened, and the fault processing efficiency is improved.
[0011] In a possible implementation, determining the target callback function comprises:
[0012] calling the target notification chain based on the restart instruction;
[0013] determining a target callback function corresponding to the target notification chain, and executing the target callback function;
[0014] The target notification chain and the target callback function are pre-registered.
[0015] In the above technical solution, 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 information in the non-volatile storage space can be used for fault processing, the positioning time of the multi-bit ECC fault is shortened, and the fault processing efficiency is improved.
[0016] In a possible implementation, executing the target callback function comprises:
[0017] obtaining the fault information through an information recording code, the information recording code being loaded to the computing device after the computing device is powered on;
[0018] determining the target storage space, and storing the fault information in the target storage space.
[0019] In the above technical solution, the fault information can be obtained based on the information recording code loaded to the computing device 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 restarted, the fault reason of the multi-bit ECC fault can be quickly located based on the fault information in the target storage space, so as to accelerate the fault processing efficiency of the multi-bit ECC fault.
[0020] In a possible implementation, determining the target storage space comprises:
[0021] determining a storage space identifier based on the target callback function;
[0022] According to the storage space identifier, the target storage space is determined.
[0023] In the technical solution, the target storage space can be quickly determined based on the storage space identifier in the target callback function, so as to accelerate the speed of storing the fault information into the target storage space.
[0024] In a possible implementation, the fault handling of the multi-bit ECC fault based on the fault information in the target storage space comprises:
[0025] The fault information is obtained in the target storage space;
[0026] According to the fault information, fault positioning processing is performed on the multi-bit ECC fault to obtain a fault cause of the multi-bit ECC fault;
[0027] The fault handling of the multi-bit ECC fault is performed based on the fault cause.
[0028] In the technical solution, after the computing device is restarted, the fault cause of the multi-bit ECC fault can be quickly located based on the fault information in the target storage space, so as to accelerate the fault handling efficiency of the multi-bit ECC fault.
[0029] In a possible implementation, before the target callback function is invoked based on the restart instruction, the method further comprises:
[0030] In response to a power-on instruction of the computing device, loading information recording code;
[0031] Executing the information recording code to register a target notification chain and the target callback function corresponding to the target notification chain.
[0032] In the 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 the computing device can store the fault information of the multi-bit ECC fault into the target storage space based on the target callback function after the multi-bit ECC fault, so as to perform fault handling based on the fault information in the non-volatile storage space after the computing device is restarted, shorten the positioning time of the multi-bit ECC fault, and improve the fault handling efficiency.
[0033] In a possible implementation, the method further comprises:
[0034] Based on an uninstallation instruction, the information recording code is unloaded;
[0035] The target notification chain and the target callback function are deleted in the registration information.
[0036] In the technical solution, the loading information recording code can be cancelled based on the uninstall instruction, and the target notification chain and the target callback function can be deleted from 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 detecting that the computing device has a single-bit ECC fault, determining a fault number corresponding to the single-bit ECC fault;
[0039] When determining that the fault number is greater than or equal to a preset threshold, generating an alarm information, the alarm information being used to prompt processing of the single-bit ECC fault.
[0040] In the technical solution, whether the computing device has a single-bit ECC fault can be detected, and the single-bit ECC fault occurring multiple times can be alarmed, so that maintenance personnel can process the single-bit ECC fault in time.
[0041] In a second aspect, an embodiment of the present application provides a fault processing apparatus, including:
[0042] The triggering module is configured to trigger a restart instruction when detecting that the computing device has a multi-bit error checking and correction (ECC) fault.
[0043] The calling module is configured to call a target callback function based on the restart instruction, the target callback function being used to acquire fault information of the multi-bit ECC fault and store the fault information in a target storage space, the target storage space being a non-volatile storage space.
[0044] The restart module is configured to restart the computing device.
[0045] The fault processing module is configured 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 configured to:
[0047] Call a target notification chain based on the restart instruction.
[0048] Determine a target callback function corresponding to the target notification chain, and execute the target callback function.
[0049] The target notification chain and the target callback function are pre-registered.
[0050] In a possible implementation, the calling module is specifically further configured to:
[0051] The fault information is obtained through an information recording code, which is loaded onto 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 one possible implementation, the calling module is further used for:
[0054] The storage space identifier is determined based on the target callback function;
[0055] The target storage space is determined based on the storage space identifier.
[0056] In one possible implementation, the fault handling module is specifically used for:
[0057] The fault information is obtained from the target storage space;
[0058] Based on the fault information, the fault location process is performed on the multi-bit ECC fault to obtain the fault cause of the multi-bit ECC fault;
[0059] Based on the cause of the fault, the multi-bit ECC fault is handled.
[0060] In one 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 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 one possible implementation, the fault handling device further includes an unloading module and a deletion module; wherein:
[0063] The uninstallation module is used to unload the information recording code based on the uninstallation command;
[0064] The deletion module is used to delete the target notification chain and the target callback function from the registration information.
[0065] In one possible implementation, the fault handling device further includes a determining module and a generating module; wherein:
[0066] The determining module is used to determine the number of faults corresponding to the single-bit ECC fault when a single-bit ECC fault is detected in the computing device.
[0067] The generation module is used to generate alarm information when it is determined that the number of faults is greater than or equal to a preset threshold. The alarm information is used to prompt the handling of the single-bit ECC fault.
[0068] Thirdly, embodiments of this application provide 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] Fourthly, embodiments of this application provide a chip for performing the method as described in any one of the first aspects.
[0072] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a computer, implement the method as described in any one of the first aspects.
[0073] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method as described in any one of the first aspects.
[0074] The fault handling method and computing device provided in this application can trigger a restart command when a multi-bit ECC fault is detected in the computing device; call a target callback function based on the restart command 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, enabling the computing device to quickly perform fault handling on the multi-bit ECC fault based on the fault information in the target storage space after restarting. Using the fault information helps to accelerate the fault location speed of the multi-bit ECC fault, thereby improving the processing efficiency of the multi-bit ECC fault. Attached Figure Description
[0075] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0076] Figure 1 This application provides a schematic diagram of the software architecture of a computing device.
[0077] Figure 2 A flowchart illustrating a fault handling method provided in an embodiment of this application;
[0078] Figure 3 A flowchart illustrating another fault handling method provided in an embodiment of this application;
[0079] Figure 4 A schematic diagram illustrating the implementation process of an ECC information recording module provided in an embodiment of this application;
[0080] Figure 5 This is a schematic diagram of the structure of a fault handling device provided in an embodiment of this application;
[0081] Figure 6 This is a schematic diagram of another fault handling device provided in an embodiment of this application;
[0082] Figure 7 This is a schematic diagram of the hardware structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates 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 those of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0084] First, the relevant terms involved in the embodiments of this application will be explained.
[0085] ECC technology: In the computer field, data is stored in various types of memory (such as RAM and Flash memory). Hardware-based ECC technology can be used to ensure the integrity and reliability of the data in the memory, so as to avoid data damage when the memory is subjected to various external interferences (such as electromagnetic interference, electrical noise or short circuits).
[0086] Hardware ECC: This refers to hardware with ECC error correction capabilities. Hardware ECC can store ECC calculation results in an additional storage unit outside of the user-accessible memory. Therefore, ECC typically does not occupy additional RAM space. When data is read, the hardware ECC verifies the correctness of the data in real time. When an ECC error is detected, the hardware ECC automatically corrects the data to be read, or generates an ECC error notification and implements the corresponding security mechanism.
[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 type of storage medium that is susceptible to ECC errors. For example, the cache in a processor chip is divided into L1 / L2 / L3 levels, and each level can potentially generate ECC errors. In some scenarios (e.g., multi-bit errors), ECC errors may be unrecoverable, leading to data corruption in the cache or system crashes. Therefore, measures need to be taken to regularly back up and monitor the data in the cache to minimize the risk of data corruption.
[0089] In some implementations, ECC (Error Correction Control) technology can be used to handle faults in computing devices. For example, a computing device includes hardware ECC and memory. The hardware ECC can detect and correct ECC errors in the memory, ensuring the integrity and reliability of the data and program code stored therein. Specifically, during data storage and transmission, when a single bit in memory is faulty, the hardware ECC can automatically calculate the correct value using redundant bits in the memory and write the correct value back to the corresponding memory. When multiple bits in memory are faulty, the hardware ECC typically reports the error information to the computing device by triggering an error interrupt, allowing the computing device to handle the fault. However, when using ECC technology for multi-bit ECC fault handling, the computing device needs to spend a significant amount of time locating the multi-bit ECC fault, resulting in low efficiency in handling multi-bit ECC faults.
[0090] In view of this, embodiments of this application provide a fault handling method. This method, upon detecting a multi-bit ECC fault in a computing device, triggers a restart command, invokes a target callback function based on the restart command, and stores the fault information of the multi-bit ECC fault in a target storage space through the target callback function; the computing device is then restarted, and fault handling of the multi-bit ECC fault is performed based on the fault information in the target storage space. This target storage space is non-volatile, enabling rapid fault handling of the multi-bit ECC fault after the computing device restarts, based on the fault information in the target storage space. This fault information helps accelerate the fault location speed of the multi-bit ECC fault, thereby improving the processing efficiency of multi-bit ECC faults.
[0091] For ease of understanding, the fault handling method provided in the embodiments of this application will be described below in conjunction with... Figure 1 The software architecture of the computing device involved in the embodiments of this application will be described.
[0092] Figure 1 This is a schematic diagram of the software architecture of a computing device provided in an embodiment of this application. Please refer to... Figure 1 The computing device is equipped with a kernel reset module and an ECC information recording module, among which,
[0093] The kernel reset module is used to perform a reboot process on the computing device, which includes normal reboot, abnormal reboot (panic and oops) and watchdog reboot.
[0094] In one scenario, fault detection and processing can be performed on computing devices. When a multi-bit ECC fault is detected in the computing device, a restart command can be triggered. Based on this restart command, the kernel reset module can be controlled to perform abnormal restart processing on the computing device.
[0095] The kernel reset module provides a callback function registration interface. For any other module within the kernel, this interface allows the kernel reset module to register its corresponding notification chain and its corresponding callback function. In response to a reboot command from the computing device, the kernel reset module can invoke the callback functions corresponding to each notification chain, causing each module to execute its callback function.
[0096] The ECC information recording module is used to, in response to a restart command from a computing device, determine the target notification chain corresponding to the restart command, and execute the target callback function corresponding to the target notification chain to obtain fault information of multi-bit ECC faults through the target callback function, and store the fault information in the target storage space.
[0097] It should be noted that, in some examples, the "callback function" in the embodiments of this application may also be called a "hook function".
[0098] For example, in Figure 1 In the kernel reset module, the ECC information recording module can register notification chain 1 and its corresponding callback function 1 in the kernel reset module through a registration interface. Based on the kernel reset module's reboot command, notification chain 1 and its corresponding callback function 1 are invoked.
[0099] The ECC information recording module is a flexibly registered kernel module that can be loaded flexibly when the computing device powers on, based on different user business needs. For example, if the ECC information recording module is loaded based on user business needs, the notification chain corresponding to the ECC information recording module and the corresponding callback function can be registered in the kernel reset module. If the user business needs determine that the ECC information recording module does not need to be loaded, then there is no need to register the corresponding notification chain and the corresponding callback function in the kernel reset module.
[0100] In one example, the ECC information recording module can also be uninstalled based on user needs. 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 from the kernel reset module.
[0101] A 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, so as to realize various functions through the callback functions. When the callback function is executed through the ECC information recording module, fault information (e.g., ECC information) in the computing device can be recorded and stored in the target storage space, which is a non-volatile storage space.
[0102] The technical solutions of the embodiments of this application will be described in detail below with specific examples. These specific examples can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0103] Figure 2 This is a flowchart illustrating a fault handling method provided in an embodiment of this application. Please refer to... Figure 2 The method specifically includes:
[0104] S201. When a multi-bit ECC fault is detected in the computing device, a restart command is triggered.
[0105] The execution entity of this method can be Figure 1 The computing device in the middle, specifically, can be made by Figure 1 The processor in the computing device executes the commands.
[0106] Computing devices include, but are not limited to, independent physical servers or server nodes, server clusters consisting of multiple physical servers, and smartphones, tablets, laptops, desktop computers, and portable laptops.
[0107] When a multi-bit ECC fault is detected in a computing device, an error interrupt can be triggered. Based on this error interrupt, the computing device can trigger a restart command under abnormal conditions (e.g., a panic command).
[0108] S202, Invoke the target callback function based on the restart command.
[0109] The target callback function is used to obtain fault information of multi-bit ECC faults and store the fault information in the target storage space.
[0110] Fault information for multi-bit ECC faults may include the register values corresponding to the processor's caches at each level (e.g., L1, L2, and L3) during the multi-bit ECC fault.
[0111] In some scenarios, computing devices may also have single-bit ECC faults. During the process of calling the target callback function, the fault information of the single-bit ECC fault can also be obtained based on the target callback function.
[0112] The fault information for this single-bit ECC fault may include: multiple types of single-bit ECC faults, as well as the number of times each type of single-bit ECC fault occurs and fault information.
[0113] Based on Figure 1 The ECC information recording module in this embodiment acquires fault information for both multi-bit and single-bit ECC faults. This module can provide users with a fault information configuration service, allowing them to configure different fault information recording methods for different types of ECC faults within the module. For example, 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 multi-bit ECC faults, users need to know the register values corresponding to each level of the processor's cache when a multi-bit ECC fault occurs. The user can configure the multi-bit ECC fault information recording method in the ECC information recording module as follows: record the register values corresponding to each level of the processor's cache. For different types of single-bit ECC faults, users need to know the number of times each type of single-bit ECC fault occurs in the computing device. The user can configure the single-bit ECC fault information recording method 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 handle faults in the computing device after the computing device is restarted.
[0116] Optionally, a relationship can be established between the restart command and the target callback function. When the computing device restarts (including normal restarts, restarts under abnormal conditions, and watchdog reset restarts), the target callback function can be called to obtain fault information corresponding to various types of ECC faults. This allows the computing device to monitor the health status of the hardware ECC in a timely manner after each restart. For example, after a normal restart, the computing device can use the number of different types of single-bit ECC faults obtained from the target callback function to generate an alarm when the number of faults is greater than or equal to a preset threshold.
[0117] S203. Restart the computing device and perform fault handling for multi-bit ECC faults based on the fault information in the target storage space.
[0118] Based on Figure 1 The kernel reset module in this embodiment restarts the computing device.
[0119] It is understandable that after the computing device restarts, it can read the fault information from the target storage space, quickly locate the cause of the multi-bit fault based on the fault information read by the computing device, and handle the multi-bit ECC fault based on the cause of the fault.
[0120] The fault handling method provided in this application can trigger a restart command when a multi-bit ECC fault is detected in a computing device, and call a target callback function based on the restart quality. This target callback function stores the fault information of the multi-bit ECC fault in a target storage space. The computing device is then restarted, and the fault information in the target storage space is used to handle the multi-bit ECC fault. This target storage space is non-volatile, ensuring that the computing device can still find the fault information in the target storage space after restarting. Based on this fault information, the cause of the multi-bit ECC fault can be quickly located and processed, which helps to accelerate the location of multi-bit ECC faults and thus improve the efficiency of multi-bit ECC fault handling.
[0121] Figure 3 This is a flowchart illustrating another fault handling method provided in an embodiment of this application. Please refer to... Figure 3 The method may specifically include:
[0122] S301. Perform fault detection and handling on the computing device.
[0123] In one example, the computing device may be equipped with hardware ECC, which can be used to detect whether the computing device has an ECC fault, including multi-bit ECC faults and single-bit ECC faults.
[0124] For example, when the hardware ECC detects a multi-bit ECC fault caused by a multi-bit error in the cache, it can trigger an error interrupt and report the fault information of the multi-bit ECC fault to the kernel of the computing device, so as to remind the computing device to take corresponding fault handling measures.
[0125] S302. When a multi-bit ECC fault is detected, a restart command is triggered.
[0126] It should be noted that the specific execution process of step S302 can be referred to the specific execution process of step S201, and will not be repeated here.
[0127] S303, Invoke the target notification chain based on the restart command.
[0128] S304. Determine the target callback function corresponding to the target notification chain.
[0129] The target notification chain and target callback function are pre-registered.
[0130] Please see Figure 1 The kernel reset module in the computing device can provide a callback function registration interface to other modules in the computing device. Other modules can register their corresponding notification chains and callback functions based on this 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 also query the registration information for the target callback function corresponding to a target notification chain.
[0131] In one implementation, before determining the target callback function, the target callback function can be registered as follows: in response to the power-on command of the computing device, information logging code is loaded; the information logging code is executed to register the target notification chain and the target callback function.
[0132] In another implementation, the loading information recording code can be canceled based on the uninstallation command; the target notification chain and target callback function can be deleted from the registration information.
[0133] Based on different user business needs, the information recording code can be flexibly loaded when the computing device powers on and starts up. It is understood that once the information recording code is successfully loaded, it becomes effective.
[0134] This information logging code can be provided in the form of a kernel ko, for example, in Figure 1 In this context, the information logging code can be provided in the form of an ECC information logging module (cache_ecc.ko).
[0135] The ECC information logging module (cache_ecc.ko) can be flexibly loaded or unloaded. For example, the configuration parameters of the computing device can be configured based on user-input configuration commands so that the computing device can load the ECC information logging module (cache_ecc.ko) after power-on. The ECC information logging module (cache_ecc.ko) can be unloaded based on user-input unload commands to remove the corresponding functions, and the notification chain and its corresponding callback function can be deleted from the kernel reset module's registration information (e.g., notification chain list) to achieve flexible functional adjustment.
[0136] The ECC information recording module can also register its own corresponding notification chain and the association with the restart command, so that the module's notification chain can be called when the restart command is triggered.
[0137] For example, the module is an ECC information recording module, the notification chain corresponding to this ECC information recording module is the target notification chain, and the callback function is the target callback function. This ECC information recording module can register the target notification chain, the target callback function, and the association between the target notification chain and the reboot instruction with the kernel reset module based on the registration interface. This allows the target notification chain corresponding to the ECC information recording module to be called when the reboot instruction of the kernel reset module is triggered, and the target callback function corresponding to the target notification chain to be determined based on the registration information.
[0138] S305. Obtain fault information through information logging codes.
[0139] Information logging code can be loaded onto a computing device after it powers on. Within the computing device's kernel, this information logging code can exist as a software module, for example, in... Figure 1 In this context, information recording codes can exist in the form of ECC information recording modules.
[0140] The information recording code can include methods for obtaining fault information for different types of faults. When a multi-bit ECC fault is detected, the target method for obtaining the fault information of the multi-bit ECC fault can be determined based on the information recording code, and the fault information of the multi-bit ECC fault can be obtained according to the target method.
[0141] S306. Determine the target storage space and store the fault information in the target storage space.
[0142] In one implementation, the storage space identifier can be determined based on the target callback function; the target storage space can then be determined based on the storage space identifier.
[0143] The target callback function may include a storage space identifier. In one example, the storage space identifier can be quickly determined in the target callback function based on keyword retrieval or other methods.
[0144] In one example, the storage space identifier can be stored as the name or address of the storage space.
[0145] Based on the different types of ECC faults, fault information corresponding to each type of ECC fault can be categorized and stored in the target storage space. For example, fault information corresponding to multi-bit ECC faults and fault information corresponding to single-bit ECC faults can be stored separately.
[0146] S307. Restart the computing device.
[0147] It can be done Figure 1 The kernel reset module in the system performs the restart operation of the computing device.
[0148] S308. Obtain fault information from the target storage space.
[0149] Optionally, after the computing device has restarted, it can receive control commands input by maintenance personnel to retrieve fault information from the target storage space.
[0150] S309. Based on the fault information, perform fault location processing on the multi-bit ECC fault to obtain the fault cause of the multi-bit ECC fault.
[0151] The fault information for a multi-bit ECC fault can include the register values corresponding to each level of cache prior to the multi-bit ECC fault. For example, a cache typically includes L1, L2, and L3 caches, and each cache level can include a tag and data. When a multi-bit ECC fault occurs in the processor's cache, the fault information can include register value 1 for the L1 cache, register value 2 for the L2 cache, and register value 3 for the L3 cache.
[0152] It can quickly locate whether there is a cache data abort exception by detecting multi-bit ECC fault information. If there is a cache data abort exception, it can determine whether the L1 cache is abnormal based on register value 1 and whether the L2 cache is abnormal based on register value 2. After detecting an exception in either of the above two cache levels, corresponding measures are taken to handle the fault.
[0153] When the multi-bit ECC interrupt in the L3 cache of the computing device is enabled, if the computing device detects the multi-bit ECC interrupt, it can record the multi-bit ECC fault in the L3 cache in the form of a log and perform a restart operation on the computing device.
[0154] S310. Handle multi-bit ECC faults based on the cause of the fault.
[0155] The corresponding fault handling method can be determined based on the cause of the fault, and the fault handling method can be used to handle multi-bit ECC faults.
[0156] In one implementation, the method may include the following steps:
[0157] S311. When a single-bit ECC fault is detected in the computing device, determine the number of faults corresponding to the single-bit ECC fault.
[0158] The ECC information recording module can record fault information for various types of single-bit ECC faults, and determine the number of faults corresponding to each type of single-bit ECC fault based on the fault information.
[0159] Fault information for single-bit ECC faults can include: various types of single-bit ECC faults, the number of times each type of single-bit ECC fault occurs, and the cause of the fault.
[0160] S312. When the number of faults is determined to be greater than or equal to a preset threshold, an alarm message is generated.
[0161] Alarm messages are used to prompt for handling single-bit ECC faults.
[0162] Based on the fault information of single-bit ECC faults recorded by the ECC information recording module, the computing device can monitor its health status in a timely manner and issue early warnings. For example, when the number of faults of a certain type of single-bit ECC fault is found to be greater than or equal to a preset threshold, an alarm can be sent to the processor (or the processing system running on the processor) in the computing device, so as to handle the single-bit ECC fault of that type in a timely manner and ensure the health status of the computing device.
[0163] Computing devices can log fault information for each ECC fault. For example, a computing device can use periodic polling (e.g., at a frequency of 1 second) to detect parity and ECC errors in single bits of each level of cache (L1, L2, or L3) and record these parity and ECC errors in the log.
[0164] The fault handling method provided in this application embodiment can perform fault detection processing on computing devices. When a multi-bit ECC fault is detected, a restart command is triggered, and a target notification chain is called according to the restart command. The target callback function corresponding to the target notification chain is executed to store the fault information in the target storage space through the target callback function. After the computing device restarts, the fault information can be obtained from the target storage space, and the fault location processing of the multi-bit ECC fault can be performed based on the fault information to quickly locate the cause of the multi-bit ECC fault, which is beneficial to improving the fault handling efficiency.
[0165] Below, in conjunction with Figure 4 The implementation process of the ECC information recording module is explained.
[0166] Figure 4 This is a schematic diagram illustrating the implementation process of an ECC information recording module provided in an embodiment of this application. Please refer to [link / reference]. Figure 4 The process may include:
[0167] S401. Add an ECC information recording module to the computing device.
[0168] S402, Configure the target notification chain corresponding to the ECC information recording module, and the target callback function corresponding to the target notification chain.
[0169] The callback function may include the type of fault information to be obtained and the storage space identifier, which is used to indicate the 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 with 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 [link to documentation]). Figure 1 It registers the notification chain of the ECC information recording module and the corresponding callback function of the notification chain with the kernel reset module through the registration interface.
[0172] S404. In response to the power-on command of the computing device, load the ECC information recording module.
[0173] By loading this ECC information recording module, the kernel reset module can easily call the ECC information recording module through the registered callback function.
[0174] In the implementation of the ECC information recording module provided in this application embodiment, various functions of the ECC information recording module (e.g., notification chain, callback function, type and method of obtaining fault information, etc.) can be flexibly configured based on the information input by the user, so that the callback function can meet the different business needs of the user and flexibly adjust the loading status of the ECC information recording module.
[0175] Figure 5 This is a schematic diagram of a fault handling device provided in an embodiment of this application. Please refer to... Figure 5 The fault handling device 10 may include:
[0176] Trigger module 11 is used to trigger a restart command when a multi-bit error checking and correction ECC fault is detected in the computing device;
[0177] The calling module 12 is used to call the target callback function based on the restart command. The target callback function is used to obtain fault information of multi-bit ECC fault and store the fault information in the target storage space, which is a non-volatile storage space.
[0178] Restart module 13 is used to restart the computing device;
[0179] 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 one possible implementation, the calling module 12 is specifically used for:
[0181] The target notification chain is invoked based on the restart command;
[0182] Determine the target callback function corresponding to the target notification chain, and execute the target callback function;
[0183] The target notification chain and the target callback function are pre-registered.
[0184] In one possible implementation, the calling module 12 is further used for:
[0185] The fault information is obtained through an information recording code, which is loaded onto 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 one possible implementation, the calling module 12 is further used for:
[0188] The storage space identifier is determined based on the target callback function;
[0189] The target storage space is determined based on the storage space identifier.
[0190] In one possible implementation, the fault handling module 14 is specifically used for:
[0191] The fault information is obtained from the target storage space;
[0192] Based on the fault information, the fault location process is performed on the multi-bit ECC fault to obtain the fault cause of the multi-bit ECC fault;
[0193] Based on the cause of the fault, the multi-bit ECC fault is handled.
[0194] The fault handling device provided in this application embodiment can implement the fault handling method described in the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.
[0195] Figure 6 This is a schematic diagram of another fault handling device provided in an embodiment of this application. Please refer to... Figure 6 ,exist Figure 5 Based on the structure of the fault handling device 10 shown, the fault handling 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 command, the loading module 15 is used to load information recording code in response to the power-on command 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 one possible implementation, the unloading module 17 is used to unload the information recording code based on an unloading instruction;
[0199] The deletion module 18 is used to delete the target notification chain and the target callback function from the registration information.
[0200] In one possible implementation, the determining module 19 is used to determine the number of faults corresponding to the single-bit ECC fault when a single-bit ECC fault is detected in the computing device.
[0201] The generation module 20 is used to generate alarm information when it is determined that the number of faults is greater than or equal to a preset threshold. The alarm information is used to prompt the handling of the single-bit ECC fault.
[0202] The fault handling device provided in this application embodiment can implement the fault handling method described in the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.
[0203] Figure 7 This is a schematic diagram of the hardware structure of a computing device provided in an embodiment of this application. Please refer to [link / reference]. Figure 7 The computing device 20 may include a processor 21 and a memory 22, which are coupled together. The processor 21 and the memory 22 can communicate; for example, the processor 21 and the memory 22 communicate via a communication bus 23.
[0204] The memory 22 is used to store computer instructions;
[0205] The processor 21 is used to execute computer instructions stored in the memory 22 to perform the technical solution as shown in the above method embodiments.
[0206] Optionally, the computing device 20 may also include a communication interface, which may include a transmitter and / or a receiver.
[0207] Optionally, the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0208] This application provides a computer-readable storage medium storing computer-executable instructions; when executed by a processor, the computer-executable instructions are used to implement the fault handling method described in the above embodiments.
[0209] This application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it causes the computer to perform the fault handling method described in the above embodiments.
[0210] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.
[0211] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0212] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0213] These computer program instructions can also be loaded onto a computer or other programmable terminal device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0214] In the embodiments of this application, the term "comprising" and its variations can refer to non-limiting inclusion; the term "or" and its variations can refer to "and / or". In the embodiments of this 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 this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have 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 this application, and are not intended to limit them. Although the embodiments of this application have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A fault handling method, characterized in that, include: When a multi-bit error check and correction ECC fault is detected in the processor cache of the computing device, a restart instruction is triggered. The restart instruction is used to restart the computing device. The restart process includes at least one of normal restart process, abnormal restart process, and watchdog restart process. The target callback function is invoked based on the restart instruction. The target callback function is used to obtain fault information of multi-bit ECC faults and store the fault information in the target storage space, which is a non-volatile storage space. The fault information of the multi-bit ECC fault includes: the register values corresponding to each level of cache before the multi-bit ECC fault; The callback function is also used to obtain fault information of single-bit ECC faults, which includes: multiple types of single-bit ECC faults, and the number of times each type of single-bit ECC fault occurs and fault information. The computing device is restarted, and the multi-bit ECC fault is handled based on the fault information in the target storage space.
2. The method according to claim 1, characterized in that, The target callback function is invoked based on the restart command, including: The target notification chain is invoked based on the restart command; Determine the target callback function corresponding to the target notification chain, and execute the target callback function; 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: The fault information is obtained through an information recording code, which is loaded onto 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: The storage space identifier is determined based on the target callback function; The target storage space is determined based on the storage space identifier.
5. The method according to any one of claims 1-4, characterized in that, Based on the fault information in the target storage space, fault handling for the multi-bit ECC fault includes: The fault information is obtained from the target storage space; Based on the fault information, the fault location process is performed on the multi-bit ECC fault to obtain the fault cause of the multi-bit ECC fault; Based on the cause of the fault, the multi-bit ECC fault is handled.
6. The method according to any one of claims 1-5, characterized in that, Before invoking the target callback function based on the restart instruction, the following is also included: In response to the power-on command of the computing device, load information recording code; Execute the information recording code to register the 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 includes: The information recording code is unloaded based on the uninstallation command; Remove the target notification chain and the target callback function from the registration information.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: When a single-bit ECC fault is detected in a computing device, the number of faults corresponding to the single-bit ECC fault is determined. When the number of faults is determined to be greater than or equal to a preset threshold, an alarm message is generated, which is used to prompt the handling of the single-bit ECC fault.
9. A computing device, characterized in that, include: Processor and memory; The processor and the memory are coupled; The memory is used to store computer instructions; The processor is configured to execute computer instructions stored in the memory to perform the method as described in any one of claims 1 to 8.
10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the method as described in 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