Memory error processing method, system, device, storage medium and program product

By introducing hardware error source drivers and a dedicated driver distribution mechanism for memory regions, the problem of the operating system kernel being unable to handle memory region errors lacking page structure support is solved, achieving comprehensive error handling for standard and extended memory regions and improving the reliability of memory error handling.

CN121070675BActive Publication Date: 2026-03-24ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, operating system kernels cannot effectively handle memory errors in memory regions that lack page structure support, resulting in low reliability of memory error handling.

Method used

A hardware error source driver, a first driver, and a second driver are introduced. The first driver handles errors in the standard memory region, and the second driver handles errors in the extended memory region. Memory error handling tasks are distributed and the corresponding drivers are called to perform error handling.

Benefits of technology

Improved reliability of memory error handling in standard and extended memory regions, ensuring that the operating system can effectively handle all types of memory errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121070675B_ABST
    Figure CN121070675B_ABST
Patent Text Reader

Abstract

The application provides a memory error processing method, system, device, storage medium and program product. An operating system kernel comprises a hardware error source driver, a first driver and a second driver. The second driver is used for processing a memory error processing task of an extended memory area. The first driver is used for processing a memory error processing task of a standard memory area. The first driver is used for distributing the memory error processing task of the extended memory area to the second driver. The method comprises the following steps: obtaining a memory error processing task of a target page distributed by the hardware error source driver; the target page has a memory error; if the target page is a memory page of the extended memory area, calling the second driver to perform error processing on the target page. The method improves the reliability of error processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of memory, in particular to a memory error processing method, system, device, storage medium and program product. BACKGROUND

[0002] In the related art, in the case that a process accesses a dynamic random access memory and a memory error occurs, the recoverable and unrecoverable memory errors can be detected and reported through error checking and correction mechanisms.

[0003] In the case that the memory error is processed based on the error checking and correction technology, single-bit errors can be automatically corrected and double-bit errors can be detected, and the error memory page can be isolated by the kernel to avoid the error data being accessed by the process, thereby ensuring the overall stability of the system.

[0004] However, the error processing mechanism of the operating system kernel depends on the page structure, that is, the core data structure for managing physical memory pages. In the case that an error occurs in a memory region supported by the page structure, the operating system kernel can perform error processing. However, in the computer system where the operating system is located, there are a large number of memory regions that lack page structure support. In the case that a process accesses the memory region and triggers an error, the kernel cannot perform error processing, resulting in low reliability of the memory error processing method in the related art. SUMMARY

[0005] Aspects of the present application provide a memory error processing method, system, device, storage medium and program product to solve the problem of low reliability of the memory error processing method.

[0006] In a first aspect, the present application provides a memory error processing method, an operating system kernel including a hardware error source driver, a first driver and a second driver, the second driver being configured to process a memory error processing task of an extended memory region, the first driver being configured to process a memory error processing task of a standard memory region, and to distribute the memory error processing task of the extended memory region to the second driver, the method comprising:

[0007] obtaining a memory error processing task of a target page distributed by the hardware error source driver; the target page having a memory error;

[0008] if the target page is a memory page of the extended memory region, calling the second driver to perform error processing on the target page.

[0009] In a possible implementation, the operating system kernel includes a plurality of second drivers, and before the second driver is called to perform error processing on the target page, the method further comprises:

[0010] For each second driver, if the address range of the extended memory region managed by the second driver includes the target page, the second driver is invoked to perform error processing on the target page.

[0011] In a possible implementation, the method further includes:

[0012] The registration request of the second driver is received, and the registration request includes the address range of the managed extended memory region and / or related information for invoking the second driver to perform error processing, the related information being information of a memory error of the target page required by the second driver to perform error processing.

[0013] In a possible implementation, the memory error is an uncorrectable error, and the obtaining of the memory error processing task of the target page distributed by the hardware error source driver includes:

[0014] The memory error processing task is obtained from a queue corresponding to the error type of the target page, different error types corresponding to different queues, and the memory error processing task being distributed into the queue by the hardware error source driver.

[0015] In a possible implementation, the memory error processing task is used to indicate an error processing manner corresponding to the error type and related parameters used when the error processing manner is used to process errors.

[0016] The invoking of the second driver to perform error processing on the target page includes:

[0017] The second driver is invoked to perform error processing on the target page based on the error processing manner of the memory error processing task and the related parameters used when the error processing manner is used to process errors.

[0018] In a possible implementation, the method further includes:

[0019] If the error type of the target page is a synchronous error and the error processing result returned by the second driver indicates that error processing fails, an error processing result indicating that error processing fails is returned to the hardware error source driver, so that the hardware error source driver sends a first error signal to a process requesting to access the target page to terminate the process.

[0020] In a possible implementation, the memory error processing task is used to indicate an error processing manner corresponding to the error type and related parameters used when the error processing manner is used to process errors; and the method further includes:

[0021] If the target page is a memory page of the standard memory region, error processing is performed on the target page based on an error processing mode of the memory error processing task and related parameters used when the error processing mode is used to process errors.

[0022] In a possible implementation, the related parameters include a corresponding error signal, the memory error is an uncorrectable error, and the error processing performed on the target page based on the error processing mode of the memory error processing task and the related parameters used when the error processing mode is used to process errors includes:

[0023] If the error type of the target page is a synchronous error, a second error signal is sent to a process corresponding to the target page to terminate the process.

[0024] If the error type of the target page is an asynchronous error, a third error signal is sent to a process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0025] In a possible implementation, the method further includes:

[0026] If the error type of the target page is a synchronous error and error processing fails, an error processing result representing error processing failure is returned to the hardware error source driver, so that the hardware error source driver sends a first error signal to a process requesting to access the target page to terminate the process.

[0027] In a second aspect, the present application provides a memory error processing method, an operating system kernel including a hardware error source driver, a first driver, and a second driver, the second driver being configured to process a memory error processing task of an extended memory region, the first driver being configured to process a memory error processing task of a standard memory region, and the first driver being configured to distribute the memory error processing task of the extended memory region to the second driver, and the method includes:

[0028] Error information of a target page having an uncorrectable error is obtained.

[0029] Based on the error information, the memory error processing task of the target page is distributed to the first driver, so that the first driver invokes the second driver to perform error processing on the target page if the target page is a memory page of the extended memory region.

[0030] In a possible implementation, the memory error is an uncorrectable error, and the error information further includes an error type of the target page; and the distribution of the memory error processing task of the target page to the first driver includes:

[0031] distributing the memory error processing task to a queue corresponding to the error type, so that the first driver acquires the memory error processing task from the queue, wherein different error types correspond to different queues, the memory error processing task is used to indicate an error processing manner corresponding to the error type, and related parameters used when the error is processed in the error processing manner.

[0032] In a possible implementation, the method further includes:

[0033] In a case where the error type of the target page is a synchronous error, and the error processing result returned by the first driver indicates that error processing fails, a first error signal is sent to a process requesting to access the target page, so as to terminate the process.

[0034] In a possible implementation, the method further includes:

[0035] In a case where the error information is failed to be parsed, or the address of the target page parsed from the error information is incorrect, a first error signal is sent to a process requesting to access the target page, so as to terminate the process.

[0036] In a third aspect, the present application provides a memory error processing method, an operating system kernel includes a hardware error source driver, a first driver and a second driver, the second driver is used to process a memory error processing task of an extended memory region, the first driver is used to process a memory error processing task of a standard memory region, and the second driver is distributed to the memory error processing task of the extended memory region, the method includes:

[0037] receiving a memory error processing task of a target page sent by the first driver in a case where the target page is a memory page of the extended memory region;

[0038] performing error processing on the target page.

[0039] In a possible implementation, the receiving a memory error processing task of a target page sent by the first driver in a case where the target page is a memory page of the extended memory region includes:

[0040] receiving a memory error processing task of a target page sent by the first driver in a case where the target page is a memory page of the extended memory region, and an address range of the extended memory region managed by the second driver includes the target page.

[0041] In a possible implementation, the method further includes:

