Memory page migration method, CXL memory extension device and computing device

The CXL memory expansion device performs cold page migration instead of CPU, which solves the system performance problems caused by CPU resource occupation in the prior art, and realizes the optimization and performance improvement of memory resources.

CN120336205APending Publication Date: 2025-07-18XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510242026.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, memory migration schemes consume CPU resources of computing devices and affect system performance.

Method used

The CXL memory expansion device uses CXL.io and CXL.cache protocols to perform cold page migration instead of the CPU, and migrates cold pages with access to the computing device's memory that meets the preset conditions to the CXL extended memory to free up CPU resources.

Benefits of technology

Optimize the use of memory resources, improve system performance, reduce system costs, and improve the overall performance of computing devices through automated management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336205A_ABST
    Figure CN120336205A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a memory page migration method, a CXL memory extension device and a computing device. The method is applied to a CXL memory extension device. The method comprises the following steps: receiving a first migration instruction of computing equipment based on a CXL.io protocol; the first migration instruction is used for indicating to migrate the first target memory page to the CXL extended memory; wherein the first target memory page is a cold page of which the access popularity meets a preset condition in the memory of the computing device; the CXL extended memory is a memory in a CXL extended memory device; and in response to the first migration instruction, migrating the first data in the first target memory page to the CXL extended memory based on a CXL.cache protocol. According to the method, CPU resources can be released, and the computing performance of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of servers, and in particular, to a memory page migration method, a CXL memory expansion device, and a computing device. Background Art

[0002] Compute Express Link (CXL) is a bus architecture based on an industry standard protocol, which is used to expand the memory of a computing device to improve the memory bandwidth and capacity of the computing device. Due to certain delays in the CXL protocol and the link itself, there is memory with different access delays in the computing device after CXL expansion.

[0003] During the operation of the computing device, in order to ensure the operation performance of the computing device, the central processing unit (CPU) will perform memory page migration, migrating cold data (data that is not frequently used) from low-latency memory to high-latency memory, or migrating hot data (data that is frequently used) from high-latency memory to low-latency memory. However, the current memory migration scheme consumes the CPU resources of the computing device and affects the system performance. Summary of the Invention

[0004] The embodiments of the present application provide a memory page migration method, a CXL memory expansion device, and a computing device, which can release CPU resources and improve system performance.

[0005] In a first aspect, the embodiments of the present application provide a memory page migration method, which is applied to a CXL memory expansion device. The method includes: receiving a first migration instruction of a computing device based on the CXL.io protocol; the first migration instruction is used to indicate migrating a first target memory page to the CXL extended memory; wherein, the first target memory page is a cold page in the memory of the computing device whose access heat meets a preset condition; the CXL extended memory is the memory in the CXL memory expansion device; in response to the first migration instruction, migrating first data in the first target memory page to the CXL extended memory based on the CXL.cache protocol.

[0006] After receiving the first migration instruction of the computing device based on the CXL.io protocol, the memory page migration method provided by the embodiments of the present application can, in response to the first migration instruction, migrate the first data in the first target memory to the CXL extended memory based on the CXL.cache protocol. Through the above process, the CXL memory expansion device is enabled to replace the CPU to execute the cold page migration process, thereby being able to release CPU resources and improve the computing performance of the system.

[0007] In a possible implementation, the first migration instruction includes the number of cold pages to be migrated and the source address; before migrating the first data in the first target memory page to the CXL extended memory based on the CXL.cache protocol, the method further includes: determining a target free page from the CXL extended memory; where the target free page is a free memory page in the CXL extended memory, and the number of target free pages is the same as the number of cold pages to be migrated. It can be understood that migration is performed when there are the same number of target free pages to ensure that the migration can be completed accurately.

[0008] In another possible implementation, migrating the first data to the CXL extended memory based on the CXL.cache protocol includes: obtaining the first data from the memory of the computing device based on the CXL.cache protocol, the number of cold pages to be migrated, and the source address; storing the first data into the target free page based on the target address and the number of target free pages; where the target address is the start address of the target free page. It can be understood that a specific implementation of the migration is provided to improve the feasibility of this solution.

[0009] In yet another possible implementation, the method further includes: sending a first message to the computing device based on the CXL.io protocol; the first message is used to indicate that the migration of the first data is completed; the first message includes the target address, and the target address is used by the computing device to update the page table. It can be understood that by informing the computing device of the location of the first data in the CXL extended memory, the computing device updates the page table to record the new storage location of the first data. If the computing device subsequently needs to access the first data, it can accurately access and obtain the first data based on the destination address, avoiding data loss.

[0010] In a second aspect, the present application provides a memory page migration method applied to a computing device. The method includes: determining a first target memory page from the memory; where the first target memory page is a cold page in the memory of the computing device whose access heat meets a preset condition; sending a first migration instruction to the CXL memory expansion device of the link based on the CXL.io protocol; the first migration instruction is used to indicate migrating the first target memory page to the CXL extended memory; the CXL extended memory is the memory in the CXL memory expansion device.

[0011] In a possible implementation, the method further includes: receiving a first message sent by the CXL memory expansion device based on the CXL.io protocol; the first message is used to indicate that the migration of the first data in the first target memory page is completed; in response to the first message, updating the first target memory page to an idle state. It can be understood that the state of the first target memory page is updated to an idle state in the page table, so that the computing device can store new running data into the first target memory page subsequently, making full use of the low-latency memory of the computing device during operation, thereby improving the operation performance of the computing device.

