Memory mirroring method and system, and cluster

By configuring the mirror space and the main space in the memory, data is allowed to be written alternately between different channels, and data backup is written in the mirror space, which solves the problems in the existing technology that the memory mirror needs to be restarted and the data migration is large. , achieving efficient and fast memory mirroring and business continuity.

WO2024193273A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/077832
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-01
Filing Date
2024-02-20
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Existing memory mirroring technology requires restarting the computing device when implementing it, causing business interruption. Data migration is large and time-consuming, making it difficult to perform memory mirroring while the computing device is running.

Method used

By configuring the mirror space and the main space in the memory, data is allowed to be written alternately between different channels, reducing the amount of data migration, and data backup is written in the mirror space to ensure data consistency and error correction capabilities and avoid restarts.

Benefits of technology

It realizes efficient and fast memory mirroring during the operation of computing equipment, reduces the amount and time of data migration, avoids business interruption, and improves the reliability and efficiency of the memory mirroring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077832_26092024_PF_FP
    Figure CN2024077832_26092024_PF_FP
Patent Text Reader

Abstract

A memory mirroring method and system, and a cluster. The method comprises: after a processor in a memory mirroring system writes first data into a primary space of a memory by means of a memory management module, the processor configures a mirror space for the primary space, wherein the primary space and the mirror space are both distributed in a plurality of channels of the memory. The memory management module does not need to change the location of the first data in the primary space, and only needs to write a backup of the first data into the mirror space. The location of data of the primary space in a channel and the location of a channel where a backup of the data in the mirror space is located are no longer required to be the same, thereby providing possibility for enabling memory mirroring in the operation process of the memory mirroring system. After the mirror space is configured for the primary space, the memory management module only needs to ensure that the backup of the first data is written into the mirror space.
Need to check novelty before this filing date? Find Prior Art

Description

Memory mirroring method, system and cluster

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 21, 2023, with application number 202310310741.9 and application name “A memory mirroring system”, the entire contents of which are incorporated by reference into this application; this application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 1, 2023, with application number 202310645734.4 and application name “A memory mirroring method, system and cluster”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of memory technology, and in particular to a memory mirroring method, system, and cluster. Background Art

[0004] Memory mirroring is an effective way to correct data errors in memory. It allows you to save a backup of data in memory. If an uncorrectable error occurs, the saved backup can be used to correct the error.

[0005] Currently, memory mirroring is mostly used in multi-channel memory, where one channel is used to store data and the other channel is used to store data backups. The locations of the data in the memory mirror and the data in different channels in the backup are usually the same, that is, the address of the data in the channel where it is stored is the same as the address of the channel where the data is backed up.

[0006] When writing data to memory, it must be written alternately across multiple channels. This means that as data is written to one channel, subsequent data must be written to another channel. This approach improves memory writing efficiency. However, if memory mirroring of data already written to each channel is required, extensive data migration is required, which is labor-intensive, time-consuming, and difficult to implement. Therefore, enabling memory mirroring currently requires restarting the computing device, freeing up memory before performing memory mirroring. This can cause service interruptions on the computing device.

[0007] Summary of the Invention

[0008] The present application provides a memory mirroring method, system, and cluster for implementing memory mirroring during the operation of a computing device.

[0009] In a first aspect, embodiments of the present application provide a memory mirroring method that can be applied to a memory mirroring system. In the memory mirroring system, a processor can write first data to a main memory space through a memory management module. After the first data is written, the processor can configure a mirror space for the main memory space, where both the main memory space and the mirror space are distributed across multiple channels of the memory.

[0010] After the processor configures the mirror space for the main space, the memory management module does not need to change the position of the first data in the main space, but only needs to write the backup of the first data to the mirror space, and the position of the first data in the main space remains unchanged.

[0011] In an embodiment of the present application, the memory mirroring system may include one computing device or multiple computing devices. When the memory mirroring system includes one computing device, the processor is the processor of the computing device, and the memory is the memory of the computing device. The memory management module is a hardware module in the computing device. When the memory mirroring system includes multiple computing devices, the processor is the processor in any computing device, and the memory management module can be distributed on multiple computing devices. The memory can be the global memory of the cluster of the multiple computing devices, that is, the collection of the memories of the multiple computing devices. In this case, the main space can be distributed on multiple computing devices, and the mirror space can also be distributed on the multiple computing devices.

[0012] With this method, the channel locations of the data in the primary space and the backup data in the mirror space no longer need to be identical. This makes it possible to enable memory mirroring during the operation of the memory mirroring system. After configuring the mirror space for the primary space, the memory management module only needs to ensure that a backup of the first data is written to the mirror space. This effectively reduces the amount of data migration after enabling memory mirroring, further ensuring efficient and rapid memory mirroring during operation, and without interrupting the memory mirroring system's services.

[0013] In one possible implementation, when the memory management module writes a backup of the first data to the mirror space, it can determine the second address of the backup of the first data in the mirror space based on the first address of the first data in the main space, and the first address and the second address are located in different channels; the memory management module writes the backup of the first data to the second address.

[0014] Through the above method, there is a certain correlation between the first address and the second address, which ensures that the memory management module can quickly determine the second address and write the backup of the first data in the mirror space in time.

[0015] In one possible implementation, the second address is determined based on the first address and a reference offset, where the reference offset is determined based on part or all of the following:

[0016] Mirror space, the number of channels distributed in the mirror space, the channel number where the first address is located, and the amount of data written to a channel each time.

[0017] The second address may be determined after performing an offset on the first address, and the length of the offset may be equal to the reference offset. The method for determining the second address is relatively simple.

[0018] In a possible implementation, the memory management module may determine the second address in the unoccupied space in the mirror space. For example, the second address includes a starting address and an offset of the unoccupied space in the mirror space, where the offset is equal to the length of the second data.

[0019] Through the above method, the memory management module can effectively utilize the space in the mirror space and ensure that the backup of data can be written into the mirror space in sequence and in an orderly manner.

[0020] In one possible implementation, when the memory management module receives a write request from the processor for requesting to write the second data at a third address (corresponding to the second write request mentioned in the embodiment of the present application), the memory management module determines the third address of the second data in the main space and the fourth address of the second data in the mirror space after receiving the write request, and the third address and the fourth address are located in different channels. The memory management module writes the data to the third address and writes the backup of the data to the fourth address. There are many ways for the memory management module to determine the fourth address. For example, the memory management module can find an idle address in a channel other than the channel where the third address is located as the fourth address, and the memory management module can record the mapping relationship between the third address and the fourth address. For another example, the memory management module can calculate the fourth address based on the third address, that is, there is a certain correlation between the third address and the fourth address.

[0021] Through the above method, the memory management module can flexibly determine the fourth address after determining the third address, which is suitable for different application scenarios.