[0042] sending a registration request to the first driver, the registration request including: an address range of the managed extended memory region, and / or, related information for the second driver to handle errors, the related information being information of a memory error of the target page required by the second driver to handle errors.

[0043] In a possible implementation, the memory error handling task is used to indicate an error handling manner corresponding to the error type, and related parameters used when handling errors in the error handling manner; and the handling of errors for the target page includes:

[0044] handling errors for the target page based on the error handling manner of the memory error handling task and the related parameters used when handling errors in the error handling manner.

[0045] In a possible implementation, the memory error is an uncorrectable error, and the handling of errors for the target page based on the error handling manner of the memory error handling task and the related parameters used when handling errors in the error handling manner includes:

[0046] In a case where the error type of the target page is a synchronous error, sending a second error signal to a process corresponding to the target page to terminate the process;

[0047] In a case where the error type of the target page is an asynchronous error, sending a third error signal to a process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0048] In a possible implementation, the method further includes:

[0049] In a case where the error type of the target page is a synchronous error and error handling fails, returning an error handling result representing error handling failure to the first driver, to cause the first driver to trigger the hardware error source driver to send a first error signal to a process requesting to access the target page, to terminate the process.

[0050] In a fourth aspect, the present application provides an error handling system, including a firmware and an operating system kernel, the operating system kernel including a hardware error source driver, a first driver and a second driver, the second driver being used to handle a memory error handling task of an extended memory region, the first driver being used to handle a memory error handling task of a standard memory region, and distribute the memory error handling task of the extended memory region to the second driver, the system including:

[0051] the firmware, configured to collect error information of a target page of an uncorrectable error of hardware of the error system, and send the error information to the hardware error source driver.

[0052] The hardware error source driver is configured to acquire the error information, and distribute the memory error processing task of the target page to the first driver based on the error information.

[0053] The first driver is configured to acquire the memory error processing task of the target page distributed by the hardware error source driver, and if the target page has uncorrectable errors and the target page is a memory page of the extended memory region, the second driver is called to perform error processing on the target page.

[0054] In a fifth aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the processor is communicatively connected to the memory.

[0055] The memory stores computer execution instructions.

[0056] The processor executes the computer execution instructions stored in the memory to implement the method according to any one of the first aspect to the third aspect.

[0057] In a sixth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the method according to any one of the first aspect to the third aspect when executed by a processor.

[0058] In a seventh aspect, the present application provides a computer program product, comprising a computer program, and the computer program is used to implement the method according to any one of the first aspect to the third aspect when executed by a processor.

[0059] The memory error processing method, system, device, storage medium and program product provided by the present application, the operating system kernel comprises a hardware error source driver, a first driver and a second driver, the second driver is used to process memory error processing tasks of an extended memory region, the first driver is used to process memory error processing tasks of a standard memory region, and the first driver is used to distribute memory error processing tasks of the extended memory region to the second driver, by acquiring the memory error processing task of the target page distributed by the hardware error source driver, the target page has memory errors, and if the target page is a memory page of the extended memory region, the second driver is called to perform error processing on the target page. The method provided by the present application, the first driver is used to process memory error processing tasks of a standard memory region, and the first driver is used to distribute memory error processing tasks of an extended memory region to the second driver, so that in the case that memory errors occur in the standard memory region or the extended memory region, the operating system kernel can perform memory error processing in the region where memory errors occur in the standard memory region or the extended memory region, and compared with the method in the related art in which the kernel only processes memory errors of the standard memory region, the reliability of error processing is improved. BRIEF DESCRIPTION OF DRAWINGS

[0060] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0061] Figure 1 A flowchart of a memory error processing method in the related art;

[0062] Figure 2 A flowchart of a memory error processing method provided by an exemplary embodiment of the present application Figure 1 ;

[0063] Figure 3 A flowchart of a memory error processing method provided by an exemplary embodiment of the present application

[0064] Figure 4 A flowchart of a memory error processing method provided by an exemplary embodiment of the present application Figure 2 ;

[0065] Figure 5 A structural diagram of an error processing system provided by an exemplary embodiment of the present application;

[0066] Figure 6 A flowchart of a memory error processing method provided by an exemplary embodiment of the present application Figure 3 ;

[0067] Figure 7 A structural diagram of a first error processing device provided by an exemplary embodiment of the present application;

[0068] Figure 8 A structural diagram of a second error processing device provided by an exemplary embodiment of the present application;

[0069] Figure 9 A structural diagram of a third error processing device provided by an exemplary embodiment of the present application;

[0070] Figure 10 A structural diagram of a fourth error processing device provided by an exemplary embodiment of the present application;

[0071] Figure 11 A structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0072] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or refusal.

[0073] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application will be described clearly and completely in combination with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.

[0074] Next, in order to facilitate the understanding of the technical scheme of the present application, the concepts involved in the present application are first explained.

[0075] 1. Error detection and correction code (Error Correction Code, ECC): a technology used to detect and correct data errors in memory.

[0076] 2. Uncorrectable error (Uncorrectable Error, UE): usually refers to multi-bit memory error, which cannot be automatically corrected by ECC.

[0077] 3. Correctable error (Correctable Error, CE): usually refers to 1-bit memory error, which can be automatically corrected by ECC.

[0078] 4. Struct Page: a data structure for managing physical memory pages, containing page state, reference count and other information.

[0079] 5. Page Frame Number (PFN): a unique number used to identify each page in physical memory. In the operating system, physical memory is divided into multiple fixed-size pages, each page has a unique PFN.

[0080] 6. Standard memory area: a standard memory area with Struct Page, an address area directly managed by the kernel.

[0081] 7. Extended memory region: a memory region without Struct Page. For example, a Graphics Processing Unit (GPU) memory driver, a Compute Express Link (CXL) driver, a Non-Volatile Dual In-Line Memory Module (NVDIMM) driver, and the like.

[0082] In the following, the memory error processing method in the related art will be described in detail. Figure 1 The memory error processing method in the related art will be described in detail.

[0083] Figure 1 The flowchart of the memory error processing method in the related art is shown in FIG. 1. Please refer to FIG. 1. Figure 1 Taking the UE error as an example, the hardware triggers a synchronous exception or an asynchronous interrupt in the case of detecting the UE error.

[0084] The firmware (Firmware) responds to the interrupt or the exception, collects error information from a register, and sends the error information to a Generic Hardware Error Source (GHES) driver in the kernel after encapsulating the error information.

[0085] After the kernel driver receives the encapsulated error information, the kernel driver parses the error information.

[0086] After the kernel driver parses the physical address PFN in the error information, the kernel driver processes the memory error based on the physical address PFN in the error information if the physical address PFN exists and is managed by the kernel. If the physical address PFN does not exist or is not managed by the kernel, no processing is performed.

[0087] Among them, the kernel determines whether the physical address PFN exists and is managed by the kernel based on whether the physical address PFN is valid. In the case that the physical address PFN is valid, the physical address PFN exists corresponding Struct Page, and the physical address PFN exists and is managed by the kernel.

[0088] In the above steps, the kernel performs error processing in the case that the physical address PFN exists corresponding Struct Page, i.e., the physical address PFN exists and is managed by the kernel, and does not perform processing in the case that the physical address PFN does not exist or is not managed by the kernel. That is, for a large number of memory regions lacking page structure support, the kernel cannot perform error processing in the case that a process accesses the memory region to trigger an error, resulting in low reliability.

[0089] To solve the above problems, the embodiment of the present application provides a memory error processing method. A hardware error source driver distributes a memory error processing task of a target page to a first driver based on error information. If the target page is a memory page of an extended memory region, the first driver calls a second driver to perform error processing on the target page. The method of the present application, the first driver is used to process the memory error processing task of the standard memory region, and the second driver is used to distribute the memory error processing task of the extended memory region. Therefore, in the case of memory error in the standard memory region or the extended memory region, the operating system kernel can perform memory error processing in the region where the memory error occurs in the standard memory region or the extended memory region. Compared with the method in the related art that the kernel only processes the memory error of the standard memory region, the reliability of error processing is improved.