[0012] In another possible implementation, the first message includes a target address; the target address is used to indicate the starting address of the first data in the CXL memory expansion device; the method further includes: updating the storage address of the first data in the page table to the target address. It can be understood that through this step, the computing device can update the storage location of the first data after migration in the page, facilitating the computing device to accurately query the physical location of the first data from the page table when there is a subsequent need to access the first data, and avoiding data loss.

[0013] In yet another possible implementation, determining a first target memory page from the memory includes: determining the first target memory page from the memory when the usage rate of the memory pages in the memory exceeds a preset threshold. It can be understood that when the available space in the local memory is insufficient, data migration is performed to expand the available space of the local memory to ensure the stable operation of the computing device.

[0014] In yet another possible implementation, the method further includes: the first migration instruction includes the number of cold pages to be migrated and a source address; wherein, the source address is the starting address of the second target page.

[0015] In yet another possible implementation, the method further includes: obtaining an access request; wherein, the access request is used to indicate obtaining data from the memory or the CXL memory expansion device; the data is stored in the second target memory page; determining whether the second target memory page belongs to the memory or the CXL memory expansion device; when the second target memory page belongs to the CXL memory expansion device, in response to completing the access to the second target memory page, determining whether there is an idle page in the memory; when there is an idle page in the memory, migrating the access data to the idle page based on the CXL.mem protocol. It can be understood that the computing device can store new access data in the local first target memory page, realizing the full utilization of the low-latency memory of the computing device during operation, thereby improving the operation performance of the computing device.

[0016] In a third aspect, an embodiment of the present application provides a memory page migration device, and the memory page migration device is used to execute the memory page migration method provided in the first aspect above.

[0017] In a fourth aspect, an embodiment of the present application provides a memory page migration device, and the memory page migration device is used to execute the memory page migration method provided in the second aspect above.

[0018] In a fifth aspect, an embodiment of the present application provides a CXL memory expansion device, the CXL memory expansion device includes a first chip and a memory; the first chip is coupled to the memory; the memory is used to store computer instructions; the computer instructions are loaded and executed by the first chip so that the CXL memory expansion device implements the method in the first aspect above.

[0019] In a sixth aspect, an embodiment of the present application provides a computing device, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the method of the second aspect described above.

[0020] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions run on a computing device, the computing device is enabled to implement the method of the second aspect described above.

[0021] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when running on a computing device, enables the computing device to execute the steps of the related method described in the second aspect to implement the method of the second aspect.

[0022] For the beneficial effects of the third to eighth aspects described above, reference may be made to the corresponding descriptions of the first or second aspect, and details will not be repeated here. Description of the Drawings

[0023] Figure 1 It is a schematic diagram of memory page migration provided by an embodiment of the present application;

[0024] Figure 2 It is a schematic diagram of the data path for a CPU to migrate cold pages provided by an embodiment of the present application;

[0025] Figure 3 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0026] Figure 4 It is a schematic flowchart of a memory page migration method provided by an embodiment of the present application;

[0027] Figure 5 It is a schematic flowchart of a memory page migration method provided by an embodiment of the present application;

[0028] Figure 6 It is a schematic flowchart of another memory page migration method provided by an embodiment of the present application;

[0029] Figure 7 It is a schematic flowchart of yet another memory page migration method provided by an embodiment of the present application;

[0030] Figure 8 It is a schematic flowchart of yet another memory page migration method provided by an embodiment of the present application;

[0031] Figure 9 It is a schematic flowchart of yet another memory page migration method provided by an embodiment of the present application;

[0032] Figure 10 A schematic diagram of the process of hot page migration provided by an embodiment of the present application;

[0033] Figure 11 A schematic diagram of the process of cold page migration provided by an embodiment of the present application;

[0034] Figure 12 Another schematic diagram of the process of hot page migration provided by an embodiment of the present application;

[0035] Figure 13 A schematic diagram of a complete process provided by an embodiment of the present application;

[0036] Figure 14 A schematic diagram of a memory page migration device provided by an embodiment of the present application;

[0037] Figure 15 Another schematic diagram of a memory page migration device provided by an embodiment of the present application. Detailed implementation manners

[0038] 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.

[0039] It should be noted that in the embodiments of the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplarily" or "for example" aims to present relevant concepts in a specific manner.

[0040] In order to facilitate the clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using words such as "first" and "second". Those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order.

[0041] Next, a brief description will be given to the professional terms involved in the embodiments of the present application:

[0042] 1. Compute Express Link (CXL): is a bus architecture based on industry standard protocols that is used to expand the memory of computing devices to increase the memory bandwidth and capacity of computing devices and enable the central processing unit (CPU) to access the expanded memory faster.

[0043] 2. Memory page: It is a fixed-length block in memory and is the basic unit for memory management by the operating system in a computing device. The size of a memory page in a computing device is fixed.

[0044] 3. Cold page / hot page: In memory management, frequently accessed memory pages are called hot pages, and less frequently accessed memory pages are called cold pages. Data stored in cold pages can be called cold data, and data stored in hot pages can be called hot data. In the embodiment of the present application, the so-called cold page migration is to migrate cold data to other locations, and the so-called hot page migration is to migrate hot data to other locations.

[0045] 4. Page table: The page table is a data structure used by the operating system of a computing device to manage the address mapping from virtual memory to physical memory. Virtual memory is an abstract memory address accessed by the program when it is running. Physical memory is actual, corresponding to the memory address of the hardware memory, and is also the actual storage location of the data used by the program. The program initiates a request through virtual memory, and the operating system converts the address of the virtual memory into the address of the physical memory (physical address) based on the page table, and then obtains the data required for the program to run based on the physical address. When the corresponding data in a virtual memory moves from one physical location to another, the computing device needs to update the page table to reflect this change in address mapping.

