Memory error processing method and device, equipment and program product
By marking unreliable pages in the memory of the computer system and migrating related data, the problem of recoverable errors accumulated in memory into unrecoverable errors is solved, and data security and system stability are achieved.
Patent Information
- Application Number
- CN202510231832.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-02-27
AI Technical Summary
Recoverable errors often occur in the memory of computer systems. Although these errors will not affect the system's operation for the time being, they may accumulate into irrecoverable errors, resulting in the loss of important data. The prior art is difficult to deal with these recoverable errors in a timely and efficient manner.
A method for handling memory errors is proposed, including adding an identifier to the page when a recoverable error occurs in the memory page to indicate that it is unreliable; detecting the data type stored on the page; migrating the page that stores the first type of data to an unidentified reliable page; and at the same time, data replacement or isolation processing is performed for the unrecoverable errors.
By timely marking unreliable memory pages and migrating related data, recoverable errors evolve into unrecoverable errors, ensuring data security, and reducing the risk of data loss due to frequent errors.
Smart Images

Figure CN120144372A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method, apparatus, device, and program product for handling memory errors. Background Art
[0002] Memory in a computer system often has some different types of errors, which can be classified into recoverable errors and non-recoverable errors according to the severity of the errors.
[0003] A recoverable error refers to an error that can be self-recovered by the hardware without any manual intervention when a memory error occurs, while a non-recoverable error refers to an error that can directly affect the normal operation of the computer system, and the non-recoverable error must notify the software for processing.
[0004] Although the occurrence of recoverable errors may not immediately affect the operation of the computer system, it may accumulate to cause non-recoverable errors. Therefore, it is necessary to timely and specifically handle the errors of the computer system. Summary of the Invention
[0005] Based on the above technical status quo, this application proposes a method, apparatus, device, and program product for handling memory errors, which can timely and efficiently handle recoverable memory errors, and effectively avoid losing important data due to non-recoverable errors caused by frequent occurrence of recoverable errors.
[0006] The first aspect of this application proposes a method for handling memory errors, including:
[0007] In the case where a recoverable error occurs in a first memory page, add a first identifier to the first memory page, where the first identifier is used to indicate that the memory page is unreliable;
[0008] Detect the type of data stored in the first memory page;
[0009] In the case where the first memory page stores first-type data, migrate the data stored in the first memory page to a second memory page that has not been added with the first identifier; wherein, the content of the first-type data is related to the application execution state during system operation.
[0010] In some implementation manners, migrating the data stored in the first memory page to the second memory page includes:
[0011] Determine a second memory page that has not been added with the first identifier from free memory pages, and migrate the data stored in the first memory page to the second memory page;
[0012] Or,
[0013] Determine a second memory page that stores second-type data and has not been added with the first identifier from non-idle memory pages, and swap the data stored in the first memory page with the data stored in the second memory page; wherein, the content of the second-type data is independent of the application state during system operation.
[0014] In some implementations, before adding the first identifier to the first memory page, the method further includes:
[0015] Determine whether the first memory page carries the first identifier;
[0016] If the first memory page carries the first identifier, ignore the recoverable error;
[0017] If the first memory page does not carry the first identifier, add the first identifier to the first memory page.
[0018] In some implementations, the method further includes:
[0019] When the first memory page stores second-type data, ignore the recoverable error; wherein, the second-type data represents data that can be obtained by parsing a code file.
[0020] In some implementations, the method further includes:
[0021] When the first memory page is released, lock the first memory page and perform a reliability check on the first memory page; locking the first memory page includes setting the first memory page to an unusable state, and the reliability check is used to detect whether the recoverable error occurs again in the first memory page;
[0022] When it is determined that the recoverable error does not occur again in the first memory page, unlock the first memory page.
[0023] In some implementations, the method further includes:
[0024] When an unrecoverable error occurs in a third memory page, detect the type of data stored in the third memory page;
[0025] When the third memory page stores first-type data, replace the third memory page with a fourth memory page that has not been added with the first identifier.
[0026] In some implementations, the method further includes:
[0027] When the third memory page stores data of the second type, delete the data stored in the third memory page and isolate the third memory page; wherein, the content of the data of the second type has nothing to do with the application state during system operation.
[0028] In some implementations, the method further includes:
[0029] When the available memory is lower than a set threshold, determine a fifth memory page and a sixth memory page from the memory pages, where the fifth memory page stores data of the second type and the first identifier has not been added to the fifth memory page, and the sixth memory page carries the first identifier, and the data of the second type represents data that can be obtained by parsing a code file;
[0030] Migrate the data stored in the fifth memory page to the sixth memory page, and recycle the fifth memory page.
[0031] A second aspect of the present application proposes a memory error handling device, including:
[0032] A page marking unit, configured to add a first identifier to the first memory page when a recoverable error occurs in the first memory page, and the first identifier is used to indicate that the memory page is unreliable;
[0033] A detection unit, configured to detect the type of data stored in the first memory page;
[0034] A data migration unit, configured to migrate the data stored in the first memory page to a second memory page to which the first identifier has not been added when the first memory page stores data of the first type; wherein, the content of the data of the first type is related to the application execution state during system operation.
[0035] A third aspect of the present application proposes a memory error handling device, including:
[0036] A memory and a processor;
[0037] Wherein, the memory is connected to the processor and is used to store programs;
[0038] The processor is configured to implement the above-mentioned memory error handling method by running the program in the memory.
[0039] A fourth aspect of the present application proposes a computer program product, including computer program instructions, and when the computer program instructions are run by a processor, the processor is caused to execute the above-mentioned memory error handling method.
[0040] For the memory error handling method proposed in this application, when a recoverable error occurs in the first memory page, a first identifier is added to the first memory page, and the first identifier is used to indicate that the memory page is unreliable; at the same time, the type of data stored in the first memory page is detected; when the first memory page stores data of the first type, the data stored in the first memory page is migrated to a second memory page that has not been added with the first identifier; wherein, the content of the data of the first type is related to the application execution state during system operation. The above solution can add a first identifier to the memory page when a recoverable error occurs in the memory page, thus playing the role of marking the memory page, so that when the computer system allocates memory pages, it can use this first identifier as a reference to avoid storing important data in this memory page or avoid using this memory page again. On the other hand, when a recoverable error occurs in the memory page, the above solution migrates the data stored therein that is not easily obtained to a secure page that has not been added with the first identifier, thus ensuring the security of the page data and avoiding the loss of important data due to the frequent occurrence of recoverable errors resulting in irrecoverable errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0042] Figure 1 It is a schematic flowchart of a memory error handling method provided by an embodiment of the present application.
[0043] Figure 2 It is a schematic structural diagram of a memory error handling device provided by an embodiment of the present application.
[0044] Figure 3 It is a schematic structural diagram of a memory error handling device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] Memory in a computer system often experiences various types of errors, which can be classified into recoverable errors and irrecoverable errors according to the severity of the errors.
[0046] A recoverable error refers to an error that can be self-recovered by the storage hardware when a memory error occurs, while an irrecoverable error refers to an error that can directly affect the normal operation of the computer system, and the irrecoverable error must be processed by software to be resolved.
[0047] Although the occurrence of recoverable errors may not immediately affect the operation of a computer system, some recoverable errors are precursors to non-recoverable errors. Therefore, it is necessary to timely and specifically handle the errors of the computer system.
[0048] Under normal circumstances, non-recoverable errors in the memory of a computer system usually start with several recoverable errors. Therefore, in the conventional computer memory error handling mechanism, the recoverable errors of the memory are monitored. When a memory block has more than a certain frequency of recoverable errors, the memory block is isolated to prevent the recoverable errors of the memory block from accumulating and evolving into non-recoverable errors, resulting in data loss and system downtime.
[0049] However, it is difficult to determine when to isolate the memory block with recoverable errors in the above scheme, because some memory blocks do not have non-recoverable errors even when they have multiple recoverable errors, while some memory blocks have non-recoverable errors when they have a small number of recoverable errors. Moreover, since the data stored in the memory is constantly changing, different data have different tolerances for recoverable errors. Therefore, there is no clear standard to determine when to isolate the memory with recoverable errors. The above scheme has poor practicability in actual applications, and often fails to timely isolate the memory with recoverable errors, resulting in the loss of memory data when non-recoverable errors occur in the memory page, or frequently isolating the memory affects the normal operation of the system.
[0050] In view of the above technical problems, the embodiments of the present application propose a memory error handling scheme, which can more timely and reasonably handle the errors occurring in the memory page, and avoid the recoverable errors of the memory page evolving into non-recoverable errors, resulting in the loss of memory data and affecting the system operation.
[0051] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0052] For a computer system, depending on whether the software has fault tolerance means, the importance of different storage units varies. For example, when the memory unit stores application code, read-only data, or file cache, even if these memory units have non-recoverable errors, the management software can obtain these data by parsing the code file, or can re-read the relevant content from its original storage location (such as a disk) and write them into a memory unit without errors to ensure that the system can work properly.
[0053] Embodiments of the present application handle recoverable memory errors in combination with the above data characteristics, achieving effective handling of recoverable errors while ensuring data security, and can avoid non-recoverable memory errors to the greatest extent.
[0054] The technical solution proposed by the embodiments of the present application can be applied to devices such as processors and controllers in a computer system. Specifically, the technical solution proposed by the embodiments of the present application is implemented by an operating system running on devices such as processors and controllers in a computer system.
[0055] Embodiments of the present application first propose a method for handling memory errors. Refer to Figure 1 As shown, the method includes:
[0056] S101. When a recoverable error occurs in a first memory page, add a first identifier to the first memory page. The first identifier is used to indicate that the memory page is unreliable.
[0057] Specifically, the above-mentioned first memory page refers to any memory page in the memory of a computer system. When a recoverable error occurs in any memory cell in the first memory page, the memory cell will feedback error report information to the operating system, and information such as the error occurrence time and error type is recorded in the error report information. Through the error report information, the operating system can determine that a recoverable error has occurred in the memory cells in the first memory page.
[0058] When it is confirmed that a recoverable error has occurred in the first memory page, add a first identifier indicating that the memory page is unreliable to the first memory page. In the embodiments of the present application, when a memory page carries the first identifier, it indicates that the memory page has experienced a recoverable error, making the memory page unreliable; if a memory page does not carry the first identifier, it can be indicated that the memory page has not experienced a recoverable error and the memory page is in a reliable state.
[0059] In some embodiments, when a recoverable error occurs in the first memory page, before adding the first identifier to the first memory page, first determine whether the first memory page already carries the first identifier. If the first memory page already carries the first identifier, it can be confirmed that the first memory page has experienced a recoverable error during the previous system operation and has been marked as unreliable. At this time, the recoverable error that occurred in the first memory page this time can be ignored, and the operation of adding the first identifier to the first memory page is no longer performed.
[0060] If the first memory page does not carry the first identifier, it indicates that the first memory page has not experienced a recoverable error during the previous system operation. At this time, add the first identifier to the first memory page.
[0061] Among them, adding a first identifier to the first memory page can be achieved by adding a label to the first memory page, that is, adding a label including the first identifier to the first memory page, or the attributes of the first memory page can be modified to add the first identifier to the attribute information of the first memory page.
[0062] In the embodiments of the present application, the memory page added with the first identifier will be managed by the unreliable memory management task dedicated to managing unreliable memory, and specific management measures will be introduced in subsequent embodiments.
[0063] S102. Detect the type of data stored in the first memory page.
[0064] Specifically, after adding the first identifier to the first memory page, further detect the type of data stored in the first memory page to determine whether the data stored is the first type of data or the second type of data.
[0065] Among them, the above-mentioned first type of data refers to data whose content is related to the application execution state during the operation of the computer system, such as code running process data, code running result data, etc. These data can only be obtained by running the code file and cannot be obtained by statically parsing the code file.
[0066] The above-mentioned second type of data refers to data whose content is not related to the application execution state during the operation of the computer system. These data can be obtained by parsing the code file, that is, data that can be obtained by statically parsing the code file without running the code, such as code defined in the executable file, read-only data, dynamic link information, unmodified file cache, etc. In some cases, the above-mentioned second type of data can also be directly read from its original storage location (such as a disk). For example, the above-mentioned second type of data can be obtained by pre-parsing the code file, and then these data are stored in a certain fixed storage location. When these data are needed, they can be directly read from this storage location.
[0067] By identifying the content of the data stored in the first memory page, it can be determined whether the data stored is the first type of data or the second type of data. If the code defined in the executable file, read-only data, dynamic link information, unmodified file cache, etc. are stored in the first memory page, it can be determined that the data stored in the first memory page is the second type of data.
[0068] If the data stored in the first memory page is other than the code defined in the executable file, read-only data, dynamic link information, unmodified file cache, etc., it can be determined that the data stored in the first memory page is the first type of data.
[0069] In the embodiments of the present application, if any first type of data is stored in the first memory page, it is considered that the data stored in the first memory page is of the first type. For example, any one of the data such as the code defined in the executable file, read-only data, dynamic link information, and file cache that has not been modified is stored in the first memory page, and at the same time, any one or more types of data that cannot be obtained by parsing the code file are also stored, such as code running process data, code running result data, etc. Then, it is considered that the data stored in the first memory page is of the first type.
[0070] S103. When the first type of data is stored in the first memory page, migrate the data stored in the first memory page to a second memory page that has not been added with the first identifier.
[0071] Specifically, if it is confirmed through the processing of steps S101 and S102 that a recoverable error has occurred in the first memory page, and the first memory page stores the first type of data, in order to prevent the first page from having a recoverable error again and then evolving into an unrecoverable error and causing the data stored in the first memory page to be lost, in the embodiments of the present application, the data stored in the first memory page is migrated to a second memory page that has not been added with the first identifier, that is, the data stored in the first memory page is migrated to a reliable memory page.
[0072] If it is confirmed through the processing of steps S101 and S102 that a recoverable error has occurred in the first memory page, but the data stored in the first memory page is of the second type, that is, the data stored in the first memory page can be re-obtained even if it is lost, then the embodiments of the present application directly ignore the recoverable error that has occurred in the first memory page, and only add the first identifier to the first memory page through the processing of step S101.
[0073] The method for handling memory errors proposed in the embodiments of this application, when a recoverable error occurs in the first memory page, adds a first identifier to the first memory page, and the first identifier is used to indicate that the memory page is unreliable; at the same time, detects the type of data stored in the first memory page; when the first memory page stores data of the first type, migrates the data stored in the first memory page to a second memory page that has not been added with the first identifier; wherein, the content of the data of the first type is related to the application execution state during system operation. The above solution can add a first identifier to the memory page when a recoverable error occurs in the memory page, thereby playing the role of memory page marking, so that when the computer system allocates memory pages, it can use this first identifier as a reference to avoid storing important data in this memory page or avoid using this memory page again. On the other hand, when a recoverable error occurs in the memory page, the above solution migrates the data (data of the first type) that is not easily obtained stored therein to a secure page that has not been added with the first identifier, thereby ensuring the security of the page data and avoiding the loss of important data when an irrecoverable error occurs due to the frequent occurrence of recoverable errors.
[0074] In some embodiments, migrating the data stored in the first memory page to the second memory page may be to determine, from the free memory pages, a second memory page that has not been added with the first identifier, and migrate the data stored in the first memory page to the second memory page. Or, determine, from the non-free memory pages, a second memory page that has not been added with the first identifier and stores data of the second type, and exchange the data stored in the first memory page with the data stored in the second memory page.
[0075] Specifically, when it is confirmed that the data stored in the first memory page needs to be migrated, a memory page that has not been added with the first identifier can be searched from the free memory pages. If a free memory page that has not been added with the first identifier is found, then use this free memory page as the first memory page, and through the memory page migration mechanism provided by the operating system, migrate the data stored in the first memory page to the second memory page.
[0076] Alternatively, a memory page that has not been added with the first identifier and stores the second type of data can be searched from non-free memory pages, that is, a memory page that has not been added with the first identifier and stores non-important data (which can be obtained by parsing the code file or read from the original storage location) can be searched as the second memory page. Then, the data stored in the first memory page and the second memory page are exchanged, and the page table and page management information are updated so that the original user of the second memory page and the original user of the first memory page exchange the right to use the two memory pages. In this way, the important data stored in the first memory page (data that cannot be obtained by parsing the code file) can be transferred to the reliable second memory page, and the non-important data can be transferred to the unreliable first memory page.
[0077] The above solutions can all achieve the goal of transferring important, hard-to-reach data to reliable memory pages, thereby avoiding the loss of important data due to unrecoverable errors caused by continuous recoverable errors in unreliable memory pages.
[0078] In some embodiments, the second memory page to which the first identifier is not added is preferentially searched from the free memory pages. If the second memory page to which the first identifier is not added is found, the data stored in the first memory page is migrated to the second memory page. If the second memory page to which the first identifier is not added is not found, the second memory page to which the first identifier is not added and which stores the second type of data is determined from the non-free memory pages, and then the data stored in the first memory page is exchanged with the data stored in the second memory page. This can minimize the impact on the use of the allocated memory pages.
[0079] In some other embodiments, the above-mentioned memory error processing method further includes:
[0080] When the first memory page to which the first identifier is added is released, the first memory page is not released first, but is transferred to the unreliable memory management task for management.
[0081] The unreliable memory management task is a kernel-mode task created when the operating system is started and is responsible for managing unreliable memory pages.
[0082] When receiving the released first memory page, the unreliable memory management task does not release the first memory page first, but locks the first memory page, that is, sets the first memory page to an unusable state, specifically locks the first memory page in the memory to prevent it from being recycled and moved.
[0083] Then, the unreliable memory management task periodically performs reliability detection on the locked first memory page, specifically detecting whether a recoverable error occurs again in the first memory page.
[0084] If it is determined in a certain detection that the first memory page no longer has recoverable errors, the unreliable memory management task unlocks the first memory page. And the unreliable memory management task releases the first memory page, at which time the first memory page becomes ordinary memory and can be recycled and moved.
[0085] If in a certain detection the reliable memory management task determines that the first memory page will still have recoverable errors, the unreliable memory management task continues to manage the first memory page, keeps the first memory page in a locked state, and periodically detects whether the first memory page has recoverable errors again.
[0086] The above processing can prevent unreliable memory pages from being recycled, thereby avoiding storing important data in unreliable memory pages again and affecting the security of important data.
[0087] In another embodiment, the above method for handling memory errors further includes:
[0088] In the case where an unrecoverable error occurs in the third memory page, detect the type of data stored in the third memory page.
[0089] Specifically, the above third memory page can be any memory page in the computer system memory. When it is detected that an unrecoverable error occurs in the third memory page in the computer system memory, for example, when an error report indicating an unrecoverable error is received from the third memory page, further detect the type of data stored in the third memory page.
[0090] In the case where the third memory page stores data of the first type, replace the third memory page with a fourth memory page that has not been added with the first identifier.
[0091] Among them, the above fourth memory page is preferably an idle memory page. That is, when it is confirmed that the data stored in the third memory page with an unrecoverable error is data of the first type, for example, the third memory page stores dynamic link information of an executable file, then search for a memory page that has not been added with the first identifier from the idle pages.
[0092] If a memory page that has not been added with the first identifier is found from the idle pages, use this memory page as the fourth memory page.
[0093] Exemplarily, if a memory page that has not been added with the first identifier is not found from the idle pages, then search for a memory page that has not been added with the first identifier and stores data of the second type from the non-idle pages, clear the data in this memory page, and then this memory page can be used as the fourth memory page.
[0094] After determining the fourth memory page, fill this fourth memory page according to the content of the executable file, and replace the faulty third memory page with the fourth memory page in the memory address mapping relationship, so that the computer system can continue to run based on the fourth memory page.
[0095] If the data stored in the third memory page is of the second type, such as an unchanged file cache, code defined in the executable file, or read-only data, delete the data stored in the third memory page and isolate the third memory page.
[0096] In another embodiment, when it is detected that an irrecoverable error occurs in the third memory page, determine whether the third memory page is managed by the above-mentioned unreliable memory management task. If the third memory page is managed by the above-mentioned unreliable memory management task, it means that the third memory page has had a recoverable error and has been marked as unreliable memory and managed by the unreliable memory management task in the previous stage. At this time, if the third memory page has an irrecoverable error again, it means that the third memory page has failed and cannot be used anymore. At this time, isolate the third memory page for subsequent processing.
[0097] The above solution can transfer data in a timely manner and isolate the error page when an irrecoverable error occurs in the computer system memory, thereby improving the processing efficiency of the memory page with an irrecoverable error.
[0098] In another embodiment, it is also disclosed that the above method for handling memory errors further includes:
[0099] The unreliable memory management task monitors the memory usage of the computer system. When it is found that the available memory of the computer system is lower than the set threshold, determine the fifth memory page and the sixth memory page from the used memory pages of the computer system.
[0100] Among them, the above-mentioned fifth memory page refers to the memory page that stores data of the second type and has not been added with the above-mentioned first identifier, and the above-mentioned sixth memory page refers to the memory page that carries the above-mentioned first identifier.
[0101] Then, migrate the data stored in the above-mentioned fifth memory page to the above-mentioned sixth memory page, exchange the uses of the fifth memory page and the sixth memory page, and recycle the above-mentioned fifth memory page so that the operating system can continue to use the fifth memory page.
[0102] Since the second type of data can be obtained more quickly and conveniently after being lost, therefore, transferring the second type of data from a reliable memory page to an unreliable memory page, even if the second type of data is lost due to an irrecoverable error occurring in the unreliable memory page, the computer system can quickly recover the lost data. And the above process can free up the reliable memory page, thereby expanding the available memory of the system and providing guarantee for the normal operation of the system.
[0103] Corresponding to the above method for handling memory errors, an embodiment of the present application further provides a device for handling memory errors. Refer to Figure 2 As shown, the device includes:
[0104] A page marking unit 100, configured to add a first identifier to the first memory page when a recoverable error occurs in the first memory page, where the first identifier is used to indicate that the memory page is unreliable;
[0105] A detection unit 110, configured to detect the type of data stored in the first memory page;
[0106] A data migration unit 120, configured to migrate the data stored in the first memory page to a second memory page that has not been added with the first identifier when the first memory page stores the first type of data; wherein, the content of the first type of data is related to the application execution state during system operation.
[0107] In some implementation manners, the data migration unit 120 migrating the data stored in the first memory page to the second memory page includes:
[0108] Determining a second memory page that has not been added with the first identifier from free memory pages, and migrating the data stored in the first memory page to the second memory page;
[0109] Or,
[0110] Determining a second memory page that has not been added with the first identifier and stores the second type of data from non-free memory pages, and swapping the data stored in the first memory page with the data stored in the second memory page; wherein, the content of the second type of data is not related to the application state during system operation.
[0111] In some implementation manners, before adding the first identifier to the first memory page, the page marking unit 100 further determines whether the first memory page carries the first identifier;
[0112] If the first memory page carries the first identifier, then ignore the recoverable error;
[0113] If the first memory page does not carry the first identifier, add the first identifier to the first memory page.
[0114] In some implementations, when the data migration unit 120 stores second-type data in the first memory page, it ignores the recoverable error; wherein, the second-type data represents data that can be obtained by parsing a code file.
[0115] In some implementations, the device further includes:
[0116] A memory management unit, configured to lock the first memory page when the first memory page is released, and perform a reliability check on the first memory page; locking the first memory page includes setting the first memory page to an unusable state, and the reliability check is used to detect whether the recoverable error occurs again in the first memory page;
[0117] When it is determined that the recoverable error no longer occurs in the first memory page, unlock the first memory page.
[0118] In some implementations, the detection unit 110 is further configured to:
[0119] When an unrecoverable error occurs in the third memory page, detect the type of data stored in the third memory page;
[0120] The data migration unit 120 is further configured to: when the third memory page stores first-type data, replace the third memory page with a fourth memory page that has not been added with the first identifier.
[0121] In some implementations, the data migration unit 120 is further configured to:
[0122] When the third memory page stores second-type data, delete the data stored in the third memory page and isolate the third memory page; wherein, the content of the second-type data has nothing to do with the application state during system operation.
[0123] In some implementations, the data migration unit 120 is further configured to:
[0124] When the available memory is lower than a set threshold, determine a fifth memory page and a sixth memory page from the memory pages, the fifth memory page stores second-type data and the fifth memory page has not been added with the first identifier, the sixth memory page carries the first identifier, and the second-type data represents data that can be obtained by parsing a code file;
[0125] Migrate the data stored in the fifth memory page to the sixth memory page, and recycle the fifth memory page.
[0126] The memory error processing device provided in this embodiment belongs to the same inventive concept as the memory error processing method provided in the above embodiments of the present application. It can execute the memory error processing method provided in any of the above embodiments of the present application and has the corresponding functional modules and beneficial effects of the execution method. For the technical details not described in detail in this embodiment, reference can be made to the specific processing content of the memory error processing method provided in the above embodiments of the present application, which will not be elaborated here.
[0127] The functions implemented by the above respective units can be realized by the same or different processors, which is not limited in the embodiments of the present application.
[0128] It should be understood that the units in the above device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or the functions of each unit of the device. The processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory inside the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of a hardware circuit. By designing the hardware circuit, part or all of the functions of the units can be realized. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and by designing the logical relationship of the components in the circuit, part or all of the functions of the above units are realized. Another example is that in another implementation, the hardware circuit can be realized by a PLD. Taking an FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured through a configuration file to realize part or all of the functions of the above units. All the units of the above device can be all realized in the form of a processor calling software, or all realized in the form of a hardware circuit, or part realized in the form of a processor calling software, and the remaining part realized in the form of a hardware circuit.
[0129] In the embodiments of the present application, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and running capabilities, such as a CPU, microprocessor, GPU, or DSP, etc.; in another implementation, the processor can implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of this hardware circuit is fixed or can be reconfigured. For example, the processor is a hardware circuit implemented by an ASIC or PLD, such as an FPGA, etc. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the configuration of the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as a type of ASIC, such as an NPU, TPU, DPU, etc.
[0130] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method. For example: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0131] In addition, each unit in the above device can be integrated in whole or in part, or can be independently implemented. In one implementation, these units are integrated together and implemented in the form of an SOC. The SOC can include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The types of the at least one processor can be different, such as including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0132] Another embodiment of the present application also proposes a memory error processing device. Refer to Figure 3 As shown, the device includes:
[0133] A memory 200 and a processor 210;
[0134] Wherein, the memory 200 is connected to the processor 210 and is used to store programs;
[0135] The processor 210 is used to implement the memory error processing method disclosed in any of the above embodiments by running the programs stored in the memory 200.
[0136] Specifically, the above memory error processing device may further include: a bus, a communication interface 220, an input device 230, and an output device 240.
[0137] The processor 210, the memory 200, the communication interface 220, the input device 230, and the output device 240 are interconnected through the bus. Among them:
[0138] The bus may include a path for transmitting information between various components of a computer system.
[0139] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0140] The processor 210 may include a main processor, and may also include a baseband chip, a modem, etc.
[0141] The memory 200 stores a program for implementing the technical solution of the present invention, and may also store an operating system and other critical services. Specifically, the program may include program code, and the program code includes computer operation instructions. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk memory, a flash memory, etc.
[0142] The input device 230 may include a device for receiving user input data and information, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer or a gravity sensor, etc.
[0143] The output device 240 may include a device for allowing information to be output to the user, such as a display screen, a printer, a speaker, etc.
[0144] The communication interface 220 may include a device of any transceiver type for communicating with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0145] The processor 210 executes the program stored in the memory 200 and calls other devices, and can be used to implement each step of any one of the memory error processing methods provided in the above embodiments of the present application.
[0146] An embodiment of the present application also provides a chip, which includes a processor and a data interface. The processor reads and runs a program stored in a memory through the data interface to execute the method for handling memory errors introduced in any of the above embodiments. For the specific processing process and its beneficial effects, reference can be made to the embodiments of the method for handling memory errors described above.
[0147] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are run by a processor, the processor is caused to execute the steps in the method for handling memory errors described in any of the above embodiments of this specification.
[0148] The computer program product can be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present application. The programming languages include object-oriented programming languages such as Java and C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed completely on a user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or completely on a remote computing device or server.
[0149] In addition, an embodiment of the present application may also be a storage medium, on which a computer program is stored. The computer program is executed by a processor to perform the steps in the method for handling memory errors described in any of the above embodiments of this specification.
[0150] For the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0151] It should be noted that the embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0152] The steps in the methods of the embodiments of the present application can be adjusted, combined, and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0153] In each embodiment of the present application, the modules and sub-modules in the device and the terminal can be combined, divided, and deleted according to actual needs.
[0154] In several embodiments provided in the present application, it should be understood that the disclosed terminal, device, and method can be implemented in other ways. For example, the terminal embodiments described above are merely illustrative. For example, the division of modules or sub-modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or module can be in electrical, mechanical, or other forms.
[0155] The modules or sub-modules described as separate components may or may not be physically separated. The components as modules or sub-modules may or may not be physical modules or sub-modules, that is, they can be located in one place, or they can be distributed to multiple network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] In addition, in each embodiment of the present application, each functional module or sub-module can be integrated in a processing module, or each module or sub-module can exist physically alone, or two or more modules or sub-modules can be integrated in one module. The above-mentioned integrated modules or sub-modules can be implemented in the form of hardware or in the form of software functional modules or sub-modules.
[0157] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0158] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in a software unit executed by a processor, or in a combination thereof. The software unit may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium well-known in the art.
[0159] Finally, it should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0160] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing a memory error, characterized in that: include: When a recoverable error occurs in the first memory page, adding a first identifier to the first memory page, where the first identifier is used to indicate that the memory page is unreliable; Detecting the type of data stored in the first memory page; In the case where the first memory page stores first type data, the data stored in the first memory page is migrated to a second memory page to which the first identifier is not added; wherein the content of the first type data is related to the application execution state when the system is running.
2. The method according to claim 1, characterized in that Migrating the data stored in the first memory page to the second memory page includes: Determine a second memory page to which the first identifier is not added from the free memory pages, and migrate the data stored in the first memory page to the second memory page; or, A second memory page to which the first identifier is not added and which stores second type data is determined from non-free memory pages, and the data stored in the first memory page is exchanged with the data stored in the second memory page; wherein the content of the second type data is independent of the application state when the system is running.
3. The method according to claim 1, characterized in that Before adding the first identifier to the first memory page, the method further includes: Determining whether the first memory page carries the first identifier; If the first memory page carries the first identifier, ignoring the recoverable error; If the first memory page does not carry the first identifier, the first identifier is added to the first memory page.
4. The method according to claim 1, characterized in that The method further comprises: In the case where the first memory page stores second type data, the recoverable error is ignored; wherein the second type data represents data that can be obtained by parsing the code file.
5. The method according to claim 1, characterized in that The method further comprises: When the first memory page is released, the first memory page is locked, and a reliability test is performed on the first memory page; locking the first memory page includes setting the first memory page to an unusable state, and the reliability test is used to detect whether the recoverable error occurs again in the first memory page; When it is determined that the recoverable error no longer occurs in the first memory page, unlocking the first memory page.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: In the case where an unrecoverable error occurs in the third memory page, detecting the type of data stored in the third memory page; In a case where the third memory page stores the first type of data, replacing the third memory page with a fourth memory page to which the first identifier is not added; In the case where the third memory page stores the second type of data, the data stored in the third memory page is deleted and the third memory page is isolated; wherein the content of the second type of data is irrelevant to the application state during system operation.
7. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the available memory is lower than a set threshold, determine a fifth memory page and a sixth memory page from the memory pages, the fifth memory page stores second-type data and the first identifier is not added to the fifth memory page, the sixth memory page carries the first identifier, and the second-type data represents data that can be obtained by parsing the code file; The data stored in the fifth memory page is migrated to the sixth memory page, and the fifth memory page is recycled.
8. A memory error processing device, characterized in that: include: a page marking unit, configured to add a first identifier to the first memory page when a recoverable error occurs in the first memory page, wherein the first identifier is used to indicate that the memory page is unreliable; a detection unit, configured to detect a type of data stored in the first memory page; A data migration unit is used to migrate the data stored in the first memory page to a second memory page to which the first identifier is not added when the first memory page stores the first type of data; wherein the content of the first type of data is related to the application execution state when the system is running.
9. A memory error processing device, characterized in that: include: Memory and processor; Wherein, the memory is connected to the processor and is used to store programs; The processor is used to implement the memory error processing method as described in any one of claims 1 to 7 by running the program in the memory.
10. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the memory error processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Memory management method, terminal device, computer device, and readable storage medium
CN108205475A
Memory management method and device
CN110888821A
Memory error processing method and computing device
CN116382958A
Resiliency to memory failures in computer systems
US20130311823A1
Recovering from uncorrected memory errors
US20140331015A1