[0022] In one possible embodiment, when the memory management module receives a read request for requesting to read the first data from the processor (corresponding to the first write request mentioned in the embodiment of the present application), the memory management module obtains the first address of the first data in the main space from the read request, reads the data from the main space according to the first address, and if the data is read from the main space successfully, the read data is fed back to the processor. If reading the data from the main space fails, when the memory management module records the mapping relationship between the first address and the second address, the memory management module determines the second address based on the mapping relationship and the first address. When there is an association between the second address and the first address, the memory management module can calculate the second address based on the first address, read the backup of the first data from the mirror space according to the second address, and feed the backup of the data back to the processor.

[0023] Through the above method, due to the existence of the mirror space, when a data error occurs in the main space (data cannot be read), the memory management module can read the backup of the data from the mirror space to ensure that the processor can obtain the correct data.

[0024] In a possible implementation, after reading the backup of the first data, the memory management module may further write the backup of the first data to the first address to correct an error occurring at the first address.

[0025] By using the above method, writing the backup of the first data back to the first address can ensure that correct data is stored at the first address, correct errors occurring at the first address, and reduce the probability of memory errors occurring during data reading and writing.

[0026] In a possible implementation, when a UCE occurs in the primary space, the processor may determine a backup mirror space in the memory, where the backup mirror space is distributed across multiple channels of the memory and may have the same size as the mirror space.

[0027] The processor releases the primary space, configures the mirror space as a new primary space, and configures the backup mirror space as a new mirror space; the memory management module migrates the data in the new primary space to the new mirror space.

[0028] With this method, because the primary and mirror spaces are two relatively independent storage spaces, the processor can directly release the primary space when a UCE occurs in the primary space without affecting the mirror space. Furthermore, only the data in the mirror space needs to be migrated to the backup mirror space, making the migration process simpler and less time-consuming.

[0029] In one possible implementation, the processor can select a storage space adjacent to the mirror space as the backup mirror space, or can select a storage space not adjacent to the mirror space as the backup mirror space. The selection of the backup mirror space is relatively flexible. In one possible implementation, the memory management module writes the next data to be written to the main space after the first data into a channel different from the channel where the first address is located. The memory management module writes the data into the memory in an alternating manner to each channel of the memory to ensure data writing efficiency.

[0030] In the second aspect, an embodiment of the present application provides a memory mirroring system, which includes a processor and a memory management module. The memory mirroring system can execute the method in the first aspect and any possible implementation method. The beneficial effects can be found in the relevant description of the first aspect and will not be repeated here.

[0031] The processor is configured to configure a mirror space for the main space after writing first data to the main space of the memory through the memory management module, wherein the main space and the mirror space are both distributed in multiple channels of the memory.

[0032] The memory management module is used to write the backup of the first data into the mirror space, while the position of the first data in the main space remains unchanged.

[0033] In an embodiment of the present application, the memory mirroring system may include one computing device or multiple computing devices. When the memory mirroring system includes one computing device, the processor is the processor of the computing device, and the memory is the memory of the computing device. The memory management module is a hardware module in the computing device. When the memory mirroring system includes multiple computing devices, the processor is the processor in any computing device, and the memory management module can be distributed on multiple computing devices. The memory can be the global memory of the cluster of the multiple computing devices, that is, the collection of the memories of the multiple computing devices. In this case, the main space can be distributed on multiple computing devices, and the mirror space can also be distributed on the multiple computing devices.

[0034] In one possible implementation, when the memory management module writes a backup of the first data to the mirror space, it determines the second address of the backup of the first data in the mirror space based on the first address of the first data in the main space, and the first address and the second address are located in different channels; then, the backup of the first data is written to the second address.

[0035] In one possible implementation, the second address is determined based on the first address and a reference offset, where the reference offset is determined based on part or all of the following:

[0036] The size of the mirror space, the number of channels distributed in the mirror space, the channel number where the first address is located, and the amount of data written to a channel each time.

[0037] In a possible implementation, the second address includes a starting address and an offset of an unoccupied space in the mirror space, where the offset is equal to the length of the second data.

[0038] In one possible implementation, the memory management module receives a write request from the processor, the write request being for writing second data to a third address in the primary space. The memory management module determines a fourth address based on the third address, wherein the third address and the fourth address are located in different channels and the fourth address is located in unoccupied space in the mirror space. The memory management module writes the second data to the third address and writes a backup copy of the second data to the fourth address.

[0039] In one possible implementation, the memory management module may receive a read request from the processor, the read request being used to request reading first data from a first address. If reading the first data from the primary space according to the first address fails, the memory management module reads a backup of the first data from the mirror space according to the second address.

[0040] In a possible implementation, the memory management module may further write the backup of the first data to the second address.

[0041] In one possible implementation, when a UCE occurs in the primary space, the processor determines a backup mirror space in the memory, where the backup mirror space is distributed in multiple channels of the memory; the processor releases the primary space, configures the mirror space as a new primary space, and configures the backup mirror space as a new mirror space; and the memory management module migrates the data of the new primary space to the new mirror space.

[0042] In a possible implementation, the backup mirror space and the mirror space are adjacent.

[0043] In a possible implementation, the memory management module writes the next data that needs to be written into the main space after the first data into a channel different from the channel where the first address is located.

[0044] In a third aspect, the present application further provides a processing device for executing the operations executed by the processor in the first aspect and various possible implementations of the first aspect, and the processing device includes a read-write module and a configuration module.

[0045] The configuration module is used to configure the main space and the mirror space in the memory after the first data is written into the main space.

[0046] The read / write module is used to send a read request or a write request to the memory management module.

[0047] In one possible implementation, the configuration module can also determine the backup mirror space in the memory when an uncorrectable error (UCE) occurs in the main space, and the backup mirror space is distributed in multiple channels of the memory; release the main space, configure the mirror space as a new main space, and configure the backup mirror space as a new mirror space.

[0048] In a fourth aspect, an embodiment of the present application further provides a computing device having the function of implementing the behavior of the memory mirroring system in the method example of the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The structure of the computing device includes a processor, a memory, and a memory management module. The processor is configured to support the memory mirroring system to perform the corresponding functions of the processor in the method of the first aspect above. The memory management module is configured to support the memory mirroring system to perform the corresponding functions of the memory management module in the method of the first aspect above. The memory is coupled to the processor, which stores necessary computer program instructions and data. The main space and the mirror space can be distributed in the memory.

[0049] In the fifth aspect, an embodiment of the present application further provides a computing device cluster, which has the function of implementing the behavior of the memory mirroring system in the method example of the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The computing device cluster includes at least one computing device, and the structure of any computing device includes a memory and a memory management module. The processor in any computing device is configured to support the memory mirroring system to perform part or all of the functions of the processor in the first aspect and various possible implementations of the first aspect. The memory management module in any computing device is configured to support the memory mirroring system to perform part or all of the functions of the memory management module in the first aspect and various possible implementations of the first aspect. The memory is coupled to the processor, which stores necessary computer program instructions and data. The main space and the mirror space can be distributed in the memory of the at least one computing device.