[0046] In traditional computer architecture, the CPU and memory in a computing device are connected through a bus, and the CPU can access data in the memory through the bus. However, due to the high cost of memory in computing devices, the available memory space is limited, and the bandwidth and speed of the bus will limit the data access speed of the CPU. This problem of the CPU being limited by memory space and bandwidth is called the "memory wall problem."

[0047] Currently, CXL technology is used to increase the available memory capacity of computing devices by introducing CXL extended memory. However, due to the certain delay of the CXL protocol and the link itself, CXL extended memory will introduce additional delay when used, which will affect the performance of computing devices accessing data. Figure 1As shown, the CPU in the computing device is connected to the memory, and the CPU is also connected to the core processing chip (also called CXL application specific integrated circuit (ASIC) chip) in the CXL memory expansion device through CXL technology to access the CXL extended memory of the CXL memory expansion device based on CXL technology. The memory of the computing device is closer to the CPU and is a low-latency memory. The CXL extended memory is farther away from the CPU and is a high-latency memory. In response to the latency problem, hot and cold data can currently be migrated based on the heat information of the memory page (also known as memory tiering technology) to ensure that hot data is as much as possible in low-latency memory (such as the memory of the computing device) and cold data is as much as possible in high-latency memory (such as extended memory connected based on CXL technology). Through CXL technology and data migration technology, the "memory wall problem" is alleviated to a certain extent. In the embodiment of the present application, for ease of distinction, the memory directly connected to the CPU in the computing device is referred to as local memory.

[0048] Taking cold page migration as an example, combined with Figure 2 Provide explanation. Figure 2 A data path diagram of a CPU migration cold page provided for related technologies, such as Figure 2 As shown, when there are cold pages to be migrated in the local memory, the CPU needs to read the cold data from the cold pages in the local memory into its own cache, and then migrate the cold data in the cache to the CXL extended memory. The above cold page migration process can also be called page demotion.

[0049] The inventors have discovered that the above-mentioned memory page migration solution, especially for cold page migration, requires the CPU to migrate data in the local memory to the CXL extended memory with a greater latency, which occupies CPU resources and affects system performance.

[0050] Based on this, an embodiment of the present application provides a memory page migration method, which uses a CXL memory expansion device instead of a CPU to execute a cold page migration process, thereby alleviating CPU resource occupancy, releasing CPU resources, and improving system performance.

[0051] In some embodiments, after receiving the first migration instruction of the computing device based on the CXL.io protocol, the CXL memory expansion device can respond to the first migration instruction and migrate the first data in the first target memory to the CXL extended memory based on the CXL.cache protocol. Through the above process, the CXL memory expansion device replaces the CPU to perform the cold page migration process, releases CPU resources, and improves the computing performance of the system.

[0052] It should be noted that the memory page migration method provided in the embodiments of this application can be applied to various operating systems, such as the Linux operating system, the Windows operating system, etc.

[0053] Figure 3 FIG. shows a schematic diagram of an application scenario provided by the embodiments of this application. As Figure 3 shown, it includes a computing device and a CXL memory expansion device. The CXL memory expansion device is connected to the computing device through the peripheral component interconnect express (PCIe) / CXL.

[0054] Among them, the computing device includes a CPU and a memory. Among them, the CPU includes three parts, namely a local memory controller, a core, and a first CXL interface / port. The local memory controller is connected to the memory of the computing device and is used to manage the memory. The memory is also called the internal memory and the main memory, and is used to temporarily store the operation data of the CPU. The memory type of the computing device can be volatile dynamic random access memory (DRAM) particles, such as double data rate fourth generation synchronous dynamic random access memory (DDR4), DDR5, etc. The core is the most important part of the CPU, and the computing function, receiving storage commands, processing data, etc. of the CPU are all executed by the core. The first CXL interface follows the CXL protocol and is used to connect to the CXL memory expansion device outside the computing device through a physical link.

[0055] Among them, the CXL memory expansion device includes three parts, namely a second CXL interface / port, a core processing chip (CXL ASIC chip), and a CXL extended memory. The core processing chip is a key component in the memory expansion device and is responsible for realizing the memory sharing and high-speed interconnection between the CPU in the computing device and the CXL memory expansion device.

[0056] Among them, the core processing chip follows two sub-protocols included in the CXL protocol, namely CXL.io and CXL.mem. CXL.io is mainly used for initialization, register access, interrupt processing, and memory-mapped I / O transactions, etc., and is a key link to realize efficient communication between the CPU and the memory expansion device. CXL.mem allows the CPU of the computing device to access the CXL extended memory in the CXL memory expansion device in the way of memory commands (memory semantics).

[0057] The second CXL interface, which follows the CXL protocol, is used to connect the CXL memory expansion device to the CPU through a physical link.

[0058] CXL extended memory, which is a storage module in the CXL memory expansion device for storing data. The storage type can be volatile DRAM particles, such as DDR4, DDR5, etc. It can also be persistent NAND particles, storage class memory (SCM) storage media, etc.

[0059] The above CXL protocol includes three sub - protocols, namely CXL.io, CXL.cache, and CXL.mem. Among them, CXL.io is used to achieve efficient communication between the core processing chip and the CPU. CXL.cache is mainly used to make the core processing chip conform to the cache coherence protocol (a mechanism to ensure data consistency and synchronization in different caches in a multi - core processing system) and access the local memory in the computing device. CXL.mem allows the CPU of the computing device to access the CXL extended memory in the way of load and store commands (such as memory semantics).