[0090] In the following, the technical solutions shown in the present application will be described in detail through specific embodiments. It should be noted that the following embodiments can exist independently or be combined with each other. For the same or similar content, it will not be repeated in different embodiments.

[0091] It should be understood that the memory error processing method of the embodiment of the present application can be used in the scene of memory error processing of any operating system. For example, in the Linux operating system, in the case of UE error of hardware, the UE error is checked based on the ECC technology, and the memory error processing method is executed based on the Linux operating system kernel to realize error processing such as isolation of the memory sending error and / or sending a signal to the process accessing the memory. In order to clearly illustrate the method of the embodiment of the present application, the following embodiments are described taking the Linux operating system as an example.

[0092] The operating system kernel includes a hardware error source driver, a first driver and a second driver. The second driver is used to process the memory error processing task of the extended memory region, the first driver is used to process the memory error processing task of the standard memory region, and the second driver is used to distribute the memory error processing task of the extended memory region.

[0093] Figure 2 The flowchart of a memory error processing method provided by an exemplary embodiment of the present application Figure 1 . Please refer to Figure 2 , the method can include:

[0094] S201, the hardware error source driver acquires error information of a target page with a memory error.

[0095] The memory error includes UE error and CE error.

[0096] The hardware error source driver is a driver in the kernel for receiving and analyzing error information reported by computer hardware. For example, in the Linux operating system, the hardware error source driver can be a Generic Hardware Error Source (GHES) driver in the Linux kernel.

[0097] The error information of the target page refers to the information collected by the Firmware from the registers after a memory error occurs. For example, error type and physical address PFN, etc. The target page is the page corresponding to the error address where the memory error occurs, i.e., the page identified by PFN.

[0098] For example, in the case of detecting a UE memory error, the hardware triggers a synchronous exception or an asynchronous interrupt, and the Firmware collects the error information of the target page in response to the exception or interrupt. The Firmware encapsulates the error information in the format of the Advanced Configuration and Power Interface Platform Error Interface (APEI) and notifies the kernel according to the indication of the Hardware Error Source Table (HEST). The HEST is a system data structure defined in the ACPI specification, which is used to indicate all hardware error sources and their configuration information.

[0099] In this way, the GHES driver obtains the error information in the APEI format based on the error status block specified in the HEST table, and parses the error information in the APEI format in the APEI handler to obtain the error information of the target page where the memory error exists.

[0100] For example, the GHES driver can obtain the error information stored in the registers by reading at least one register based on the pre-registered exception handler, and parse the read error information to obtain the error information of the target page where the memory error exists.

[0101] S202, the hardware error source driver distributes the memory error handling task of the target page to the first driver based on the error information.

[0102] The first driver is a driver in the kernel for handling memory error processing. For example, in the Linux kernel, the first driver can be a Hardware Poisoning (HWPoison) driver, which is a driver for handling memory error tasks based on the HWPoison mechanism.

[0103] Exemplarily, taking the first driver being the HWPoison driver as an example, the GHES driver can distribute the memory error processing task of the target page to the HWPoison driver based on an error type in the error information. The error type indicates whether the memory error is a synchronous error or an asynchronous error. In this way, the GHES driver can distribute the memory error processing task corresponding to the synchronous error or the memory error processing task corresponding to the asynchronous error to the first driver according to the error type.

[0104] Exemplarily, the hardware error source driver can store the memory error processing task of the target page in a work queue (workqueue) based on the error information, to distribute the memory error processing task of the target page to the first driver. The first driver can execute the stored memory error processing task of the target page based on the workqueue.

[0105] S203, the first driver acquires the memory error processing task of the target page distributed by the hardware error source driver.

[0106] The target page is a page corresponding to a physical address where the memory error occurs, and the target page can be identified by a PFN.

[0107] Exemplarily, the first driver acquires the memory error processing task of the target page distributed by the hardware error source driver, and executes the memory error processing task of the target page. For example, the first driver can mark the target page where the memory error occurs, and send an error signal to a process accessing the memory error.

[0108] Exemplarily, taking the hardware error source driver storing the memory error processing task of the target page in a work queue (workqueue) as an example, the first driver can acquire the memory error processing task in the workqueue, and execute the memory error processing task in sequence.

[0109] S204, the first driver determines whether the target page is a memory page of a standard memory region.

[0110] If yes, S205 is executed;

[0111] If no, S206 is executed.

[0112] The standard memory region is a kernel-managed address region. The memory page of the standard memory region, i.e., the page corresponding to the kernel-managed address region, can be identified by a PFN.

[0113] Exemplarily, the first driver can determine whether the corresponding memory page (Page) exists based on the physical address PFN in the error information of the target page. If the corresponding memory page exists, the target page is a memory page in the standard memory area. If the corresponding memory page does not exist, the target page is a memory page in the extended memory area.

[0114] Exemplarily, the second driver can register the memory area managed by the second driver in the kernel in advance. The first driver can determine whether the memory area where the physical address in the error information belongs to the memory area managed by the second driver based on the physical address PFN in the error information, and find the second driver to be called. If the physical address in the error information belongs to the memory area managed by the second driver, the target page is a memory page in the non-standard memory area. If the physical address in the error information does not belong to the memory area managed by the second driver, the target page is a memory page in the standard memory area.

[0115] S205, the first driver performs error processing on the target page.

[0116] If the target page is a memory page in the standard memory area, the first driver performs error processing on the target page.

[0117] Exemplarily, for a synchronous error, the first driver can mark the target page and send a signal to the process currently accessing the target page to end the life cycle of the process. For an asynchronous error, the first driver can only mark the target page and does not intervene in the life cycle of the process.

[0118] S206, the first driver calls the second driver to perform error processing on the target page.

[0119] If the target page is a memory page in the non-standard memory area, that is, the target page is a memory page in the extended memory area, the second driver is called to perform error processing on the target page.

[0120] Exemplarily, the first driver sends the error information of the target page to the second driver through the interface provided by the second driver, so that the second driver performs error processing based on the internal processing method. Alternatively, the second driver can also send the processing result to the first driver after error processing, to represent the success or failure of the processing, and the first driver can further perform error processing based on the processing result of the second driver. For example, if the second driver returns information indicating error processing failure, the first driver can send a signal to the current process to end the life cycle of the process.

[0121] Exemplarily, the second driver can register the memory area managed by the second driver in the kernel in advance, and a callback method. The first driver can send the error information of the target page to the second driver based on the callback method, to call the second driver to perform error processing on the target page.

[0122] S207, the second drive performs error processing on the target page.

[0123] The second drive is a drive for managing a non-kernel managed memory region. For example, the second drive can be a GPU memory drive, a CXL drive, an NVDIMM drive, etc.

[0124] For example, the second drive receives the error information of the target page sent by the first drive in the case that the target page is a memory page of a non-standard memory region, through the callback method provided by the second drive to the first drive, and performs error processing on the target page.

[0125] It should be understood that the second drive can perform error processing based on its internal processing mechanism. For example, taking the case that the second drive is a GPU memory drive as an example, the second drive can isolate the memory region where the error occurs, or terminate all GPU operations that are using the damaged memory, or report an error code to the application, etc.

[0126] In the technical solution of the present application, after the hardware error source drive distributes the memory error processing task of the target page to the first drive based on the error information, the first drive obtains the memory error processing task of the target page distributed by the hardware error source drive. If the target page is a memory page of an extended memory region, the second drive is called to perform error processing on the target page. Since the first drive is used to process the memory error processing task of the standard memory region, and the second drive is distributed to the extended memory region, in the case of memory error in the standard memory region or the extended memory region, the operating system kernel can perform memory error processing in the region where the memory error occurs in the standard memory region or the extended memory region. Compared with the method in the related art that the kernel only processes the memory error of the standard memory region, the reliability of error processing is improved.

[0127] Next, the method of the embodiment of the present application, how to call the second drive to perform error processing on the target page, is described.

[0128] Optionally, the second drive can send a registration request to the first drive.

[0129] The registration request is a request of the second drive to the first drive to register the memory region for which the second drive can perform error processing.