[0050] In a sixth aspect, the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method in the above-mentioned first aspect and various possible implementations of the first aspect.

[0051] In a seventh aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the above-mentioned first aspect and various possible implementations of the first aspect.

[0052] In an eighth aspect, the present application also provides a computer chip, which is connected to a memory and is used to read and execute a software program stored in the memory to execute the method in the above-mentioned first aspect and various possible implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] FIG1A is a schematic diagram showing data arrangement when a memory is not mirrored;

[0054] FIG1B is a schematic diagram showing the arrangement of data in a memory under memory mirroring;

[0055] FIG2 is a schematic diagram of the structure of a memory mirroring system provided in an embodiment of the present application;

[0056] FIG3 is a schematic diagram of a memory mirroring method provided in an embodiment of the present application;

[0057] 4A and 4B are schematic diagrams showing the distribution of a mirror space and a main space provided in an embodiment of the present application;

[0058] FIG5 is a data migration flow chart provided in an embodiment of the present application;

[0059] 6A and 6B are schematic diagrams illustrating the distribution of a backup mirror space, a mirror space, and a primary space provided in an embodiment of the present application;

[0060] FIG7 is a schematic diagram of the distribution of the mirror space and the main space before and after the migration of the main space provided by an embodiment of the present application. DETAILED DESCRIPTION

[0061] Currently, memory typically supports multiple channels. Below, using a memory controller with two channels as an example, we'll explain the process of alternating data writes between the two channels. Figure 1A shows a flowchart of a memory controller writing data to two channels. The small rectangles represent the data being written, and the numbers within the rectangles indicate the order in which the data is written. Figure 1A shows that after the first data is written to channel 1, the second data is written to channel 2. Subsequently, the third data is written to channel 1, the fourth data is written to channel 2, the fifth data is written to channel 1, and the sixth data is written to channel 2.

[0062] When the memory space is configured to support mirroring using the data writing method shown in Figure 1A, the backup data needs to be written to a different channel than the data. After the memory supports mirroring, the arrangement of the data in each channel in the memory can be seen in Figure 1B. The small white rectangles represent the data, and the numbers in the white rectangles represent the order in which the data is written. The small black rectangles represent the backups of the data, and the numbers in the black rectangles represent the order in which the data is written. In Figure 1B, the data writing still needs to use an alternating writing method. After the first data is written to channel 1, the backup of the first data needs to be written to channel 2. The second data will be written to channel 2, and the backup of the second data will be written to channel 1. The third data will be written to channel 1, and the backup of the third data will be written to channel 2. The fourth data will be written to channel 2, and the backup of the fourth data will be written to channel 1. The fifth data will be written to channel 1, and the backup of the fifth data will be written to channel 2. The sixth data will be written to channel 2, and the backup of the sixth data will be written to channel 1.

[0063] As can be seen in Figure 1B, after enabling memory mirroring, the data and data backups in each channel are interleaved, which is a relatively complex arrangement. Enabling the memory mirroring function, as in the case of Figure 1A, will involve a large amount of data migration, which consumes a considerable amount of time. Therefore, the current common practice is that after enabling memory mirroring, the entire computing device must be restarted, meaning that the memory must be released before memory mirroring can be implemented. This memory mirroring approach does not allow the computing device to configure the mirror space and the main space during operation.

[0064] In an embodiment of the present application, a memory mirroring method is proposed, which no longer requires that the address of the channel where the data is located be the same as the address of the channel where the data is backed up, and provides the possibility of dynamically configuring the mirror space and the main space. An embodiment of the present application provides a memory mirroring method and device.

[0065] Before introducing the memory mirroring method, system, and device provided in the embodiments of the present application, the concepts of "primary space and mirror space" involved in the embodiments of the present application are clarified:

[0066] Memory mirroring refers to backing up data in memory, generating one or more copies of the data. The space where the data backup is stored is called the mirror space. This application does not limit the number of mirror spaces. You can configure one mirror space for the main space, which stores a backup of the data. You can also configure multiple mirror spaces for the main space, each storing a backup of the data. The space where the data is stored is the main space, which is the space where memory read and write operations occur.

[0067] In an embodiment of the present application, the processor can configure a mirror space for the main space when the first data is already stored in the main space. After the mirror space is configured, the position of the first data in the main space does not change, and the memory mirror module writes the backup of the first data into the mirror space. In this method, as long as the backup of the first data is written to the mirror space, it is no longer required that the position of the first data in the channel where it is located is the same as the position of the channel where the backup of the first data is located. Therefore, there is no need to restart the entire computing device, ensuring that the computing device can realize the configuration of the main space and the mirror space during operation, which also provides the possibility of dynamically changing the main space and the mirror space during operation.

[0068] As shown in FIG2 , it is a schematic structural diagram of a memory mirroring system provided in an embodiment of the present application. The memory mirroring system includes a processor 100 and a memory system 200 .

[0069] The processor 100 is the computing core in the memory mirroring system, and the processor 100 is capable of performing some data processing operations. The processor 100 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), an artificial intelligence (AI) chip, a system on chip (SoC) or a complex programmable logic device (CPLD), a graphics processing unit (GPU), etc. This application does not limit the number of the processors 100. The memory mirroring system may include one processor 100 or multiple processors 100.

[0070] In the embodiment of the present application, the processor 100 can write data to the memory 220 through the memory management module and can also configure the primary space and the mirror space during the operation of the memory mirroring system. The processor 100 runs an operating system (OS) and a basic input and output system (BIOS). The OS and BIOS cooperate to complete the configuration of the primary space and the mirror space.

[0071] The memory system 200 is connected to the processor 100. The memory system 200 is used to store data that the processor 100 needs to process or processed data. The processor 100 will interact with the memory system 200 during the process of processing data and initiate an access request to the memory system 200, such as a write request (such as a first write request or a second write request) for requesting to write data (such as first data, second data, etc.) or a read request (such as a first read request or a second read request) for requesting to read data.

[0072] The memory system 200 includes a memory management module 210 and memory 220. The memory 220 supports multiple channels, and each channel can be inserted with one or more memory modules 221. The type of memory module 221 is not limited here. The memory module 221 can be a read-only memory (ROM), dynamic random access memory (DRAM), storage class memory (SCM), static random access memory (SRAM), dual in-line memory module (DIMM), etc.

[0073] The memory management module 210 is the manager of the memory 220, that is, the memory management module 210 is capable of managing the multiple channels. The memory management module 210 is capable of processing access requests from the processor 100, parsing the access requests, determining the channel where the data to be accessed by the access request is located, and accessing the data within the channel. Access here mainly involves two operations: reading data from the channel and writing data to the channel.