[0060] In the embodiment of the present application, the CXL memory expansion device is used to execute the memory page migration method. Specifically, the core processing chip in the memory expansion device executes the memory page migration method, that is, a data migration engine (software module) is deployed on the core processing chip to be responsible for the data migration function to save hardware costs. That is, in the embodiment of the present application, the core processing chip mainly includes two characteristic functions: CXL protocol processing and data migration. Among them, data migration includes three processes: receiving a data migration task, executing a data migration task, and reporting the completion of the data migration task.

[0061] In another implementation, a first chip is independently deployed in the CXL memory expansion device, and the first chip and the core processing chip cooperate with each other to execute the memory page migration method.

[0062] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0063] Figure 4 It is a flow diagram of a memory page migration method provided by an embodiment of the present application. Exemplarily, the memory page migration method provided by the embodiments of the present application can be applied to a CXL memory expansion device, specifically, it can be applied to the core processing chip of the CXL memory expansion device.

[0064] As shown Figure 4 below, the memory page migration method provided by the embodiment of the present application may include the following steps:

[0065] S401. The CXL memory expansion device receives a first migration instruction from the computing device based on the CXL.io protocol.

[0066] Wherein, the first migration instruction is used to indicate migrating a first target memory page to the CXL extended memory; wherein, the first target memory page is a cold page in the computing device memory whose access heat meets a preset condition.

[0067] Wherein, the access heat meeting the preset condition means that the memory page is accessed less frequently than a preset threshold.

[0068] As mentioned above, the CXL.io protocol is a protocol for communication between the computing device and the CXL memory expansion device. The CXL memory expansion device can obtain a migration instruction from the computing device based on the CXL.io protocol to initiate a data migration task.

[0069] S402. In response to the first migration instruction, the CXL memory expansion device migrates the first data in the first target memory page to the CXL extended memory based on the CXL.cache protocol.

[0070] In the embodiment of the present application, the CXL memory expansion device obtains the first data from the cold page based on the source address of the cold page in the first migration instruction and migrates it to the CXL extended memory according to the CXL.cache protocol.

[0071] In a possible implementation manner, before migrating the first data in the first target memory page to the CXL extended memory based on the CXL.cache protocol, the method further includes:

[0072] S400. Determine a target free page from the CXL extended memory. Wherein, the target free page is a free memory page in the CXL extended memory, and the number of target free pages is the same as the number of cold pages to be migrated.

[0073] That is to say, the CXL memory expansion device determines the same number of target free pages from the CXL extended memory according to the number of cold pages indicated in the first migration instruction, and then migrates the obtained first data to the target free pages. It can be understood that migrating in the presence of the same number of target free pages ensures that there is enough space in the CXL extended memory to accommodate the migrated data and ensures that the migration can be completed accurately.

[0074] In a possible implementation manner, the above S402 can be implemented as:

[0075] S4021. Obtain the first data from the memory of the computing device based on the CXL.cache protocol, the number of cold pages to be migrated, and the source address.

[0076] Among them, when the number of cold pages is multiple and the multiple cold pages are consecutive, the above source address is the start address of the cold page, or the initial address. If the multiple cold pages are not consecutive, the above source address is the start address of each cold page. The CXL memory expansion device can obtain the first data from each cold page in sequence according to the source address.

[0077] S4022. Store the first data into the target free pages based on the target address and the number of target free pages.

[0078] Among them, the target address is the start address of the target free page.

[0079] Among them, when there are multiple target free pages and the target free pages are consecutive, the above target address is the start address of the target free page; when the target free pages are not consecutive, the target address is the start address of each target free page. The CXL memory expansion device can access the target free pages according to the target address and store the obtained first data into the target free pages in sequence.

[0080] Taking the core processing chip executing the above S402 as an example for illustration.

[0081] In a possible implementation manner, the first migration instruction comes from the computing device, and the first migration instruction indicates the source address and the number of cold pages. The above S402 can be implemented as the following steps b1 - b3: b1. Determine the target free pages in the CXL extended memory, and the number of target free pages matches the number of cold pages. b2. Obtain the first data in the cold pages from the memory of the computing device according to the source address. b3. Store the first data into the target free pages.

[0082] It should be understood that the core processing chip not only supports the CXL.io and CXL.mem protocols, but also supports the CXL.cache protocol, so that the core processing chip can obtain data from the memory of the computing device. That is to say, based on the Type3 memory expansion device (supporting two CXL sub - protocols) in this application embodiment, the original core processing chip in the Type3 memory expansion device is added with the function of memory page migration (data migration engine) to obtain the Type2 memory expansion device (supporting three CXL sub - protocols).

[0083] In the case where a computing device needs to perform cold page migration, the CPU of the computing device may send a first migration instruction to the core processing chip. The core processing chip may allocate the same number of target free pages as the cold pages from the CXL extended memory according to the number of cold pages indicated by the first migration instruction. Further, the core processing chip obtains the first data from the cold pages based on the CXL.cache protocol according to the source address indicated by the first migration instruction, and copies the first data to the predetermined target free pages. Continue the process of obtaining and copying data until all cold page migrations are completed.

[0084] Taking the above S402 executed by the independently set first chip as an example for illustration.

[0085] In a possible implementation, the core processing chip receives the first migration instruction of the computing device through CXL.io. The first migration instruction determines the target free pages from the CXL extended memory, and then sends the source address of the cold pages and the address of the target free pages to the first chip.

[0086] The above S402 can be implemented as the following steps a1-a2: a1. The first chip obtains the first data in the cold pages from the memory of the computing device according to the source address. a2. Store the first data in the target free pages in the CXL extended memory.