[0130] The registration request includes the address range of the managed extended memory region, and / or related information for calling the second drive to perform error processing, and the related information is the memory error information of the target page required by the second drive to perform error processing.

[0131] The extended memory region is a memory region other than the standard memory region, i.e., a memory region not directly managed by the kernel. The address range of the extended memory region managed by each second driver is different.

[0132] The information for calling the second driver for error handling is a method provided by the second driver for the first driver to call for error handling. For example, the registration request can include an error handling callback method of the second driver, and the first driver can call the second driver based on the error handling callback method.

[0133] For example, the address range of the extended memory region managed by the second driver is identified in the format of (start PFN, end PFN), and the error handling callback method is named, for example, hwpoison_callback, and the required parameters include the physical address PFN in the error information and the error type. The error type can be represented based on different identifiers, for example, EXTMEM_CE represents CE error, EXTMEM_DE_SYNC represents synchronous UE error, and EXTMEM_DE_ASYNC represents asynchronous UE error.

[0134] Optionally, the first driver can receive the registration request of the second driver.

[0135] For example, each second driver can send a registration request to the first driver, and the registration request includes the address range of the extended memory region managed by the second driver, the error handling callback method, and the parameters required by the error handling callback. The first driver can receive the registration request of each second driver, and store the mapping relationship between each second driver and the address range of the extended memory region managed by it. Based on the mapping relationship, the first driver can determine the second driver to which the memory region where the memory error occurs belongs, and call the error handling callback method of the second parameter to send the parameters required by the second driver.

[0136] For example, before the first driver calls the second driver to perform error handling on the target page, the first driver can also call the second driver to perform error handling on the target page if the address range of the extended memory region managed by the second driver includes the target page.

[0137] Optionally, the first driver can send the memory error handling task of the target page to the second driver if the target page is a memory page in the standard memory region. In this case, the second driver can receive the memory error handling task of the target page sent by the first driver if the target page is a memory page in the standard memory region and the address range of the extended memory region managed by the second driver includes the target page.

[0138] Exemplarily, the first driver determines, based on the address range of the extended memory region managed by the second driver, a second driver corresponding to the memory where the memory error occurs, calls an error processing callback method of the second driver, and sends a memory error processing task of a target page to the second driver.

[0139] Correspondingly, the second driver receives the memory error processing task and performs error processing on the memory region where the error occurs. Exemplarily, the second driver can report an error code to the application program to inform the application program that the memory region has a memory error, thereby avoiding the process of the application program from accessing the memory region.

[0140] Optionally, the memory error processing task is used to indicate an error processing manner corresponding to the error type and related parameters used when the error is processed by using the error processing manner.

[0141] Exemplarily, the first driver calls the second driver to perform error processing on the target page, which can call the error processing manner of the second driver based on the memory error processing task and perform error processing on the target page by using the related parameters used when the error is processed by using the error processing manner.

[0142] Correspondingly, the second driver performs error processing on the target page, which can perform error processing on the target page by using the related parameters used when the error is processed by using the error processing manner based on the error processing manner of the memory error processing task.

[0143] Figure 3 A flowchart of a method for calling a second driver to perform memory error processing is provided for an exemplary embodiment of the present application. Please refer to Figure 3 The method can include the following steps.

[0144] S301, the second driver sends a registration request to the first driver.

[0145] Exemplarily, the registration request of the second driver includes the address range of the extended memory region managed by the second driver and an error processing callback method. The error processing callback method can indicate an error processing manner corresponding to the error type and related parameters used when the error is processed by using the error processing manner.

[0146] Taking synchronous errors and asynchronous errors as examples, the error processing callback method can include: an error processing manner corresponding to the synchronous error and related parameters used when the error is processed by using the error processing manner, an error processing callback method corresponding to the asynchronous error and related parameters used when the error is processed by using the error processing manner.

[0147] S302, the first driver determines whether the address range of the extended memory region managed by the second driver includes a target page.

[0148] If yes, S303 is performed;

[0149] If no, S306 is performed.

[0150] Exemplarily, the first driver receives a registration request sent by the second driver, and can realize a mapping relationship between a physical page frame number interval of an extended memory region managed by the second driver and the second driver based on an ordered registration of the physical page frame number interval. In a case where a target page has a memory error, the first driver can find a physical page frame number interval including the target page based on the registered physical page frame number interval, and determine the second driver corresponding to the physical page frame number interval.

[0151] S303, the first driver constructs an error processing callback method according to an error type.

[0152] Exemplarily, for a synchronous error, the error processing callback method is constructed according to an error processing manner corresponding to the synchronous error, and related parameters used when the error is processed by using the error processing manner.

[0153] S304, the first driver calls the second driver to process the target page.

[0154] Exemplarily, the first driver calls the constructed error processing callback method, and the error processing callback method includes an error processing manner and related parameters used when the error is processed by using the error processing manner.

[0155] S305, the second driver processes the target page based on an error processing manner of a memory error processing task, and related parameters used when the error is processed by using the error processing manner.

[0156] Exemplarily, the second driver acquires the error processing manner based on the error processing callback method, and related parameters used when the error is processed by using the error processing manner, and processes the error based on an internal error processing mechanism.

[0157] S306, the first driver processes the target page.

[0158] It should be noted that, in the embodiments of the present application, Figure 3 The various processing steps (S301-S306) shown in the embodiments do not constitute a specific limitation on the memory error processing method. In other embodiments of the present application, the memory error processing method can include more or fewer steps than Figure 3 the embodiments. For example, the memory error processing method can include Figure 3 some steps in the embodiments, or Figure 3 some steps in the embodiments can be replaced by steps with the same function, or Figure 3 some steps in the embodiments can be split into multiple steps, etc.

[0159] Optionally, in the case that the error type of the target page is a synchronous error and the error processing fails, the second driver can further return an error processing result representing the error processing failure to the first driver, so that the first driver triggers the hardware error source driver to send a first error signal to the process requesting to access the target page to terminate the process.

[0160] Optionally, in the case that the error type of the target page is a synchronous error, the second driver can send a second error signal to the process corresponding to the target page to terminate the process.

[0161] Optionally, in the case that the error type of the target page is an asynchronous error, the second driver can send a third error signal to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0162] For example, the kernel can send three error signals to the process. The first error signal is a signal representing error processing failure. The second error signal is a signal representing a synchronous error. The third error signal is a signal representing an asynchronous error.

[0163] For example, taking the first error signal as a symbol “KERNEL”, the second error signal as a symbol “AR”, and the third error signal as “AO” as an example, in the case that the first driver calls the second driver to perform error processing on the target page, if the second driver fails to perform error processing on the synchronous error, the second driver can return an error processing result representing error processing failure to the first driver. For example, the symbol of the error processing result representing error processing failure returned by the second driver to the first driver is non-0, and the first driver triggers the hardware error source driver to send the first error signal “KERNEL” to the process requesting to access the target page to terminate the process based on the error processing result.

[0164] For example, in the case that the error type of the target page is a synchronous error, the second driver performing error processing on the target page can send the second error signal “AR” to the process requesting to access the target page to terminate the process.

[0165] For example, in the case that the error type of the target page is an asynchronous error, the second driver performing error processing on the target page can send the third error signal “AO” to the process requesting to access the target page to indicate that the error of the target page is an asynchronous error.

[0166] The memory error processing method of the embodiments of the present application can send a first error signal to the process requesting to access the target page to terminate the process in the case that the second driver fails to perform error processing, thereby realizing a bottoming mechanism in the case of error processing failure and improving the reliability of the memory error processing method.

[0167] The following describes a specific embodiment of the first drive performing error processing on the target page in the method of the embodiment of the application.

[0168] Optionally, the error information further includes an error type of the target page. In the case of a UE memory error, the hardware error source drive can distribute the memory error processing task to a queue corresponding to the error type, so that the first drive obtains the memory error processing task from the queue.

[0169] Different error types correspond to different queues, the memory error processing task is used to indicate an error processing manner corresponding to the error type, and related parameters used when the error is processed in the error processing manner.