[0074] After receiving a write request requesting to write data to the primary space, if the mirror space is not currently enabled, that is, the mirror space has not been configured for the primary space, the memory management module 210 may write the data requested in the write request to the primary space. If the mirror space is currently enabled, that is, the mirror space has been configured for the primary space, the memory management module 210 may write the data carried in the write request to the primary space and the mirror space respectively. The channel where the data is located in the primary space is different from the channel where the data is located in the mirror space.

[0075] After receiving a read request for reading and writing data from the primary space, the memory management module 210 may read the data from the primary space if the mirror space is not currently enabled, i.e., the mirror space has not been configured for the primary space. If the data reading from the primary space fails, the memory management module 210 may notify the processor 100 of the data read failure. If the mirror space is currently enabled, i.e., the mirror space has been configured for the primary space, the data may be read from the primary space first. If the data reading from the primary space fails, the data may be read from the mirror space.

[0076] In addition, the memory management module 210 also has a data migration function, which can migrate data between the primary space and the mirror space, or migrate data between mirror spaces. For example, after the mirror space is configured for the primary space, the memory management module 210 can write a backup of the data already written to the primary space into the mirror space. For another example, when the primary space is changed, that is, a new primary space is configured to replace the previous primary space, the memory management module 210 can also perform data migration to ensure that the same data is stored in the newly configured primary space and its corresponding mirror space.

[0077] In some scenarios, the memory controller can directly manage the multiple channels and directly access the data of the multiple channels; in this scenario, the memory controller can be understood as the memory management module 210.

[0078] In some scenarios, the memory controller can only manage some of the multiple channels, and the memory controller can only access these channels. The memory system 200 may include multiple memory controllers. For example, the memory 220 includes 8 channels and four memory controllers, and one memory controller is used to manage 8 channels. A management unit is also provided on the upper layer of each memory controller, and the management unit is capable of managing each memory controller. After receiving the access request sent by the processor 100, the management unit parses the access request, determines the channel where the data accessed by the access request is located, and sends the access request to the memory controller that manages the channel. After receiving the access request, the memory controller accesses the data in the managed channel according to the access request. In this scenario, the whole composed of the various memory controllers and the management unit is regarded as the memory management module 210.

[0079] The embodiments of the present application do not limit the specific form of the memory management module 210. The memory management module 210 can be 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, etc.

[0080] The embodiment of the present application does not limit the specific form of the memory mirroring system. The memory mirroring system may include one computing device or multiple computing devices.

[0081] When the memory mirroring system includes one computing device, the processor 100 is the processor of the computing device, and the memory 220 is the memory of the computing device. The memory management module 210 is a hardware module in the computing device. When the memory mirroring system includes multiple computing devices, the processor 100 can be the processor in any computing device, and the memory management module 210 can be distributed on multiple computing devices. The memory 220 can be the global memory of the cluster of the multiple computing devices, that is, the collection of the memories of the multiple computing devices. In this case, the main space can be distributed on multiple computing devices, and the mirror space can also be distributed on the multiple computing devices.

[0082] The following describes a memory mirroring method provided by an embodiment of the present application in conjunction with FIG3 . The method includes two parts: one part is the process of processing write requests and read requests by the memory management module 210 before memory mirroring is enabled (see steps 300 to 306); and the other part is the process of data migration and the process of processing write requests and read requests by the memory management module 210 after memory mirroring is enabled (see steps 307 to 315). For the sake of convenience, the write request and read request processed by the memory management module 210 before memory mirroring is enabled are respectively referred to as the first write request and the first read request, and the data written or read involved are the first data. After memory mirroring is enabled, the write request and read request processed by the memory management module 210 are respectively referred to as the second write request and the second read request, and the data written or read involved are the second data.

[0083] Step 300: The processor 100 accesses the memory 220 and initiates a first write request to the memory system 200. The first write request is used to request writing of first data. The first write request carries the first data to be written and a first address.

[0084] Step 301: The memory management module 210 in the memory system 200 receives the first write request and writes first data to the first address.

[0085] The memory management module 210 can determine the channel number of the channel to which the first data needs to be written and the address of the first data on the channel by parsing the first address. That is, the first address can represent the channel where the first data is located and the position on the channel.

[0086] Step 302: After completing the writing of the first data, the memory management module 210 may also notify the processor 100 that the first data is written successfully.

[0087] Step 303: The processor 100 accesses the memory 220 and initiates a first read request to the memory system 200. The first read request is used to request to read the first data. The first read request carries a first address.

[0088] Step 304 : The memory management module 210 in the memory system 200 receives the first read request and reads the first data from the first address.

[0089] Step 305 : The memory management module 210 feeds back the first data to the processor 100 .

[0090] If the memory management module 210 fails to read the first data from the first address in step 304 , it indicates that a UCE occurs at the first address, and the memory management module 210 may notify the processor 100 that the first data reading fails.

[0091] Steps 300 to 305 are the process of the memory management module 210 writing data into and reading data from the memory 220 before the memory is enabled. Without restarting the memory mirroring system, the memory mirroring can be enabled, that is, step 306 is executed.

[0092] Step 306 : The processor 100 configures the main space and the mirror space in the memory 220 .

[0093] The BIOS and OS run by the processor 100 cooperate to implement the configuration of the main space and the mirror space.

[0094] During the operation of the memory mirroring system, the user is allowed to configure information about the primary space and the mirror space. The embodiments of the present application do not limit the information content of the primary space and the mirror space configured by the user. For example, the user can configure the total size of the primary space and the mirror space, or the ratio of the primary space and the mirror space to the storage space of the memory 220.

[0095] In the embodiment of the present application, the primary space and the mirror space can be the storage space of the entire memory 220, that is, the data in the memory 220 is globally mirrored, and all data stored in the memory 220 needs to be backed up. The primary space and the mirror space can also be partial storage space in the memory 220, that is, the data in the memory 220 is partially mirrored, that is, part of the data stored in the memory 220 needs to be backed up.

[0096] In the embodiment of the present application, the memory mirroring system is not enabled when the memory mirroring is started as an example for illustration, that is, the user can start the memory mirroring during the operation of the memory mirroring system and configure the information of the main space and the mirror space. In actual applications, after enabling memory mirroring, the user can reconfigure the information of the main space and the mirror space (that is, change the configuration of the main space and the mirror space) during the operation of the memory mirroring system. During the operation of the memory mirroring system, the OS can actively trigger the BIOS to configure the main space and the mirror space, and the OS can send the information of the main space and the mirror space to the BIOS.

[0097] The BIOS detects the user-configured primary and mirrored space information, or the primary and mirrored space information sent by the OS, and establishes a mirroring relationship between the primary and mirrored spaces based on this information. The established primary and mirrored spaces form a single memory space, which the BIOS reports to the OS. After the OS boots, it uses this memory space as system storage, allowing it to access data during subsequent OS operations.