[0087] It should be understood that taking the example where both the first chip and the core processing chip can be independently deployed in the memory expansion device. Among them, the first chip supports the CXL.cache protocol, and the core processing chip supports the CXL.io and CXL.mem protocols. The first chip can obtain data from the local memory of the connected computing device based on the CXL.cache protocol.

[0088] That is to say, in the case where a computing device needs to perform cold page migration, the CPU of the computing device may send a first migration instruction to the core processing chip. The first migration instruction includes the source address of the cold pages to be migrated and the number of cold pages to be migrated. Further, the second chip allocates the same number of target free pages as the cold pages from the CXL extended memory according to the first migration instruction (the core processing chip has the function of managing the CXL extended memory), and sends the target address of the target free pages and the first migration instruction to the first chip together. Finally, the first chip can obtain the first data from the cold pages based on the CXL.cache protocol according to the source address of the cold pages indicated in the first migration instruction, and then copy the first data to the target free pages according to the target address of the target free pages. Continue the process of obtaining and copying data until all cold page migrations are completed.

[0089] In a possible implementation, such as Figure 5As shown, after S402, the memory page migration method provided by the embodiments of the present application further includes:

[0090] S403. The CXL memory expansion device sends a first message to the computing device based on the CXL.io protocol.

[0091] Wherein, the first message is used to indicate that the first data migration is completed. The first message includes a target address, and the target address is used for the computing device to update the page table.

[0092] It can be understood that by informing the computing device of the location of the first data in the CXL extended memory, the computing device can update the page table to record the new storage location of the first data. If the computing device subsequently needs to access the first data, it can accurately access and obtain the first data based on the destination address, avoiding data loss.

[0093] The completion of the first data migration here includes: the reading of the first data in the cold page is completed; or, the first data in the cold page is stored in the CXL extended memory.

[0094] Exemplarily, taking the CXL memory expansion device including a core processing chip as an example, after the migration is completed, the core processing chip can send a message (the first message) indicating the completion of the migration to the computing device based on the CXL.io protocol to trigger the computing device to update the page table.

[0095] Another example is that taking the CXL memory expansion device including a first chip and a core processing chip as an example, after the migration is completed, the first chip can send an instruction to the core processing chip to inform the completion of the migration. Furthermore, the core processing chip sends a first message to the computing device based on the CXL.io protocol to trigger the computing device to update the page table.

[0096] In some embodiments, the above first migration instruction may indicate the migration of multiple cold pages. In this case, S403 can be implemented as: after the data in each cold page is migrated, a message indicating the completion of the cold page migration is sent to the computing device. Or, when the migration of all cold pages is completed, a message indicating the completion of the data migration is sent to the computing device. That is to say, when multiple cold pages need to be migrated in batches, the CXL memory expansion device can report the information indicating the completion of the migration once after each cold page migration is completed, or report the information indicating the completion of the migration after all cold pages are migrated.

[0097] The above embodiments are described by taking the CXL memory expansion device migrating cold pages as an example. In some scenarios, the CXL memory expansion device can also migrate hot pages. As Figure 6 shown, the memory page migration method provided by the embodiments of the present application further includes:

[0098] S601. The CXL memory expansion device receives a second migration instruction from the computing device based on the CXL.io protocol.

[0099] Among them, the second migration instruction indicates to migrate the hot pages in the CXL extended memory whose heat meets the migration conditions.

[0100] S602. In response to the second migration instruction, migrate the third data in the hot page to the computing device memory based on the CXL.cache protocol.

[0101] Exemplarily, the second migration instruction may include the source address of the hot page and the target free page in the memory of the computing device. The CXL memory expansion device can obtain the third data of the hot page from the CXL extended memory based on the source address of the hot page, and store the third data in the hot page into the local memory of the computing device, so as to realize the migration of hot data from the low-latency memory to the high-latency memory, so that the CPU can quickly access the hot data, thereby improving the performance of the computing device.

[0102] It should be noted that the specific logic of hot page migration is similar to that of cold page migration. For the specific process, reference can be made to the description of the aforementioned cold page migration, which will not be repeated here.

[0103] It should be noted that since the hot page is placed in the high-speed local memory, the data access speed can be improved, thereby enhancing the overall performance of the computing device.

[0104] Figure 7 It is a schematic flow diagram of a memory page migration method provided by an embodiment of the present application. Exemplarily, the memory page migration method provided by an embodiment of the present application can be applied to a computing device, specifically to the CPU of the computing device.

[0105] As Figure 7 shown, the memory page migration method provided by an embodiment of the present application may include the following steps:

[0106] S701. The computing device determines a first target memory page from the memory.

[0107] Among them, the first target memory page is a cold page in the computing device memory whose access heat meets the preset conditions.

[0108] In the embodiment of the present application, the computing device maintains a page table, and the access frequency information of each memory page is counted in the page table. The computing device can filter out the memory pages in the local memory whose access frequency is less than the frequency threshold as the first target memory page according to the access frequency information.

[0109] In a possible implementation, when the usage rate of a memory page in the memory of a computing device exceeds a preset threshold, a first target memory page is determined from the memory. Thus, data migration is performed when the available space in the local memory is insufficient, expanding the available space of the local memory and ensuring the stable operation of the computing device.

[0110] S702. The computing device sends a first migration instruction to the CXL memory expansion device based on the CXL.io protocol.

[0111] Wherein, the first migration instruction is used to indicate migrating the first target memory page to the CXL extended memory; the CXL extended memory is the memory in the CXL memory expansion device.