[0170] For example, taking the case where the error type includes an asynchronous error and a synchronous error as an example, if the error type of the target page is a synchronous error, the hardware error source drive can distribute the memory error processing task of the target page to a queue corresponding to the synchronous error, and if the error type of the target page is an asynchronous error, the hardware error source drive can distribute the memory error processing task of the target page to a queue corresponding to the asynchronous error. The first drive obtains the memory error processing task distributed by the hardware error source drive, and can obtain the memory error processing task from the queue corresponding to the error type of the target page.

[0171] For example, taking the Linux kernel as an example, if the error type of the target page is a synchronous error, the hardware error source drive can distribute the memory error processing task of the target page to a task work item (task_work). In the Linux kernel, each process is managed based on task_struct, and has an independent task_works task linked list, which is used to postpone the execution of a task in the context of the target process. The memory error processing task task_work is mounted in the task_works of the current process, and the trigger time of task_work is when the process returns from the kernel mode to the user mode, so that the synchronous error is processed synchronously before the process accessing the target page returns to the user mode.

[0172] For example, if the error type of the target page is an asynchronous error, the hardware error source drive can distribute the memory error processing task of the target page to a workqueue, obtain the memory error processing task stored in the workqueue based on a corresponding kernel thread, and execute the obtained memory error processing task. The kernel thread and the process accessing the target page are independent of each other, so that the asynchronous error is processed asynchronously.

[0173] The following describes an embodiment of the first drive performing error processing on the target page, taking the case where the memory error processing task is used to indicate an error processing manner corresponding to the error type, and related parameters used when the error is processed in the error processing manner as an example.

[0174] Optionally, if the target page is a memory page of a standard memory region, the first driver can further perform error handling on the target page based on an error handling manner of the memory error handling task and using a related parameter used when the error handling manner is used to handle the error.

[0175] Illustratively, the first driver can mark the target page using the related parameter based on the error handling manner of the memory error handling task. For example, taking the error handling manner as memory_failure (memory error handling method) as an example, the first driver can mark the flags of the target page as PG_hwpoison, indicating that the target page has an error, so as to avoid other processes accessing the target page.

[0176] Optionally, the related parameter includes a corresponding error signal, the memory error is a UE error, and the first driver can send a second error signal to a process corresponding to the target page to terminate the process in a case where an error type of the target page is a synchronous error. In a case where the error type of the target page is an asynchronous error, a third error signal is sent to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0177] The process corresponding to the target page is a process accessing the target page. Illustratively, the first driver can traverse a task data structure (task_struct) of the process to determine a process mapping a memory region corresponding to the target page.

[0178] Illustratively, taking the error type as a synchronous error and an asynchronous error, and taking the second error signal as a symbol “AR” and the third error signal as “AO” as examples, the first driver sends the second error signal “AR” to the process accessing the target page in a case where a memory error handling task in a queue corresponding to the synchronous error is executed, and sends the third error signal “AO” to the process accessing the target page in a case where a memory error handling task in a queue corresponding to the asynchronous error is executed.

[0179] The memory error processing method of the present application can distribute the memory error processing task to the queue corresponding to the error type by the hardware error source driver, so that the first driver obtains the memory error processing task from the queue. Since different error types correspond to different queues, the accuracy of executing the memory error processing task is guaranteed for the memory error processing task in different queues. Taking synchronous error and asynchronous error as an example, in the case of executing the memory error processing task in the queue corresponding to the synchronous error, a signal representing the synchronous error is sent to the process accessing the target page, and in the case of executing the memory error processing task in the queue corresponding to the asynchronous error, a signal representing the asynchronous error is sent to the process accessing the target page. Compared with the method of placing the memory error processing tasks of asynchronous error and synchronous error in the same queue for execution in the related art, the technical problem of signal sending error is solved, and the accuracy of the memory error processing method is improved.

[0180] Figure 4 A flowchart of a memory error processing method provided for an exemplary embodiment of the present application Figure 2 . Taking the memory error as UE error, the first driver as HWPoison driver, and the hardware error source driver as GHES driver as an example, please refer to Figure 4 , the memory error processing method can include the following steps:

[0181] S401, the GHES driver obtains error information of a target page with uncorrectable error.

[0182] S402, the GHES driver determines whether the error type is synchronous error based on the error information.

[0183] If yes, execute S403;

[0184] If no, execute S408.

[0185] S403, the GHES driver distributes the memory error processing task to task_work.

[0186] S404, the HWPoison driver executes the memory error processing task stored in task_work.

[0187] S405, the HWPoison driver determines whether the target page is a memory page of a standard memory area.

[0188] If yes, execute S406;

[0189] If no, execute S412.

[0190] Exemplarily, the HWPoison driver can determine whether the target page is a memory page of the standard memory region according to whether the physical address PFN in the error information exists a corresponding memory page. If the physical address PFN exists a corresponding memory page, the target page is a memory page of the standard memory region.

[0191] S406, the HWPoison driver performs error processing on the target page and sends a second error signal to a process corresponding to the target page.

[0192] S408, the GHES driver distributes a memory error processing task to a workqueue.

[0193] S409, the HWPoison driver executes a memory error processing task stored in the workqueue.

[0194] S410, the HWPoison driver determines whether the target page is a memory page of the standard memory region.

[0195] If yes, S411 is executed;

[0196] If no, S412 is executed.

[0197] S411, the HWPoison driver performs error processing on the target page and sends a third error signal to a process corresponding to the target page.

[0198] Optionally, before the HWPoison driver performs error processing on the target page and the process corresponding to the target page sends the third error signal, it can be confirmed whether the target process flag is configured for the process. If the target process flag is configured, the HWPoison driver performs error processing on the target page and sends the third error signal to the process corresponding to the target page.

[0199] The target process flag is a flag that characterizes a non-critical process to actively terminate a life cycle, thereby protecting system performance and stability. Exemplarily, the target process flag can be PF_EARLY_KILL.

[0200] S412, the HWPoison driver calls a second driver to perform error processing on the target page.

[0201] Exemplarily, the HWPoison driver can determine whether the memory region corresponding to the target page is an address range of an extended memory region managed by the second driver, in an address range of the extended memory region managed by the second driver registered by the second driver. The HWPoison driver calls the second driver to perform error processing on the target page.

[0202] Optionally, if the memory region corresponding to the target page is not within the address range of any second driver-managed extended memory region, the memory region where the target page is located neither belongs to kernel management nor any registered second driver management, the HWPoison driver can send a first error signal to the process currently accessing to terminate the process

[0203] It should be noted that, in Figure 4 The various processing steps (S401-S412) shown in the embodiments do not constitute a specific limitation on the memory error processing method. In other embodiments of the present application, the memory error processing method can include more or fewer steps than Figure 4 the embodiments. For example, the memory error processing method can include Figure 4 part of the steps in the embodiments, or Figure 4 some steps in the embodiments can be replaced by steps with the same function, or Figure 4 some steps in the embodiments can be split into multiple steps, etc.

[0204] Optionally, for CE errors, if the target page is a memory page of an extended memory region, the second driver is called to perform error processing on the target page, which can refer to the processing steps for UE errors in the embodiments. If the target page is a memory page of a standard memory region, the GHES driver distributes the memory error processing task to the workqueue, and the HWPoison driver performs error processing on the target page. Illustratively, the HWPoison driver can migrate the memory region of the target page where the CE error occurs, and update the physical address of the process accessing the target page to the migrated physical address, so that the process can access the migrated memory region.

[0205] In the case of error processing by the first driver, the first driver can send a second error signal or a third error signal to the process, i.e., the first driver completes the error processing. Optionally, during the error processing of the target page by the first driver, there can be a processing failure.

[0206] Optionally, in the case where the error type of the target page is a synchronous error and the error processing fails, the first driver can also return an error processing result representing error processing failure to the hardware error source driver, so that the hardware error source driver sends a first error signal to the process requesting access to the target page to terminate the process.

[0207] Correspondingly, the hardware error source driver can also send a first error signal to the process requesting access to the target page to terminate the process in the case where the error type of the target page is a synchronous error and the error processing result returned by the first driver represents error processing failure.