[0098] During this process, the memory mirroring system always remains in operation and does not require restart. The configuration of the main space and the mirror space can be completed only through the cooperation of BIOS and OS.

[0099] The main space and mirror space configured by the processor 100 are distributed across multiple channels. As shown in Figure 4A, taking the case where the main space and mirror space are distributed across two channels as an example, after the processor 100 executes step 300, the processor 100 establishes a mirror relationship between the main space and one of the mirror spaces. Because the main space is distributed across two channels, the memory management module 210 can alternately write data to the two channels of the main space when writing data to the main space. In other words, after the memory management module 210 writes data A to one channel of the main space, for the next data B to be written after data A, the memory management module 210 can write data B to another channel of the main space. Since the mirror space is also distributed across two channels, to ensure the security of data backup, the data and its backup will be distributed across different channels. When the memory management module 210 alternately writes data to the two channels of the main space, the memory management module 210 will also alternately write the data backup to the two channels of the mirror space. Whether it is data or data backup, the method of alternating writing to two channels can effectively improve the writing efficiency of data and data backup. Similarly, data reading is the reverse process of data writing. During the data reading process, the memory management module 210 can read data alternately from the two channels of the main space, thereby ensuring the efficiency of data reading.

[0100] As shown in Figure 4B , taking the case where the primary space and the mirror space are distributed across three channels as an example, after the processor 100 executes step 300, the processor 100 establishes a mirror relationship between the primary space and the two mirror spaces. The sizes and positional relationships of the primary space and the mirror space have been determined. Similar to the case where the primary space and the mirror space are distributed across two channels, when the processor 100 reads or writes data, the memory management module 210 can alternately write or read data on each channel.

[0101] Furthermore, in the embodiment of the present application, the processor 100 can also configure the primary space and the mirror space when the memory mirroring system is started, that is, memory mirroring can be enabled when the memory mirroring system is started. Similar to the aforementioned method of configuring the primary space and the mirror space during operation of the memory mirroring system, the BIOS and the OS cooperate to perform the initial configuration of the primary space and the mirror space when the memory mirroring system is started.

[0102] In the BIOS, the user is allowed to pre-configure the information of the primary space and the mirror space. The information content of the primary space and the mirror space configured by the user can be found in the above description and will not be repeated here.

[0103] When the memory mirroring system is activated, the processor 100 is powered on and the BIOS boots up first. The BIOS detects the configured primary and mirrored spaces and establishes a mirroring relationship between them based on this information. The established primary and mirrored spaces form a single memory space, which the BIOS reports to the OS. After the OS boots up, it uses this memory space as system storage, allowing it to access data during subsequent OS operations.

[0104] The following describes the data migration within the memory system 200 (see step 307 ) after memory mirroring is enabled, and the process of the processor 100 writing data to and reading data from the memory 220 , in conjunction with steps 307 to 315 .

[0105] Step 307: The memory management module 210 writes the backup of the first data in the primary space into the mirror space.

[0106] After enabling memory mirroring, the memory management module 210 can determine whether data has been written into the main space. Here, the first data is located in the main space, that is, the first address is the address in the main space.

[0107] The memory management module 210 determines a second address of a backup of the first data in the mirror space, and writes the backup of the first data to the second address.

[0108] There are two ways to determine the second address:

[0109] Method 1: The memory management module 210 determines a second address from an unoccupied space in the mirror space. The second address and the first address are located on a different channel.

[0110] The memory management module 210 may determine the channel where the first address is located according to the first address, and the memory management module 210 may determine the second address in a channel other than the channel where the first address is located in the mirror space.

[0111] For example, when the primary space and the mirror space are distributed across two channels, and the first address is on one of the channels, the second address will be on the other channel. For another example, when the primary space and the mirror space are distributed across N channels, where N is a positive integer greater than 2, and the first address is on one of the channels, the second address will be on a channel other than the channel where the first address is located. The memory management module 210 may determine the second address on a channel adjacent to the channel where the first address is located in the mirror space.

[0112] The second address determined by the memory management module 210 may include a starting address of an unoccupied space in the mirror space and an offset, the offset being equal to the size of the second data, wherein the channel where the starting address is located is different from the channel where the first address is located.

[0113] Method 2: The memory management module 210 performs an offset based on the first address to obtain a second address, and the second address and the first address are located on different channels.

[0114] The memory management module 210 may determine the channel where the first address is located according to the first address, and the memory management module 210 may determine the second address in a channel other than the channel where the first address is located in the mirror space.

[0115] The second address determined by the memory management module 210 satisfies:

[0116] Second address = first address + reference offset

[0117] The reference offset is the amount of offset from the first address. The reference offset is related to information such as the mirror space, the number of channels distributed within the mirror space, the channel number of the first address, and the amount of data written to a channel by the memory management module 210 at a time. The determination of the reference offset is flexible; different first addresses may have different reference offsets.

[0118] It should be noted that when the memory 220 is the global memory of multiple computing devices, the reference offset is also related to some or all of the multiple computing devices, such as the proportion or position of the memory of any computing device in the memory 220 composed of the memories of the multiple computing devices.

[0119] The above examples only illustrate two methods for the memory management module 210 to determine the second address. The present embodiment does not limit the method by which the memory management module 210 determines the second address. Any method for determining the second address that enables the first address and the second address to be located in different channels and to be unoccupied addresses is applicable to the present embodiment.

[0120] After determining the second address, the memory management module 210 may record the mapping relationship between the first address and the second address, so as to facilitate subsequent rapid determination of the second address based on the first address.

[0121] Through step 307, the memory management module 210 does not need to change the data in the main space, that is, it does not need to migrate the data in the main space, and only needs to write a backup of the data in the mirror space. This can simplify the memory mirroring process and ensure that memory mirroring can be implemented during the operation of the memory mirroring system.

[0122] The following describes the process of the processor 100 writing data into the memory 220 , referring to steps 308 to 311 .

[0123] Step 308: During operation, the processor 100 accesses the memory 220 and initiates a second write request to the memory system 200. The second write request is used to request writing of the second data. The second write request carries the second data to be written and a third address. The third address is a physical address.

[0124] Step 309: The memory management module 210 in the memory system 200 receives the second write request and determines that the second data needs to be backed up based on the third address included in the second write request. The third address included in the second write request received by the memory management module 210 is a physical address. The third address can indicate the channel number and offset of the channel to which the second data needs to be written.

[0125] The memory management module 210 analyzes the second write request, and if the third address carried in the second write request belongs to the primary space, the memory management module 210 determines that the second data needs to be backed up. The memory management module 210 may execute subsequent steps.

[0126] If the third address carried in the second write request does not belong to the primary space, the memory management module 210 determines that the second data does not need to be backed up. For the second data that does not need to be backed up, the memory management module 210 writes the second data to be written and carried in the second write request to the third address, completing the writing of the second data. After completing the writing of the second data, the memory management module 210 may also notify the processor 100 that the second data has been successfully written.