[0112] The computing device sends a first migration instruction to the CXL memory expansion device through CXL.io to trigger the CXL memory expansion device to migrate the first target memory page to the CXL extended memory, that is, to cause the CXL memory expansion device to execute the above S401 - S402.

[0113] In a possible implementation, the first migration instruction includes the number of cold pages to be migrated and the source address. Wherein, the source address is the starting address of the first target memory page.

[0114] As Figure 8 shown, after S702, the memory page migration method provided by the embodiments of the present application further includes:

[0115] S703. The computing device receives a first message sent by the CXL memory expansion device based on the CXL.io protocol.

[0116] Wherein, the first message is used to indicate that the migration of the first data in the first target memory page is completed.

[0117] In some embodiments, the above S703 can be implemented as: after the data in each cold page is migrated, receiving a first message sent by the CXL memory expansion device for indicating that the data migration is completed; or, when the migration of all cold pages is completed, receiving a first message sent by the CXL memory expansion device for indicating that the data migration is completed.

[0118] S704. In response to the first message, the computing device updates the first target memory page to the idle state.

[0119] After receiving the message, the computing device determines that the migration of the first data in the first target memory page is completed, and can update the status of the first target memory page to the idle state in the page table, so that the computing device can store access data in the first target memory page subsequently, realizing the full utilization of the low-latency memory of the computing device during operation, and thus improving the operation performance of the computing device.

[0120] In a possible implementation, the above first message further includes a target address, which is used to indicate the starting address of the first data in the CXL memory expansion device. The memory page migration method provided by the embodiments of the present application further includes:

[0121] S705. The computing device updates the storage address of the first data in the page table to the target address.

[0122] Through the above process, the computing device can update the storage location of the first data after migration in the page, which is convenient for the computing device to accurately query the physical location of the first data from the page table when there is a subsequent need to access the first data, and avoid data loss.

[0123] It should be noted that the above process is described by taking the cold page migration process as an example. In a possible implementation, the computing device can also perform hot page migration. As Figure 9 shown, it includes the following:

[0124] S901. Obtain an access request. The access request is used to indicate obtaining data from the memory or the CXL memory expansion device. The data is stored in the second target memory page.

[0125] The computing device can obtain the access request from a locally running application program. Or, the access request can be obtained from other devices in the cloud.

[0126] S902. Determine whether the second target memory page belongs to the memory or the CXL memory expansion device.

[0127] The computing device can determine the location of the second target memory page according to the page, whether it is in the computing device memory or in the CXL memory expansion device.

[0128] S903. When the second target memory page belongs to the CXL memory expansion device, in response to completing the access to the second target memory page, determine whether there is a free page in the memory.

[0129] When the computing device responds to the access to the second target memory page, it indicates that the second target memory page is a hot page at this time, and the access data in the second target memory page can be migrated to the computing device memory. Therefore, the computing device can determine whether there is a free page in the current memory to determine whether there is enough memory space to store the hot page data.

[0130] S904. When there is a free page in the memory, migrate the access data to the free page based on the CXL.mem protocol.

[0131] When the computing device determines that there are idle pages locally, it can obtain access data from the CXL extended memory based on the CXL.mem protocol and store it in the local idle pages. Accordingly, the storage location of the access data can be updated in the page to complete the data hot migration process.

[0132] As Figure 10 shown, when the computing device needs to access a certain memory page and determines that the memory page is located in the CXL extended memory, it can check whether there are idle pages in the memory of the computing device. If there are, the computing device obtains the data of the hot page through the CXL memory expansion device and migrates the data of the hot page to the memory of the computing device.

[0133] Through the above hot page migration method, the frequently accessed hot pages can be migrated from the CXL extended memory to the faster local memory, thereby improving the data access speed of the computing device and optimizing the performance of the computing device. At the same time, since the migration operation is only performed when there are idle pages in the local memory, unnecessary data transfer and resource waste are also avoided.

[0134] Figure 11 It is a schematic diagram of the cold page migration process provided by an embodiment of the present application. As Figure 11 shown, when the usage rate of the local memory exceeds the trigger threshold, the CPU can determine the cold pages in the local memory based on the heat and send the first migration instruction to the core processing chip. Furthermore, the core processing chip can obtain the first data in the cold pages from the local memory based on the first migration instruction and store it in the CXL extended memory.

[0135] Figure 12 It is a schematic diagram of the hot page migration process provided by an embodiment of the present application. As Figure 12 shown, when the CPU accesses a certain memory page, if the memory page is located in the CXL extended memory and there are idle pages in the local memory, the CPU obtains the data in the hot page from the CXL extended memory through the core processing chip and stores it in the local memory.

[0136] Figure 13 It is a schematic diagram of a complete process provided by an embodiment of the present application, combined with Figure 13A description is given. The computing device obtains the usage rate of the local memory. When it exceeds the trigger threshold, based on the page access frequency information in the page table, it determines the cold pages that need to be migrated. The computing device sends a first migration instruction to the CXL memory expansion device. The CXL memory expansion device obtains the source location and the number of pages of the cold page from the first migration instruction, and allocates the same number of target free pages from the expanded memory according to the number of pages. Then the CXL memory expansion device executes the handling task. After the handling is completed, it sends a message indicating the completion of the migration to the computing device. After receiving the message, the computing device determines that the migration is completed and updates the address mapping in the page table. Thus, the process of cold page migration is completed.

[0137] In the memory page migration method provided by the embodiments of the present application, after the CXL memory expansion device receives the first migration instruction from the computing device based on the CXL.io protocol, it can, in response to the first migration instruction, migrate the first data in the first target memory to the CXL expanded memory based on the CXL.cache protocol. Through the above process, the CXL memory expansion device is enabled to replace the CPU to execute the cold page migration process, thereby releasing the CPU resource occupancy and improving the computing performance of the system.