[0208] Exemplarily, taking the first error signal as "KERNEL" and the error handling result of a negative number representing error handling failure as an example, the first driver obtains the memory error handling task from the queue corresponding to the synchronous error, and executes the memory error handling task. In the case of failure in executing the memory error handling task, the first driver can return the negative number representing the error handling result to the hardware error source driver, so that the hardware error source driver sends "KERNEL" to the process requesting to access the target page.

[0209] Optionally, the first driver can also return the error handling result representing error handling failure to the hardware error source driver in the case that the error type of the target page is a synchronous error and the error handling result returned by the second driver represents error handling failure, so that the hardware error source driver sends the first error signal to the process requesting to access the target page to terminate the process.

[0210] Exemplarily, taking the first error signal as "KERNEL" and the error handling result of a negative number representing error handling failure as an example, in the case that the first driver calls the second driver to perform error handling on the target page, the second driver can fail in the error handling process. In this case, the second driver can return the error handling result as a negative number to the first driver, and the first driver can return the error handling result representing error handling failure to the hardware error source driver after receiving the error handling result, so that the hardware error source driver sends "KERNEL" to the process requesting to access the target page.

[0211] Optionally, the hardware error source driver can also send the first error signal to the process requesting to access the target page to terminate the process in the case of failure in parsing the error information or based on the address error of the target page parsed from the error information.

[0212] Exemplarily, taking the first error signal as "KERNEL", the hardware error source driver can send the first error signal "KERNEL" to the process requesting to access the target page to terminate the process in the case of failure in parsing the error information after obtaining the error information of the target page with memory error, or based on the address error of the target page parsed from the error information.

[0213] The memory error handling method of the present application can send the first error signal to the process requesting to access the target page to terminate the process in the case of failure in error handling by the first driver, or failure in error handling by the second driver, or failure in parsing the error information by the hardware error source driver, or based on the address error of the target page parsed from the error information, so as to realize the bottom-up mechanism in the error handling process and improve the reliability of the memory error handling method.

[0214] It should be understood that in the above embodiments, the memory error processing method of the embodiments of the present application is described for UE errors. Alternatively, in the case of CE errors in the hardware, the firmware can collect error information and notify the hardware error source driver of the error. The hardware error source driver can obtain the error information. If the error information indicates that the UE error occurs in the memory region, the target page is processed according to any method in the above embodiments. If the error information indicates that the CE error occurs in the memory region, the second driver is called to process the error, or the memory error processing task is distributed to the first driver to process the error. Illustratively, the first driver can migrate the target page where the memory error occurs, and update the physical address mapped by the process accessing the target page to the physical address after migration.

[0215] The embodiments of the present application also provide an error processing system, including a firmware and an operating system kernel, the operating system kernel including a hardware error source driver, a first driver and a second driver, the second driver being configured to process a memory error processing task of an extended memory region, the first driver being configured to process a memory error processing task of a standard memory region, and distribute the memory error processing task of the extended memory region to the second driver, and the system includes:

[0216] The firmware is configured to collect error information of a target page of a memory error of a hardware of an error system, and send the error information to the hardware error source driver;

[0217] The hardware error source driver is configured to obtain the error information, and distribute the memory error processing task of the target page to the first driver based on the error information;

[0218] The first driver is configured to obtain the memory error processing task of the target page distributed by the hardware error source driver, and the target page has a memory error. If the target page is a memory page of the extended memory region, the second driver is called to process the target page.

[0219] Figure 5 The structure of the error processing system provided by the exemplary embodiments of the present application is shown in the following figure. Figure 5 The physical address in the hardware includes a standard memory region and an extended memory region.

[0220] Illustratively, in the case of UE errors in the memory region in the hardware, the firmware collects error information from the register, the firmware encapsulates the error information into APEI format, and notifies the error source driver.

[0221] The error source driver parses the error information based on the APEI handler. If the parsing fails, the error signal is sent to the process based on the operation module. If the parsing succeeds, the memory error processing task is distributed to the first driver. The operation module is a module for sending an error signal to a process.

[0222] The first driver performs error processing based on the memory error processing task. In a case where the target page corresponding to the memory region where the error occurs belongs to the standard memory region, the first driver can perform error processing on the target page and send an error signal to the process. In a case where the target page corresponding to the memory region where the error occurs belongs to the extended memory region, the second driver is called to perform error processing on the target page. Optionally, the first driver can send an error processing result to the error source driver in a case where the error processing fails, so that the error source driver sends an error signal to the process.

[0223] The second driver can return the error processing result to the first driver after performing the error processing.

[0224] Figure 6 A flowchart of a memory error processing method provided for an exemplary embodiment of the present application Figure 3 . Taking a UE error as an example of a memory error, as shown in Figure 6 , the method can include the following steps:

[0225] S601, an uncorrectable error occurs in a memory region in hardware.

[0226] S602, error information of a target page of the uncorrectable error of the hardware of the error system is collected, and the error information is sent to a hardware error source driver.

[0227] S603, the GHES driver parses the error information based on the APEI handler, and sends a first error signal to the process in a case where the parsing fails.

[0228] S604, the GHES driver determines whether the error type is a synchronous error based on the error information.

[0229] If yes, S605 is performed;

[0230] If no, S606 is performed.

[0231] S605, the memory error processing task is distributed to task_work.

[0232] S606, the memory error processing task is distributed to workqueue.

[0233] S607, the HWPoison driver obtains the memory error processing task stored by the workqueue or task_work.

[0234] S608, the HWPoison driver determines whether the target page is a memory page of the standard memory region.

[0235] If yes, S609 is performed;

[0236] If no, S616 is performed.

[0237] The S609 and HWPoison drivers obtain the process for accessing the target page.

[0238] For example, the HWPoison driver can locate the process corresponding to the target page based on a reverse mapping. For instance, the HWPoison driver iterates through the process's `task_struct` to ensure that at least one process accesses the target page. For each of the retrieved processes, the HWPoison driver executes steps S610 to S616, performing error handling for each process.

[0239] The S610 and HWPoison drivers determine whether the process is the current process, or whether the process has a target process flag.

[0240] If so, then execute S611;

[0241] If not, then execute S615.

[0242] For example, the target process flag could be PF_EARLY_KILL.

[0243] The S611 and HWPoison drivers determine whether the process is the current process and whether the error type is a synchronization error.

[0244] If so, then execute S613;

[0245] If not, then execute S612.

[0246] The S612 and HWPoison drivers determine whether a target process flag exists.

[0247] If so, then execute S614;

[0248] If not, then execute S615.

[0249] For example, if the error type is an asynchronous error and the process does not have a target process flag, the HWPoison driver terminates the process, that is, it does not send an error signal to the process, but waits for the process to be executed before processing.

[0250] The S613 and HWPoison drivers send a second error signal to the process.

[0251] The S614 and HWPoison drivers send a third error signal to the process.

[0252] S615, HWPoison driver termination processing.

[0253] The S616 and HWPoison drivers call the second driver to perform error handling on the target page.

[0254] It should be noted that the various processing steps (S601-S616) shown in the embodiments do not constitute a specific limitation on the memory error processing method. In other embodiments of the present application, the memory error processing method can include more or fewer steps than the embodiments. For example, the memory error processing method can include some steps in the embodiments, or some steps in the embodiments can be replaced by steps with the same function, or some steps in the embodiments can be split into multiple steps, etc. Figure 6 Figure 6 Figure 6 Figure 6 Figure 6

[0255] Optionally, the hardware error source driver can send a first error signal to the process to terminate the process. In the case that the GHES driver fails to resolve the error information, or the first driver or the second driver fails to process the error, the hardware error source driver can send a first error signal to the process. Figure 6

[0256] In the technical solutions of the present application, in the case that a memory error occurs in the standard memory region or the extended memory region, the operating system kernel can perform memory error processing in the region where the memory error occurs in the standard memory region or the extended memory region. Compared with the method in the related art in which the kernel only processes the memory error of the standard memory region, the reliability of error processing is improved.

[0257] Figure 7 The first error processing device provided in the exemplary embodiments of the present application is shown in the structural schematic diagram. Referring to FIG. 7, the error processing device 700 can include an acquisition module 701 and a calling module 702, wherein Figure 7