[0127] Step 310: The memory management module 210 determines the third address from the second write request and the fourth address of the second data's backup in the mirror space. If a mirror relationship is established between the primary space and multiple mirror spaces, the memory management module 210 determines the fourth address of the second data's backup in each mirror space based on the fourth address. The fourth address is a physical address.

[0128] By parsing the third address, the memory management module 210 can determine the channel number of the channel to which the second data needs to be written and the offset in the channel, and further determine the location of the second data in the main space.

[0129] The memory management module 210 also needs to determine that the backup of the second data is at the fourth address of the mirror space. The third address and the fourth address need to satisfy the following conditions: the third address and the fourth address are located in different channels and are unoccupied addresses.

[0130] The following method for the memory management module 210 to determine the fourth address is similar to the method for the memory management module 210 to determine the second address. For details, please refer to the above description and will not be repeated here.

[0131] After determining the fourth address, the memory management module 210 may record the mapping relationship between the third address and the fourth address, so as to facilitate subsequent rapid determination of the fourth address based on the third address.

[0132] Step 311: After determining the third and fourth addresses, the memory management module 210 writes the second data to the third address and writes a backup copy of the second data to the fourth address. For the third address, the memory management module 210 accesses the channel corresponding to the third address and stores the second data there. For the fourth address, the memory management module 210 accesses the channel corresponding to the fourth address and stores a backup copy of the second data there.

[0133] Referring to steps 312 to 315 , the process of the processor 100 reading the second data from the memory 220 will be described below.

[0134] Step 312: The processor 100 initiates a second read request to the memory system 200, where the second read request is used to request to read the second data. The second read request carries a third address of the second data to be read.

[0135] Step 313: The memory management module 210 in the memory system 200 receives the second read request, accesses the channel where the third address is located, and reads the second data.

[0136] If the memory management module 210 fails to read the second data in the channel where the third address is located, that is, reading the second data from the main space fails. The memory management module 210 can execute step 314. The memory 220 generally supports error checking and correcting (ECC). In the memory 220 that supports ECC, when an error occurs when reading the second data, it can be located and corrected in time to ultimately obtain the correct second data. If reading the second data from the main space fails, it means that an uncorrectable error (UCE) occurs at the third address, and the memory management module 210 can record the occurrence of the UCE at the third address.

[0137] If the memory management module 210 reads the second data in the channel where the third address is located, the memory management module 210 may feed back the read second data to the processor 100 .

[0138] Step 314 : When the memory management module 210 fails to read the second data from the main space, the memory management module 210 determines a fourth address.

[0139] If the memory management module 210 records the mapping relationship between the third address and the fourth address, the memory management module 210 may determine the fourth address according to the mapping relationship.

[0140] If the fourth address of the memory management module 210 is calculated based on the third address when writing the second data, the memory management module 210 can calculate the fourth address based on the third address. The manner in which the memory management module 210 calculates the fourth address based on the third address can be found in the relevant description in the aforementioned step 310 and will not be repeated here.

[0141] Step 315: After determining the fourth address, the memory management module 210 accesses the channel where the fourth address is located to read the second data.

[0142] If the memory management module 210 reads the second data from the channel at the fourth address, the memory management module 210 may feed the read second data back to the processor 100. The memory management module 210 may also write the read second data to the third address to correct the error at the third address. If the error correction is successful, the memory management module 210 records the successful error correction of the UCE at the third address. If the error correction fails, the memory management module 210 records the UCE at the third address. This may be due to a hardware failure at the third address, resulting in the correct second data being written to the third address, and the second data read again still containing errors.

[0143] If the memory management module 210 fails to read the second data in the channel where the fourth address is located, that is, fails to read the second data from the mirror space, it means that errors exist in the channels where the third address and the fourth address are located.

[0144] The memory management module 210 may interrupt the read and write operations on the third address and the fourth address, and notify the processor 100 that errors occur at the third address and the fourth address.

[0145] The memory management module 210 can also interrupt the read and write operations on the channel where the third address is located and the channel where the fourth address is located (when the memory 220 includes only two channels, the memory management module 210 interrupts the read and write operations on the memory 220 here), notifying the processor 100 that an error has occurred at the third address and the fourth address or prompting the processor 100 that an error has occurred in the memory 220.

[0146] The memory management module 210 may also interrupt the read and write operations on the memory 220 , notify the processor 100 that an error has occurred at the third address and the fourth address, or prompt the processor 100 that an error has occurred in the memory 220 .

[0147] Similarly, after memory mirroring is enabled, the processor 100 can also read the first data from the memory 220. That is, after memory mirroring is enabled, the processor 100 can initiate a read request. Here, it is still assumed that the read request initiated by the processor 100 to read the first data after memory mirroring is a first read request, and the first read request is used to request to read the first data. The first read request carries the second address of the first data to be read. After receiving the first read request, the memory management module 210 accesses the channel where the second address is located and reads the first data.

[0148] If the memory management module 210 reads the first data in the channel where the first address is located, the memory management module 210 may feed back the read first data to the processor 100 .

[0149] If the memory management module 210 fails to read the first data in the channel where the first address is located, that is, reading the first data from the main space fails. The memory management module 210 can record that the UCE occurs at the first address. The memory management module 210 determines the second address. The way the memory management module 210 determines the second address is similar to the way the memory management module 210 determines the third address. For details, please refer to the above description and will not be repeated here. The memory management module 210 accesses the channel where the second address is located and reads the first data. The read first data is fed back to the processor 100.

[0150] The memory management module 210 may also write the read first data to the first address to correct the error at the first address. If the error correction is successful, the memory management module 210 records the UCE error correction success at the first address. If the error correction fails, the memory management module 210 records the UCE error at the first address.

[0151] If the memory management module 210 fails to read the first data in the channel where the second address is located, that is, fails to read the first data from the mirror space, it means that errors exist in both the channels where the first address and the second address are located.

[0152] The memory management module 210 may interrupt the read and write operations on the first address and the second address, and notify the processor 100 that an error occurs at the first address and the second address.

[0153] The memory management module 210 may also interrupt the read and write operations on the channel where the first address is located and the channel where the second address is located, and notify the processor 100 that an error has occurred in the first address and the second address or prompt the processor 100 that an error has occurred in the memory 220 .

[0154] The memory management module 210 may also interrupt the read and write operations on the memory 220 , notify the processor 100 that an error has occurred at the first address and the second address, or prompt the processor 100 that an error has occurred in the memory 220 .

[0155] In the embodiment of the present application, in addition to processing access requests from the processor 100, the memory management module 210 as hardware can also realize data migration and realize data migration under hardware acceleration.