[0138] In addition, the method of the embodiments of the present application can also bring the following beneficial effects:

[0139] 1. Optimize memory resource utilization: By migrating cold pages from the local memory to the expanded memory, memory resources can be used more effectively. The high-speed and high-cost local memory resources can be left for hot pages, that is, frequently accessed pages, while the less accessed cold pages are migrated to the lower-speed and lower-cost expanded memory.

[0140] 2. Improve system performance: Since hot pages are placed in the high-speed local memory, the data access speed can be increased, thereby improving the overall performance of the computing device. By the CXL memory expansion device assisting the CPU to execute the migration process, the performance consumption of the CPU when cold pages need to be downgraded and transported is further offloaded.

[0141] 3. Reduce system cost: Since cold pages are migrated to the lower-cost CXL expanded memory, the overall system cost can be reduced.

[0142] 4. Automatic management: By setting the trigger threshold and the access frequency threshold, the computing device can automatically perform memory page migration and page table update operations without manual intervention.

[0143] 5. Compatible with existing technologies: This solution is based on the CXL protocol and is compatible with existing computer architectures and technologies, and can be applied to most scenarios.

[0144] As can be seen, the above mainly introduces the solution provided by the embodiments of the present application from the perspective of methods. To implement the above functions, the embodiments of the present application provide the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians 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.

[0145] In an exemplary embodiment, the present application further provides a memory page migration device. The memory page migration device may be the aforementioned CXL memory expansion device. The memory page migration device may include one or more functional modules for implementing the memory page migration method of the above method embodiment.

[0146] For example, Figure 14 is a schematic diagram of a memory page migration device provided by an embodiment of the present application. As Figure 14 shown, it includes a receiving module 1401 and a migration module 1402.

[0147] The receiving module 1401 is configured to receive a first migration instruction of a computing device based on the CXL.io protocol; the first migration instruction is used to indicate migrating a first target memory page to the CXL extended memory; wherein, the first target memory page is a cold page in the computing device memory whose access heat meets a preset condition; the CXL extended memory is the memory in the CXL extended memory device;

[0148] The migration module 1402 is configured to, in response to the first migration instruction, migrate the first data in the first target memory page to the CXL extended memory based on the CXL.cache protocol.

[0149] In a possible implementation manner, it further includes a determination module 1403. The first migration instruction includes the number of cold pages to be migrated and the source address; the determination module 1403 is configured to determine target free pages from the CXL extended memory; wherein, the target free pages are free memory pages in the CXL extended memory, and the number of target free pages is the same as the number of cold pages to be migrated.

[0150] In a possible implementation manner, the migration module 1402 is specifically configured to obtain the first data from the memory of the computing device based on the CXL.cache protocol, the number of cold pages to be migrated, and the source address;

[0151] Store the first data in the target free page based on the target address and the number of target free pages; wherein, the target address is the starting address of the target free page.

[0152] In a possible implementation, it further includes a sending module 1404. The sending module 1404 is configured to send a first message to the computing device based on the CXL.io protocol; the first message is used to indicate that the first data migration is completed; the first message includes a target address, and the target address is used for the computing device to update the page table.

[0153] In an exemplary embodiment, the present application further provides a memory page migration device. The memory page migration device may be the aforementioned computing device. The memory page migration device may include one or more functional modules for implementing the memory page migration method in the above method embodiments.

[0154] For example, Figure 15 is a schematic diagram of a memory page migration device provided by an embodiment of the present application. As Figure 15 shown, it includes a determination module 1501 and a sending module 1502.

[0155] The determination module 1501 is configured to determine a first target memory page from the memory; wherein, the first target memory page is a cold page in the computing device memory whose access heat meets a preset condition;

[0156] The sending module 1502 is configured to send a first migration instruction to the CXL memory expansion device based on the CXL.io protocol; the first migration instruction is used to indicate migrating the first target memory page to the CXL extended memory; the CXL extended memory is the memory in the CXL memory expansion device.

[0157] In a possible implementation, it further includes: an update module 1503. The sending module 1502 is further configured to receive a first message sent by the CXL memory expansion device based on the CXL.io protocol; the first message is used to indicate that the first data in the first target memory page has been migrated; the update module 1503 is configured to update the first target memory page to an idle state in response to the first message.

[0158] In a possible implementation, the first message includes a target address; the target address is used to indicate the starting address of the first data in the CXL memory expansion device; the update module 1503 is further configured to update the source address in the page table to the target address.

[0159] In a possible implementation, the determination module 1501 is specifically configured to determine the first target memory page from the memory when the usage rate of the memory pages in the memory exceeds a preset threshold.

[0160] In a possible implementation, the first migration instruction includes the number of cold pages to be migrated and the source address; wherein, the source address is the start address of the first target memory page.

[0161] In a possible implementation, it further includes a migration module 1504. The migration module 1504 is configured to obtain an access request; wherein, the access request is used to indicate obtaining data from a memory or a CXL memory expansion device; the data is stored in a second target memory page; determine that the second target memory page belongs to a memory or a CXL memory expansion device; in the case where the second target memory page belongs to a CXL memory expansion device, upon completion of the access to the second target memory page, determine whether there is a free page in the memory; in the case where there is a free page in the memory, migrate the access data to the free page based on the CXL.mem protocol.