[0258] The acquisition module 701 is configured to acquire a memory error processing task of a target page distributed by a hardware error source driver; the target page has an uncorrectable error.

[0259] The calling module 702 is configured to, if the target page is a memory page of an extended memory region, call a second driver to perform error processing on the target page.

[0260] In a possible implementation, the operating system kernel includes a plurality of second drivers, and before the second driver is called to perform error processing on the target page, the calling module 702 is specifically configured to, for each second driver, in the case that the address range of the extended memory region managed by the second driver includes the target page, call the second driver to perform error processing on the target page.

[0261] ​​​​​​​In a possible implementation, the memory error is an uncorrectable error, and the obtaining module 701 is specifically configured to: obtain the memory error processing task from a queue corresponding to the error type of the target page, wherein different error types correspond to different queues, and the memory error processing task is distributed into the queue by the hardware error source driver.

[0262] In a possible implementation, the memory error processing task is used to indicate an error processing manner corresponding to the error type, and related parameters used when the error is processed by using the error processing manner; and the calling module 702 is specifically configured to: call the second driver to perform error processing on the target page based on the error processing manner of the memory error processing task and the related parameters used when the error is processed by using the error processing manner.

[0263] The first error processing apparatus provided in the embodiments of the present application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be repeated here.

[0264] Figure 8 A structural diagram of a second error processing apparatus provided for the exemplary embodiments of the present application is shown in FIG. 8. Figure 8 In the embodiments shown in FIG. 8, the error processing apparatus 700 can further include a registration module 801, a processing module 802 and a feedback module 803. Figure 7

[0265] In a possible implementation, the registration module 801 is specifically configured to: receive a registration request of the second driver, the registration request including: an address range of the managed extended memory region, and / or related information for calling the second driver to perform error processing, the related information being information of a memory error of the target page required by the second driver to perform error processing.

[0266] In a possible implementation, the feedback module 803 is specifically configured to: in a case where the error type of the target page is a synchronous error and the error processing result returned by the second driver indicates that the error processing fails, return, to the hardware error source driver, an error processing result indicating that the error processing fails, so as to make the hardware error source driver send a first error signal to a process requesting to access the target page, to terminate the process.

[0267] In a possible implementation, the memory error processing task is used to indicate an error processing manner corresponding to the error type, and related parameters used when the error is processed by using the error processing manner; and the processing module 802 is specifically configured to: if the target page is a memory page of a standard memory region, perform error processing on the target page based on the error processing manner of the memory error processing task and the related parameters used when the error is processed by using the error processing manner.

[0268] ​In a possible implementation, the memory error is an uncorrectable error, the related parameter includes a corresponding error signal, and the processing module 802 is specifically configured to: in a case where the error type of the target page is a synchronous error, send a second error signal to a process corresponding to the target page to terminate the process; and in a case where the error type of the target page is an asynchronous error, send a third error signal to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0269] In a possible implementation, the feedback module 803 is specifically configured to: in a case where the error type of the target page is a synchronous error and the error processing fails, return an error processing result representing the error processing failure to the hardware error source driver, so that the hardware error source driver sends a first error signal to a process requesting to access the target page to terminate the process.

[0270] The second error processing apparatus provided by the embodiments of the present application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be described here in detail.

[0271] Figure 9 A structural diagram of a third error processing apparatus provided by an exemplary embodiment of the present application is shown in FIG. 9. Figure 9 The error processing apparatus 900 can include an acquisition module 901 and a distribution module 902, and can further include a sending module.

[0272] The acquisition module 901 is configured to acquire error information of a target page having an uncorrectable error.

[0273] The distribution module 902 is configured to distribute a memory error processing task of the target page to a first driver based on the error information, so that the first driver invokes a second driver to perform error processing on the target page in a case where the target page is a memory page of an extended memory region.

[0274] In a possible implementation, the memory error is an uncorrectable error, the error information further includes an error type of the target page, and the distribution module 902 is specifically configured to: distribute the memory error processing task to a queue corresponding to the error type, so that the first driver acquires the memory error processing task from the queue, wherein different error types correspond to different queues, the memory error processing task is used to indicate an error processing manner corresponding to the error type and related parameters used when the error is processed in the error processing manner.

[0275] In a possible implementation, the sending module is specifically configured to: in a case where the error type of the target page is a synchronous error and an error processing result returned by the first driver represents error processing failure, send a first error signal to a process requesting to access the target page to terminate the process.

[0276] In a possible implementation, the sending module is specifically configured to: in a case where the error information is failed to be parsed, or, the address of the target page parsed from the error information is incorrect, send a first error signal to the process requesting to access the target page to terminate the process.

[0277] The third error processing apparatus provided by the embodiments of the present application can execute the technical solutions shown in the method embodiments, and the implementation principles and the beneficial effects are similar, which will not be repeated here.

[0278] Figure 10 A structural diagram of the fourth error processing apparatus provided by the exemplary embodiments of the present application is shown in FIG. 10. Figure 10 The error processing apparatus 1000 can include a receiving module 1001 and a processing module 1002, and can further include a feedback module and a registration module, wherein,

[0279] The receiving module 1001 is configured to receive a memory error processing task of a target page sent by a first driver in a case where the target page is a memory page of an extended memory region.

[0280] The processing module 1002 is configured to perform error processing on the target page.

[0281] In a possible implementation, the receiving module 1001 is specifically configured to: receive the memory error processing task of the target page sent by the first driver in a case where the target page is a memory page of an extended memory region, and an address range of the extended memory region managed by a second driver includes the target page.

[0282] In a possible implementation, the registration module is specifically configured to: send a registration request to the first driver, the registration request including: an address range of the extended memory region managed by the error processing apparatus, and / or, related information for calling the second driver to perform error processing, the related information being information of a memory error of the target page required by the second driver to perform error processing.

[0283] In a possible implementation, the memory error processing task is used to indicate an error processing manner corresponding to an error type, and related parameters used when the error processing manner is used to process the error; and the processing module 1002 is specifically configured to: perform error processing on the target page based on the error processing manner of the memory error processing task, and the related parameters used when the error processing manner is used to process the error.

[0284] In a possible implementation, the memory error is an uncorrectable error, and the processing module 1002 is specifically configured to:

[0285] In a case where the error type of the target page is a synchronous error, a second error signal is sent to a process corresponding to the target page to terminate the process; in a case where the error type of the target page is an asynchronous error, a third error signal is sent to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

[0286] In a possible implementation, the feedback module is specifically configured to: in a case where the error type of the target page is a synchronous error and the error processing fails, return an error processing result representing the error processing failure to the first driver, so that the first driver triggers the hardware error source driver to send a first error signal to a process requesting to access the target page to terminate the process.

[0287] The fourth error processing apparatus provided by the embodiment of the present application can execute the technical solutions shown in the method embodiments, and the implementation principles and beneficial effects are similar, which will not be repeated here.

[0288] Figure 11 A structural schematic diagram of an electronic device provided by the embodiment of the present application is provided. Please refer to Figure 11 The electronic device 1100 can include a processor 1101 and a memory 1102. Exemplarily, the processor 1101, the memory 1102, and parts thereof are connected to each other through a bus 1103.

[0289] The memory 1102 stores computer execution instructions.

[0290] The processor 1101 executes the computer execution instructions stored in the memory 1102, so that the processor 1101 executes the method shown in the above method embodiments.

[0291] Correspondingly, the embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the computer execution instructions are executed by the processor, the computer execution instructions are used to implement the method of the above method embodiments.

[0292] Correspondingly, the embodiment of the present application can also provide a computer program product, which includes a computer program. When the computer program is executed by the processor, the computer program can implement the method shown in the above method embodiments.

[0293] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0294] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0295] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0296] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof. Figure 1 Figure 1 one or more flowcharts and / or blocks in the flowcharts and / or combination thereof.

[0297] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0298] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory. The memory is an example of computer-readable media.