[0156] The data migration involved in the embodiments of the present application includes two scenarios: one is the primary space migration scenario, and the other is the data migration between the primary space and the mirror space or between the mirror spaces. The data migration methods in these two scenarios are described below.

[0157] Scenario 1: Main space migration: Main space migration refers to changing the main space, migrating the main space from its original location in the memory 220 to a new location, and changing the storage location of the main space in the memory 220 .

[0158] FIG5 shows a data migration method provided by an embodiment of the present application, wherein:

[0159] Step 501: When determining that the primary space needs to be migrated, the OS on the processor 100 determines a backup mirror space.

[0160] When the OS determines that a hardware failure occurs in the primary space or that the UCE in the primary space is uncorrectable, the OS determines that the primary space needs to be migrated.

[0161] There are many ways for the OS to determine the backup image space. Here are three of them:

[0162] The first method is that the OS can release a portion of the space in the memory 220 except the main space and the mirror space. The size of the portion of the space is the same as that of the mirror space, and the portion of the space can be used as the backup mirror space.

[0163] The second type: The processor 100 reserves a portion of space in the memory 220, which is never occupied. This portion of space can be used as the backup mirror space. This application does not limit the location of the storage space of the backup mirror space in the memory 220. This portion of space can be reserved when the processor 100 configures the main space and the mirror space, and this portion of space can be a storage space adjacent to the mirror space. The adjacency between storage spaces mentioned in the embodiments of this application refers to physical adjacency.

[0164] The third type: If the storage space adjacent to the mirror space (the size of the storage space is the same as the size of the mirror space) is occupied, the processor 100 migrates the data in the storage space adjacent to the mirror space to other storage space in the memory 220, or directly releases the storage space adjacent to the mirror space (that is, deletes the data in the storage space adjacent to the mirror space), and uses the storage space adjacent to the mirror space as a backup mirror space.

[0165] FIG6A shows a positional relationship between the backup mirror space, the mirror space, and the primary space in memory 220. As shown in FIG6A , the backup mirror space and the mirror space are adjacent storage spaces. In this case, the address range of the backup mirror space can be calculated based on the address range of the mirror space and the size of the mirror space. The starting address in the address range of the backup mirror space is equal to the starting address of the address range of the mirror space plus the size of the mirror space. The ending address in the address range of the backup mirror space is equal to the ending address of the address range of the mirror space plus the size of the mirror space.

[0166] Figure 6B shows a positional relationship among the backup mirror space, the mirror space, and the main space in the memory 220. As shown in Figure 6B, the backup mirror space is not adjacent to the mirror space.

[0167] Step 502: The OS triggers the BIOS to reconfigure the primary and mirror spaces. The BIOS configures the original mirror space as the new primary space and the backup mirror space as the new mirror space. Specifically, the BIOS reconfigures the primary and mirror spaces so that the address range of the new primary space is the same as the address range of the original mirror space, and the address range of the new mirror space is the same as the address range of the backup mirror space. A mirroring relationship is established between the new primary and mirror spaces.

[0168] The new primary space is actually the original mirror space, which has already saved a backup of the data in the original primary space. However, the new mirror space has not yet stored data, and the data in the new primary space needs to be copied to the new mirror space, that is, step 503 is executed.

[0169] Step 503: BIOS triggers the memory management module 210 to perform data migration. The memory management module 210 obtains the address range of the new primary space and the address range of the new mirror space from BIOS. The memory management module 210 migrates the data in the new primary space to the new mirror space.

[0170] During data migration, the memory management module 210 can directly perform direct memory access (DMA) on the memory 220 to achieve data migration. Data migration triggered by hardware is faster and does not require the computing power of the processor 100.

[0171] In an embodiment of the present application, the memory management module 210 may prohibit reading and writing data in the new primary space before completing the data migration operation, that is, before the memory management module 210 migrates all data in the new primary space to the new mirror space. In a specific application, after the BIOS configures the original mirror space as the new primary space and the backup mirror space as the new mirror space, the BIOS may temporarily not report the new primary space and the memory space composed of the new mirror space to the OS. After the memory management module 210 completes the data migration operation, the BIOS reports the memory space composed of the new primary space and the new mirror space to the OS. In this way, the OS obtains the memory space composed of the new primary space and the new mirror space from the BIOS, and uses the memory space as the storage space of the system. The OS can subsequently access data in the memory space during operation.

[0172] Before the memory management module 210 completes the data migration operation, that is, before the memory management module 210 migrates all the data in the new primary space to the new mirror space, it can also allow data to be read and written to the new primary space. In a specific application, after the BIOS configures the original mirror space as the new primary space and the backup mirror space as the new mirror space, the BIOS can report the new primary space and the memory 220 space composed of the new mirror space to the OS without waiting for the memory management module 210 to complete the data migration operation. Subsequently, the OS can access data to the memory 220 space composed of the new primary space and the new mirror space during operation. When the memory management module 210 performs data migration, it is necessary to ensure data consistency between the new primary space and the new mirror space. During the data migration process of the memory management module 210, if the processor 100 (such as the OS) performs a write operation on the new primary space, the memory management module 210 needs to update the written data to the new mirror space. For example, during the process of data migration by the memory management module 210, if the processor 100 (such as the OS) performs a write operation on the new primary space, the memory management module 210 can immediately update the written data to the new mirror space after sensing the write operation. For another example, during the process of data migration by the memory management module 210, if the processor 100 (such as the OS) performs a write operation on the new primary space, the memory management module 210 can record the write operation, such as recording information such as the address of the written data. After the data migration is completed, the memory management module 210 updates the data written by the write operation to the new mirror space based on the recorded write operation.

[0173] Figure 7 shows the changes in the primary and mirror spaces during the primary space migration process. For easier differentiation, the original primary and mirror spaces are named A1 and B1, while the new primary and mirror spaces are named A2 and B2. Comparing the primary space before and after the migration, you can see that mirror space B1 corresponds to primary space A2, meaning the original mirror space becomes the new primary space. You can also see that the backup mirror space before the migration corresponds to mirror space B2, meaning the backup mirror space becomes the new mirror space.

[0174] Scenario 2: Data migration between the primary space and the mirror space, or data migration between mirror spaces.

[0175] In order to ensure data consistency between the main space and the mirror space, the processor 100 can trigger the memory management module 210 to migrate data between the main space and the mirror space. For example, the processor 100 (such as the OS) can inform the memory management module 210 of the address of the data in the main space that needs to be migrated to the mirror space, and instruct the memory management module 210 to migrate the data. After receiving the instruction, the memory management module 210 can read the data according to the address of the data in the main space that needs to be migrated to the mirror space, and migrate the data to the mirror space. The address of the data in the mirror space can be found in the method for determining the second address in step 307, which will not be repeated here. For another example, the processor 100 can inform the memory management module 210 of the address of the data in the mirror space that needs to be migrated to the main space, and instruct the memory management module 210 to migrate the data. After receiving the instruction, the memory management module 210 can read the data from the main space according to the address of the data in the mirror space that needs to be migrated to the main space, and migrate the data to the main space. The address of the data in the main space can be determined based on the mapping relationship between the addresses of the main space and the mirror space (such as the mapping relationship between the first address and the second address mentioned above), or it can be calculated based on the address of the data in the mirror space that needs to be migrated to the main space (such as using the opposite method of calculating the second address based on the first address mentioned above).