[0162] The embodiments of the present application also provide a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by computer instructions instructing relevant hardware. Exemplarily, the relevant hardware can be a processor of a computing device. The program instructions can be stored in the above computer-readable storage medium. When the program instructions are executed, the processes of the above method embodiments can be implemented. The computer-readable storage medium can be a memory. The above computer-readable storage medium can also be an external storage device, such as a hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the above computer-readable storage medium can also include both a memory and an external storage device. The above computer-readable storage medium is used to store the above computer program instructions and other programs and data required for the translation of the above software package.

[0163] The embodiments of the present application also provide a computer program product. The computer product includes a computer program. When the computer program product runs on a computing device, the computing device is caused to execute any one of the memory page migration methods provided in the above embodiments.

[0164] The embodiments of the present application also provide a computing system, including a CXL memory expansion device and a computing device. The CXL memory expansion device is used to execute the above Figure 4 corresponding memory page migration method, and the computing device is used to execute the above Figure 7 corresponding memory page migration method.

[0165] Although the present application has been described in connection with various embodiments, those skilled in the art will understand and realize other variations of the disclosed embodiments by referring to the drawings, the disclosure, and the appended claims during the implementation of the claimed application. In the claims, the term "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that these measures cannot be combined to produce a good effect.

[0166] Although the present application has been described in connection with specific features and their embodiments, it is obvious that various modifications and combinations can be made without departing from the spirit and scope of the present application. Accordingly, the present specification and the drawings are merely exemplary illustrations of the present application defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of the present application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and 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 equivalent technologies, the present application also intends to include these changes and modifications.

[0167] The above are only specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for memory page migration, characterized in that, Applied to a Compute Express Link (CXL) memory expansion device; the method includes: Receiving, based on the CXL.io protocol, a first migration instruction from a computing device; the first migration instruction is used to indicate migrating a first target memory page to the CXL extended memory; wherein, the first target memory page is a cold page in the computing device memory whose access heat meets a preset condition; the CXL extended memory is the memory in the CXL memory expansion device. In response to the first migration instruction, migrating, based on the CXL.cache protocol, first data in the first target memory page to the CXL extended memory.

2. The method according to claim 1, characterized in that, The first migration instruction includes the number of cold pages to be migrated and the source address. Before migrating, based on the CXL.cache protocol, the first data in the first target memory page to the CXL extended memory, the method further includes: Determining target free pages from the CXL extended memory; wherein, the target free pages are free memory pages in the CXL extended memory, and the number of the target free pages is the same as the number of cold pages to be migrated.

3. The method according to claim 2, wherein Migrating the first data to the CXL extended memory based on the CXL.cache protocol includes: Obtaining the first data from the memory of the computing device based on the CXL.cache protocol, the number of cold pages to be migrated, and the source address. Storing the first data into the target free pages based on the target address and the number of the target free pages; wherein, the target address is the start address of the target free pages.

4. The method according to claim 3, wherein The method further includes: Sending, based on the CXL.io protocol, a first message to the computing device; the first message is used to indicate that the migration of the first data is completed; the first message includes the target address, and the target address is used for the computing device to update the page table.

5. A method for memory page migration, characterized in that, Applied to a computing device, the method includes: Determining a first target memory page from the memory; wherein, the first target memory page is a cold page in the computing device memory whose access heat meets a preset condition. Sending, based on the CXL.io protocol, a first migration instruction to a CXL memory expansion device; the first migration instruction is used to indicate migrating the first target memory page to the CXL extended memory; the CXL extended memory is the memory in the CXL memory expansion device.

6. The method according to claim 5, wherein The method further includes: Receiving, based on the CXL.io protocol, a first message sent by the CXL memory expansion device; the first message is used to indicate that the migration of the first data in the first target memory page is completed. In response to the first message, updating the first target memory page to an idle state.

7. The method according to claim 6, wherein The first message includes a target address; the target address is used to indicate the start address of the first data in the CXL memory expansion device. The method further includes: Updating the storage address of the first data in the page table to the target address.

8. The method according to any one of claims 5 to 7, characterized in that Determining the first target memory page from the memory includes: In a case where the usage rate of the memory pages in the memory exceeds a preset threshold, determining the first target memory page from the memory.

9. The method according to any one of claims 5-8, characterized in that The first migration instruction includes the number of cold pages to be migrated and the source address; wherein, the source address is the starting address of the first target memory page.

10. The method according to any one of claims 5-9, characterized in that, The method further includes: Obtaining an access request; wherein, the access request is used to indicate obtaining data from the memory or the CXL memory expansion device; the data is stored in a second target memory page. Determining that the second target memory page belongs to the memory or the CXL memory expansion device. When the second target memory page belongs to the CXL memory expansion device, upon completion of accessing the second target memory page, determining whether there is a free page in the memory. When there is a free page in the memory, migrating the access data to the free page based on the CXL.mem protocol.

11. A computing fast link CXL memory expansion device, characterized in that, The CXL memory expansion device includes a first chip and a memory; the first chip is coupled to the memory. The memory is used to store computer instructions. The computer instructions are loaded and executed by the first chip to enable the CXL memory expansion device to implement the memory page migration method according to any one of claims 1-4.

12. A computing device, characterized in that, The computing device includes a processor and a memory; the processor is coupled to the memory. The memory is used to store computer instructions. The computer instructions are loaded and executed by the processor to enable the computing device to implement the memory page migration method according to any one of claims 5-10.

13. A computing system, characterized in that, The computing system includes the CXL memory expansion device according to claim 11 and the computing device according to claim 12.

Citation Information

Cited By

  • Virtual machine data migration method and device, storage medium and electronic equipment

    CN120803617A

  • Memory device hot plug method and device, medium and program product

    CN122470548A