[0299] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0300] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0301] The above only is an embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various changes and variations. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A memory error handling method, characterized in that, The operating system kernel includes a hardware error source driver, a first driver, and a second driver. The second driver handles memory error handling tasks for extended memory regions, and the first driver handles memory error handling tasks for standard memory regions. The kernel also receives a registration request from the second driver and distributes extended memory region memory error handling tasks to the second driver. The registration request includes: the address range of the managed extended memory region, and / or, relevant information for error handling by the second driver, wherein the relevant information is memory error information of the target page required for error handling by the second driver. The method includes: Obtain the memory error handling task for the target page distributed by the hardware error source driver; the target page contains a memory error; If the target page is a memory page of the extended memory region, then the second driver is invoked to perform error handling on the target page.

2. The method according to claim 1, characterized in that, The operating system kernel includes multiple second drivers, and before invoking the second drivers to perform error handling on the target page, it also includes: For each of the second drivers, if the address range of the extended memory region managed by the second driver includes the target page, the second driver is invoked to perform error handling on the target page.

3. The method according to claim 1, characterized in that, The memory error is an uncorrectable error. The task of handling memory errors in the target page distributed by the hardware error source driver includes: The memory error handling task is obtained from the queue corresponding to the error type of the target page, wherein different error types correspond to different queues, and the memory error handling task is distributed to the queue by the hardware error source driver.

4. The method according to claim 3, characterized in that, The memory error handling task is used to indicate the error handling method corresponding to the error type, and the relevant parameters used when handling the error using the error handling method; The step of invoking the second driver to perform error handling on the target page includes: The second driver invokes the error handling method based on the memory error handling task, and uses the relevant parameters used when the error is handled by the error handling method to perform error handling on the target page.

5. The method according to any one of claims 1-3, characterized in that, The method further includes: If the error type of the target page is a synchronization error and the error handling result returned by the second driver indicates that the error handling has failed, the error handling result indicating that the error handling has failed is returned to the hardware error source driver, so that the hardware error source driver sends a first error signal to the process requesting access to the target page to terminate the process.

6. The method according to claim 3, characterized in that, The memory error handling task is used to indicate the error handling method corresponding to the error type, and the relevant parameters used when handling the error using the error handling method; the method further includes: If the target page is a memory page of the standard memory region, then the target page is processed based on the error handling method of the memory error handling task and using the relevant parameters used when the error handling method processes errors.

7. The method according to claim 6, characterized in that, The memory error is an uncorrectable error. The relevant parameters include the corresponding error signal. The error handling method based on the memory error handling task, and the relevant parameters used when handling the error using the error handling method, performs error handling on the target page, including: If the error type of the target page is a synchronization error, a second error signal is sent to the process corresponding to the target page to terminate the process; If the error type of the target page is an asynchronous error, a third error signal is sent to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

8. The method according to claim 6, characterized in that, The method further includes: If the error type of the target page is a synchronization error and the error handling fails, an error handling result indicating the error handling failure is returned to the hardware error source driver, so that the hardware error source driver sends a first error signal to the process requesting access to the target page to terminate the process.

9. A memory error handling method, characterized in that, The operating system kernel includes a hardware error source driver, a first driver, and a second driver. The second driver handles memory error handling tasks for extended memory regions, and the first driver handles memory error handling tasks for standard memory regions. The kernel also receives a registration request from the second driver and distributes extended memory region memory error handling tasks to the second driver. The registration request includes: the address range of the managed extended memory region, and / or, relevant information for error handling by the second driver, wherein the relevant information is memory error information of the target page required for error handling by the second driver. The method includes: Retrieve error information for the target page where a memory error exists; Based on the error information, the memory error handling task of the target page is distributed to the first driver, so that if the target page is a memory page of the extended memory region, the first driver calls the second driver to perform error handling on the target page.

10. The method according to claim 9, characterized in that, The error message also includes the error type of the target page; The memory error is an uncorrectable error; The step of distributing the memory error handling task of the target page to the first driver includes: The memory error handling task is distributed to a queue corresponding to the error type, so that the first driver can obtain the memory error handling task from the queue. Different error types correspond to different queues. The memory error handling task is used to indicate the error handling method corresponding to the error type, as well as the relevant parameters used when handling the error using the error handling method.

11. The method according to claim 9 or 10, characterized in that, The method further includes: If the error type of the target page is a synchronization error and the error handling result returned by the first driver indicates that the error handling has failed, a first error signal is sent to the process requesting access to the target page to terminate the process.

12. The method according to claim 9 or 10, characterized in that, The method further includes: If parsing the error message fails, or if the address of the target page is incorrect as determined from the error message, a first error signal is sent to the process requesting access to the target page to terminate the process.

13. A memory error handling method, characterized in that, The operating system kernel includes a hardware error source driver, a first driver, and a second driver. The second driver handles memory error handling tasks for extended memory regions, and the first driver handles memory error handling tasks for standard memory regions. The kernel also receives a registration request from the second driver and distributes extended memory region memory error handling tasks to the second driver. The registration request includes: the address range of the managed extended memory region, and / or, relevant information for error handling by the second driver, wherein the relevant information is memory error information of the target page required for error handling by the second driver. The method includes: Receive the memory error handling task of the target page sent by the first driver when the target page is a memory page of the extended memory region; Error handling is performed on the target page.

14. The method according to claim 13, characterized in that, The receiving of the memory error handling task for the target page sent by the first driver when the target page is a memory page of the extended memory region includes: The first driver receives a memory error handling task for the target page when the target page is a memory page of the extended memory region and the address range of the extended memory region managed by the second driver includes the target page.

15. The method according to claim 14, characterized in that, The method further includes: A registration request is sent to the first driver, the registration request including: the address range of the extended memory region to be managed, and / or, relevant information for error handling by the second driver, the relevant information being memory error information of the target page required for error handling by the second driver.

16. The method according to any one of claims 13-15, characterized in that, The memory error handling task is used to indicate the error handling method corresponding to the error type, and the relevant parameters used when handling the error using the error handling method; The error handling for the target page includes: Based on the error handling method of the memory error handling task, and using the relevant parameters used when handling errors by the error handling method, the target page is processed for error handling.

17. The method according to claim 16, characterized in that, The memory error is an uncorrectable error. The error handling method based on the memory error handling task, and the relevant parameters used when handling the error by the error handling method, are used to perform error handling on the target page, including: If the error type of the target page is a synchronization error, a second error signal is sent to the process corresponding to the target page to terminate the process; If the error type of the target page is an asynchronous error, a third error signal is sent to the process corresponding to the target page to indicate that the error of the target page is an asynchronous error.

18. The method according to claim 16, characterized in that, The method further includes: If the error type of the target page is a synchronization error and the error handling fails, an error handling result indicating the error handling failure is returned to the first driver, so that the first driver triggers the hardware error source driver to send a first error signal to the process requesting access to the target page, thereby terminating the process.

19. An error handling system, characterized in that, The system includes firmware and an operating system kernel. The operating system kernel includes a hardware error source driver, a first driver, and a second driver. The first driver handles memory error handling tasks for standard memory regions and receives a registration request from the second driver, distributing memory error handling tasks for extended memory regions to the second driver. The registration request includes: the address range of the managed extended memory region, and / or, relevant information for error handling by the second driver, wherein the relevant information is memory error information of the target page required for error handling by the second driver. The system includes: The firmware is used to collect error information of the target page of the memory error in the hardware of the error handling system and send the error information to the hardware error source driver; The hardware error source driver is used to acquire the error information; based on the error information, it distributes the memory error handling task of the target page to the first driver. The first driver is used to obtain the memory error handling task of the target page distributed by the hardware error source driver; the target page has a memory error; if the target page is a memory page of the extended memory region, then the second driver is invoked to perform error handling on the target page.

20. An electronic device, characterized in that, include: At least one processor; as well as A memory that is communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the method according to any one of claims 1-18.

21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-18.

22. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-18.

Citation Information

Patent Citations

  • UE memory failure recovery method and device, electronic equipment and medium

    CN115421960A

  • System for processing faulty pages, method for processing faulty pages, and host device

    CN117093390A