[0176] When there are multiple mirror spaces, if an error occurs in the data in one of the mirror spaces, the processor 100 can trigger the memory management module 210 to migrate data between the mirror spaces. The way the memory management module 210 migrates data between the mirror spaces is similar to the way the memory management module 210 migrates data between the main space and the mirror space mentioned above, and will not be repeated here. When the processor 100 needs to add a mirror space to the main space, the processor 100 can trigger the memory management module 210 to migrate data between the existing mirror space and the newly added mirror space. The way the memory management module 210 migrates data between the existing mirror space and the newly added mirror space is similar to the way the memory management module 210 migrates data between the main space and the mirror space mentioned above, and will not be repeated here.

[0177] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0178] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or box in the flow chart and / or block diagram, as well as the combination of the flow chart and / or box in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more flow charts and / or one or more boxes in the block diagram.

[0179] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0181] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.

Claims

1. A memory mirroring method, It is characterized in that The method comprises: After the processor writes the first data into the main space of the memory through the memory management module, the mirror space is configured for the main space, and the main space and the mirror space are both distributed in multiple channels of the memory; The memory management module writes a backup of the first data into the mirror space, and the position of the first data in the main space remains unchanged.

2. The method according to claim 1, It is characterized in that The memory management module writes the backup of the first data into the mirror space, including: The memory management module determines a second address of a backup of the first data in the mirror space according to a first address of the first data in the main space, wherein the first address and the second address are located in different channels; The memory management module writes a backup of the first data to the second address.

3. The method according to claim 2, It is characterized in that The second address is determined based on the first address and a reference offset, and the reference offset is determined based on part or all of the following: The mirror space, the number of channels distributed in the mirror space, the channel number where the first address is located, and the amount of data written to a channel each time.

4. The method according to claim 2, It is characterized in that The second address includes a starting address and an offset of an unoccupied space in the mirror space, and the offset is equal to a length of the second data.

5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The memory management module receives a write request from the processor, where the write request is used to request writing the second data at a third address in the main space; The memory management module determines a fourth address according to the third address, the third address and the fourth address are located in different channels, and the fourth address is located in an unoccupied space in the mirror space; The memory management module writes the second data to the third address, and writes a backup of the second data to the fourth address.

6. The method according to any one of claims 1 to 5, It is characterized in that The method further comprises: The memory management module receives a read request from the processor, where the read request is used to request to read the first data from the first address; When the memory management module fails to read the first data from the main space according to the first address, the memory management module reads a backup of the first data from the mirror space according to the second address.

7. The method according to claim 6, It is characterized in that The method further comprises: The memory management module writes a backup of the first data to the first address.

8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: The processor determines a backup mirror space in the memory when an uncorrectable error (UCE) occurs in the main space, wherein the backup mirror space is distributed in a plurality of channels of the memory; The processor releases the primary space, configures the mirror space as a new primary space, and configures the backup mirror space as a new mirror space; The memory management module migrates the data of the new primary space to the new mirror space.

9. The method according to claim 8, It is characterized in that The backup mirror space is adjacent to the mirror space.

10. The method according to any one of claims 1 to 9, It is characterized in that The method further comprises: The memory management module writes the next data that needs to be written into the main space after the first data into a channel different from the channel where the first address is located.

11. The method according to any one of claims 1 to 10, It is characterized in that The memory is distributed on multiple computing devices, and the backup of the first data and the first data are located on different computing devices.

12. A memory mirroring system, It is characterized in that The system comprises: A processor, configured to configure a mirror space for the main space after writing first data to the main space of the memory through the memory management module, wherein the main space and the mirror space are both distributed in multiple channels of the memory; The memory management module is used to write the backup of the first data into the mirror space, and the position of the first data in the main space remains unchanged.

13. The system of claim 12, It is characterized in that The memory management module writes the backup of the first data into the mirror space, for: Determine, according to a first address of the first data in the primary space, a second address of a backup of the first data in the mirror space, wherein the first address and the second address are located in different channels; A backup of the first data is written to the second address.

14. The system of claim 13, It is characterized in that The second address is determined based on the first address and a reference offset, and the reference offset is determined based on part or all of the following: The mirror space, the number of channels distributed in the mirror space, the channel number where the first address is located, and the amount of data written to a channel each time.

15. The system of claim 13, It is characterized in that The second address includes a starting address and an offset of an unoccupied space in the mirror space, and the offset is equal to a length of the second data.

16. The system according to any one of claims 12 to 15, It is characterized in that The memory management module is further used for: receiving a write request from the processor, the write request being used to request writing the second data at a third address in the main space; Determine a fourth address according to the third address, the third address and the fourth address are located in different channels, and the fourth address is located in an unoccupied space in the mirror space; The second data is written to the third address, and a backup copy of the second data is written to the fourth address.

17. The system according to any one of claims 12 to 16, It is characterized in that The memory management module is further used for: receiving a read request from the processor, the read request being used to request reading the first data from the first address; In the case where reading the first data from the primary space according to the first address fails, a backup of the first data is read from the mirror space according to the second address.

18. The system of claim 17, It is characterized in that The memory management module is further used for: A backup copy of the first data is written to the first address.

19. The system according to any one of claims 12 to 18, It is characterized in that The processor is further configured to: determine a backup mirror space in the memory when an uncorrectable error (UCE) occurs in the primary space, wherein the backup mirror space is distributed in a plurality of channels of the memory; Release the primary space, configure the mirror space as a new primary space, and configure the backup mirror space as a new mirror space; The memory management module is further used to migrate the data of the new primary space to the new mirror space.

20. The system of claim 19, It is characterized in that The backup mirror space is adjacent to the mirror space.

21. The system according to any one of claims 12 to 20, It is characterized in that The memory management module is further used for: The next data to be written into the main space after the first data is written into a channel different from the channel where the first address is located.

22. The system according to any one of claims 12 to 21, It is characterized in that The memory is distributed on multiple computing devices, and the backup of the first data and the first data are located on different computing devices.

23. A computing device cluster, It is characterized in that The computing device cluster includes at least one computing device, and the computing device includes a processor, a memory, and a memory management module; The processor and memory management module of the at least one computing device cooperate to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Method and device for configuring mirror image memory and computer storage medium

    CN110262893A

  • Method and device for configuring mirror image memory and computer storage medium

    CN113868151A

  • Execution method of memory read-write instruction and computing device

    CN115080223A