Memory migration method, electronic equipment, storage medium and computer program product
By counting the number of accesses within a preset time period when the access frequency of CXL memory pages exceeds a threshold, and migrating the memory to local memory when the threshold is exceeded, combined with migration buffer caching, the performance degradation caused by unnecessary memory migration in existing technologies is solved, and the accuracy and performance stability of memory migration are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-12
Smart Images

Figure CN122019404A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of memory management technology, and in particular to a memory migration method, electronic device, storage medium and computer program product. Background Technology
[0002] With the rapid development of technologies such as artificial intelligence and cloud computing, the processor performance of electronic devices is constantly increasing. However, the growth of memory performance in electronic devices lags far behind that of processors, thus limiting the overall performance improvement of electronic devices. To address this issue, Compute Express Link (CXL) has emerged.
[0003] CXL is a high-speed interconnect protocol used to enable efficient communication between hardware components such as processors and memory. In recent years, CXL over Ethernet (COE) has further expanded the application boundaries of CXL. COE enables electronic devices to access remote CXL storage devices across server racks, laying the foundation for large-scale memory resources. This has given rise to hybrid storage architectures consisting of local memory and CXL memory.
[0004] To fully leverage hybrid storage architectures, performance is typically improved through memory migration. However, current memory migration methods can lead to unnecessary memory migrations, resulting in performance degradation of electronic devices. Summary of the Invention
[0005] To address the related technical issues, embodiments of this application provide a memory migration method, an electronic device, a storage medium, and a computer program product.
[0006] The technical solution of this application embodiment is implemented as follows: This application provides a memory migration method applied to an electronic device, the electronic device including local memory and logical CXL memory; the method includes: Obtain the access frequency of the CXL memory page corresponding to the logical CXL memory; If the access frequency of the CXL memory page is greater than the first migration threshold, then the number of times the CXL memory page is accessed within a preset time period is counted. If the number of accesses exceeds a first preset threshold, the CXL memory page will be migrated to the local memory.
[0007] In the above scheme, the electronic device further includes a migration buffer, which is used to cache data; if the access frequency of the CXL memory page is greater than a first migration threshold, the number of accesses to the CXL memory page within a preset time period is counted, including: If the access frequency of the CXL memory page is greater than the first migration threshold, then the CXL memory page is migrated to the migration buffer; The number of accesses within a preset time period after the CXL memory page is migrated to the migration buffer is counted.
[0008] In the above scheme, migrating the CXL memory page to the local memory includes: If available memory pages exist in the local memory, the CXL memory pages are migrated to the local memory.
[0009] The method in the above scheme further includes: If there are no available memory pages in the local memory, then the first memory page in the local memory is determined, wherein the first memory page is the memory page with the lowest access frequency in the local memory at present; If the access frequency of the CXL memory page is greater than that of the first memory page, then after migrating the first memory page to the CXL memory, the CXL memory page is migrated to the local memory.
[0010] The method in the above scheme further includes: The migration benefit parameters for the first adjustment period and the second adjustment period are determined respectively; wherein, the second adjustment period is the previous migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used to evaluate memory performance. If the migration benefit parameter of the first adjustment period is greater than the preset benefit threshold, and the migration benefit parameter of the first adjustment period is greater than the migration benefit parameter of the second adjustment period, then the first migration threshold is increased. If the migration benefit parameter of the first adjustment period is less than or equal to the preset benefit threshold, or if the migration benefit parameter of the first adjustment period is less than or equal to the migration benefit parameter of the second adjustment period, then the first migration threshold is reduced.
[0011] In the above scheme, the migration benefit parameters for the first adjustment period include: Obtain the status information of the local memory and the CXL memory page during the first adjustment period, wherein the status information includes bandwidth utilization and / or access latency; Based on the status information of the local memory and the CXL memory page during the first adjustment period, the migration benefit parameters for the first adjustment period are determined.
[0012] The method in the above scheme further includes: Obtain the access frequency of local memory pages; wherein, the local memory page is a memory page in the local memory; If the access frequency of the local memory page is less than the second migration threshold, the local memory page will be migrated to CXL memory.
[0013] This application also provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor, the memory including local memory and logical CL3 memory; wherein, when the processor is used to run the computer program, it executes the steps of the above method.
[0014] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0016] The memory migration method, electronic device, storage medium, and computer program product provided in this application, by setting a waiting time for memory page migration, do not immediately migrate the CXL memory page to local memory when the access frequency of the CXL memory page exceeds a certain migration threshold. Instead, the number of accesses to the CXL memory page within a preset time period is counted. If the number of accesses to the CXL memory page within the preset time period exceeds a first preset threshold, the CXL memory page is migrated to local memory. In this way, unnecessary memory pages can be identified, reducing unnecessary memory migrations, improving the accuracy of memory migration decisions, and enhancing the stability of read and write performance. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of a memory system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a memory migration method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device application example provided in this application embodiment; Figure 4 This is a flowchart illustrating an application example of a memory migration method provided in this application embodiment; Figure 5 This is a schematic diagram of a dynamic adjustment algorithm for migration threshold provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a memory migration device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will now be described in further detail with reference to the accompanying drawings.
[0019] Compute Fast Link (CLO) is an open interconnect protocol built on the physical layer of a high-speed serial computer extended bus. Through CLO, the processor of an electronic device can directly access storage resources connected to the device. CLO based on Ethernet (Copy of Energy) also allows the processor to access remote storage resources, significantly improving the performance of the electronic device.
[0020] With the help of high-speed computing links, electronic devices can implement a hybrid storage architecture combining local memory and CXL memory. CXL memory is the storage space provided by CXL memory devices and can be used as extended memory for electronic devices. Through memory migration, frequently accessed data is stored in local memory, while less frequently accessed data is stored in CXL memory, thereby improving the storage performance of electronic devices.
[0021] In related technologies, memory migration is typically determined by the "hotness" (i.e., access frequency) of memory pages. For example, if the hotness of a CXL memory page exceeds a certain threshold, the CXL memory page is migrated to local memory. Alternatively, if the hotness of a local memory page is below a certain threshold, the local memory page is migrated to CXL memory. However, the hotness of memory pages is not constant. A memory page may only have high or low hotness for a period of time, and its hotness may change after that period. Therefore, this migration method may cause unnecessary memory migration overhead, increasing the number of memory migrations, and instead of improving the performance of electronic devices, it may actually reduce their performance.
[0022] Based on this, this application provides a memory migration scheme. By setting a waiting period for memory page migration, when the access frequency of a CXL memory page exceeds a certain migration threshold, the electronic device does not immediately migrate the CXL memory page to local memory. Instead, it counts the number of accesses to the CXL memory page within a preset time period (i.e., the waiting period). If the number of accesses to the CXL memory page within the preset time period exceeds a certain threshold (such as a first preset access threshold), the CXL memory page is migrated to local memory. In this way, memory pages with excessively high access frequency in a short period of time due to sudden access can be effectively identified, and CXL memory pages with high access frequency over a long period of time can be migrated. This reduces unnecessary memory migration, improves the accuracy of memory migration decisions, reduces the impact of unnecessary memory migration on overall performance, and improves performance stability.
[0023] In this embodiment, the fast computing link enables high-speed communication between multiple electronic devices, providing higher bandwidth and lower latency for communication between electronic devices. This eliminates data transmission bottlenecks in central processing units and various dedicated accelerators during computationally intensive tasks, thereby improving overall performance. To better illustrate the memory migration scheme provided in this embodiment, a memory system built based on the fast computing link is first introduced through an example.
[0024] For example, such as Figure 1 As shown, the memory system includes multiple client servers, a CXL resource management server, and a CXL memory pool server.
[0025] Multiple client servers can be represented as server 1, server 2, ..., server N. N is a positive integer representing the number of client servers. The client servers are the requesters of CXL memory resources, accessing the CXL memory pool of remote CXL memory servers through a computed fast link.
[0026] The client server includes components such as the main processor, host memory, and communication interfaces.
[0027] The main processor of the client server includes a central processing unit (CPU) and a memory controller.
[0028] The central processing unit (CPU) is the main computing unit of the client server, primarily responsible for executing program instructions and processing data.
[0029] The memory controller is integrated into or connected to the central processing unit (CPU) and is primarily responsible for memory access. For example, the memory controller is mainly responsible for the translation between virtual and physical addresses of memory, detecting the hotness of memory pages, dynamically adjusting migration thresholds (such as the first migration threshold and the second migration threshold), and migrating memory pages.
[0030] The host memory of the client server, also known as storage, includes local memory and logical CXL memory. Local memory is storage located locally on the client server, such as Dynamic Random Access Memory (DRAM). Local memory is the non-shared memory space used internally by the client server. Logical CXL memory is a virtual address space mapped to remote CXL memory.
[0031] The client server's host memory also integrates a COE packet manager. The COE packet manager is a key component in implementing the COE protocol stack. Its primary function is packet forwarding, enabling remote CXL memory access by the client server. For example, the COE packet manager receives CXL protocol messages sent by the memory controller, such as CXL read or write messages sent by the CPU and forwarded by the memory controller. It then encapsulates these CXL messages into Ethernet packets conforming to the Ethernet transmission standard and forwards them through the client server's communication interface. As another example, the COE packet manager decapsulates Ethernet packets received from the network into CXL protocol messages and transmits them to the memory controller.
[0032] In some implementations, the client server's host memory also includes a migration buffer. The migration buffer is a shared storage space within the client server. It physically belongs to the client server. The migration buffer is used to cache migrated memory pages, thereby filtering out unnecessary memory page migrations.
[0033] The client server's communication interface is used to enable communication between the client server and other devices. For example, the client server includes a communication interface implemented by a Network Interface Controller (NIC) for receiving or sending Ethernet packets over a network.
[0034] The CXL resource management server is responsible for managing CXL memory resources. For example, it handles the allocation, scheduling, and access control of CXL memory resources. In response to resource allocation requests from client servers, the CXL resource management server allocates CXL memory resources from the CXL memory pool to client servers with the appropriate access permissions.
[0035] The CXL memory pool server (also known as a CXL memory device) is used to implement the CXL memory pool based on the CXL protocol and is the provider of CXL memory resources. The CXL memory pool server includes a main processor, a CXL memory pool, and communication interfaces.
[0036] The main processor of the CXL memory pool server consists of a CPU and a memory controller. The CPU of the CXL memory pool server is primarily responsible for processing storage tasks. The memory controller of the CXL memory pool server is used to drive the CXL memory pool.
[0037] The CXL memory pool server provides memory to support the CXL protocol. It also integrates a COE packet manager, which is used for packet forwarding. For example, the COE packet manager decapsulates received Ethernet packets into CXL protocol packets and routes them to the memory controller of the CXL memory pool server. Alternatively, it encapsulates CXL protocol packets sent by the memory controller into Ethernet packets and sends them through the communication interface. After initialization, the CXL memory pool server sends resource information such as the CXL memory pool's capacity and access address to the CXL resource management server.
[0038] The communication interface of the CXL memory pool server is used to enable communication between the CXL memory pool server and other devices. For example, the communication interface of the CXL memory pool server is used to receive or send Ethernet messages over a network to achieve communication with other devices.
[0039] It is understandable that the hardware modules in each device within the aforementioned memory system, such as the central processing unit, memory controller, and memory, all support the CXL protocol. For example, the CXL protocol includes the CXL.io sub-protocol and the CXL.mem sub-protocol. The CXL.io sub-protocol is used to transmit configuration information and control commands; the CXL.mem sub-protocol is used to implement memory read and write operations. The various components in the memory system achieve efficient communication through the CXL protocol, improving storage performance.
[0040] This application also provides a memory migration method. This method is applied to an electronic device that supports the CXL protocol. Exemplarily, the electronic device can be a client-server in the aforementioned memory system, or any device with a hybrid storage architecture of local memory and CXL memory.
[0041] The memory migration method provided in this application is illustrated below using an electronic device as the execution subject. Figure 2 As shown, the memory migration method includes the following steps: Step 201: The electronic device obtains the access frequency of the CXL memory page corresponding to the logical CXL memory; Step 202: If the access frequency of the CXL memory page is greater than the first migration threshold, the electronic device counts the number of times the CXL memory page is accessed within a preset time period; Step 203: If the number of times the CXL memory page is accessed within a preset time period exceeds the first preset threshold, the electronic device will migrate the CXL memory page to local memory.
[0042] In practical applications, the memory of an electronic device (i.e., host memory) includes local memory and logical CXL memory. Local memory is a non-shared memory space located within the electronic device. For example, local memory can be provided through DRAM. Logical CXL memory is a virtual address space mapped to CXL memory. Electronic devices access CXL memory through logical CXL memory, such as accessing CXL memory provided by a CXL memory pool server. CXL memory can serve as extended memory for electronic devices.
[0043] In step 201, the memory controller of the electronic device records the access frequency of the CXL memory pages corresponding to the logical CXL memory. The logical CXL memory corresponds to one or more (one or more can be understood as at least one) CXL memory pages. The memory controller of the electronic device can record the access frequency (i.e., popularity) of each CXL memory page.
[0044] In step 202, the electronic device compares the access frequency of each CXL memory page with a first migration threshold to determine if there are any CXL memory pages with an access frequency greater than the first migration threshold. If the access frequency of any CXL memory page is greater than the first migration threshold, it indicates that the CXL memory page has high access frequency and is a potential hot page. To reduce unnecessary memory page migration, the electronic device does not immediately migrate the CXL memory page to local memory, but instead counts the number of access requests (i.e., access counts) received by the CXL memory page within a preset time period. In this way, the electronic device can identify whether a CXL memory page is a continuously high-access CXL memory page or a high-access CXL memory page for a short period of time.
[0045] In practical applications, the first migration threshold can be set according to actual application requirements. Alternatively, the electronic device can dynamically adjust the first migration threshold based on the performance of its local memory. For example, the electronic device can increase the first migration threshold when the performance metric used to evaluate the device's performance improves, and decrease the first migration threshold when the performance metric deteriorates.
[0046] The preset duration can be set according to actual application needs. For example, the preset duration can be an integer multiple of the clock cycle. Taking the clock cycle of an electronic device as T as an example, the preset duration is equal to 5T.
[0047] In step 203, the electronic device compares the number of accesses to the CXL memory page counted within a preset time period with a first preset threshold to determine whether the number of accesses to the CXL memory page within the preset time period exceeds the first preset threshold. If the number of accesses to the CXL memory page within the preset time period exceeds the first preset threshold, it indicates that the CXL memory page is a consistently high-frequency CXL memory page, i.e., the CXL memory page is a truly hot page. In this case, the electronic device migrates the CXL memory page to local memory.
[0048] It is understandable that local memory in an electronic device is the internal memory space of the device, which has low access latency. By migrating CXL memory pages that are consistently frequently accessed to local memory, memory access latency can be reduced, thereby improving the performance of the electronic device.
[0049] In practical applications, the first preset threshold number can be set according to actual application requirements. This application does not limit this. For example, the first preset threshold number can be set as the average or median number of times a local memory page is accessed within a preset historical time period.
[0050] In some implementations, the electronic device also includes a migration buffer. This migration buffer is used to cache data. When the electronic device detects that the access frequency of any CXL memory page exceeds a first migration threshold, the electronic device can migrate the CXL memory page to the migration buffer of the electronic device and cache the CXL memory page using the migration buffer. The data of the CXL memory page will remain in the migration buffer for a preset duration. The electronic device counts the number of times the CXL memory page is accessed while it remains in the migration buffer for the preset duration.
[0051] If the number of accesses to the CXL memory page within a preset time period exceeds a first preset threshold, the CXL memory page is considered a true hot page, and the electronic device moves the CXL memory page from the migration buffer to local memory.
[0052] If the number of accesses to a CXL memory page within a preset time period does not exceed a first preset threshold, then the CXL memory page is considered to require no migration. Since the CXL memory pages in the migration buffer are not migrated to local memory, invalid migrations to local memory are reduced, saving the overhead and bandwidth associated with memory migration. In some implementations, if the number of accesses to a CXL memory page within a preset time period does not exceed the first preset threshold, the electronic device may not process the CXL memory pages in the migration buffer, waiting for new data to overwrite the migration buffer.
[0053] It is understandable that when an electronic device migrates memory pages (local memory pages or CXL memory pages) to a migration buffer, it is migrating the memory pages to the migration buffer in a backup manner. The original memory pages are retained in local memory or CXL memory. If the number of accesses to the CXL memory pages cached in the migration buffer does not exceed a first preset threshold within a preset time period, the electronic device does not need to migrate the CXL memory pages from the migration buffer back to CXL memory, thereby reducing the additional overhead of memory page migration operations. After the CXL memory pages in the migration buffer are migrated to local memory, the electronic device can instruct the CXL memory device to release the storage resources occupied by the corresponding CXL memory pages in CXL memory.
[0054] In this embodiment, upon detecting a potential hot page, a memory page migration operation is not initiated immediately. Instead, the potential hot page is observed through a migration buffer to determine whether it is a genuine hot page. Only when the potential hot page is confirmed to be a genuine hot page is the memory page migration operation performed. This improves the accuracy of memory page migration and reduces the overhead and bandwidth usage caused by frequent memory migrations.
[0055] To further improve the accuracy of memory migration, in some implementations, before migrating CXL memory pages to local memory, the electronic device also determines whether there are enough available memory pages in the local memory for the migration. If there are available memory pages in the local memory, such as if the available capacity of the local memory is greater than the capacity required to migrate the CXL memory page (i.e., the CXL memory page that has been accessed more than a first preset threshold number of times within a preset time period), the electronic device will migrate the CXL memory page to the local memory, such as migrating the CXL memory page to the available memory pages in the local memory.
[0056] By determining whether available memory pages exist in the local memory, it's possible to confirm whether local memory is sufficient for migration beforehand. This ensures that memory page migration operations are performed only when local memory resources are adequate, reducing the probability of migration failure due to insufficient local memory. This not only improves the success rate and stability of memory migration but also reduces the overhead caused by invalid migration operations.
[0057] If no available memory pages exist in local memory, the electronic device can migrate the cold pages from local memory to CXL memory, and then migrate the CXL memory pages to be migrated to local memory. To improve the benefits of memory migration, in some implementations, if no available memory pages exist in local memory, the electronic device identifies the coldest page in local memory (i.e., the first memory page), that is, the memory page with the lowest access frequency in local memory. Then, the electronic device compares the access frequency of the CXL memory page to be migrated with the access frequency of the coldest page to determine whether the access frequency of the CXL memory page to be migrated is greater than the access frequency of the coldest page.
[0058] If the access frequency of the CXL memory page to be migrated is greater than the access frequency of the coldest page, it indicates that memory migration will bring positive benefits. In this case, the electronic device will migrate the coldest page from local memory to CXL memory, and then migrate the CXL memory page to be migrated to local memory.
[0059] If the access frequency of the CXL memory page to be migrated is less than or equal to the access frequency of the coldest page, it indicates that memory migration would have a negative impact. In this case, the electronic device will not perform memory migration.
[0060] In this embodiment, when the popularity of the CXL memory page to be migrated is less than the popularity of the coldest page in local memory, directly evicting some memory pages from local memory to CXL memory would result in negative benefits. Therefore, the popularity of the CXL memory page to be migrated is compared with the popularity of the coldest page in local memory. When the popularity of the CXL memory page to be migrated is greater than the popularity of the coldest page in local memory, the coldest page in local memory is evicted, and then the CXL memory page to be migrated is migrated to local memory, thereby bringing positive benefits to memory migration.
[0061] In this embodiment, besides deciding whether to migrate CXL memory pages to local memory based on their access frequency, the electronic device also decides whether to migrate cold pages in local memory to CXL memory. In some implementations, for each local memory page, the electronic device obtains the access frequency of the local memory page and compares it with a second migration threshold to determine whether the local memory page is a cold page. If the access frequency of any local memory page is less than the second migration threshold, it is considered a cold page, and the electronic device can migrate the local memory page to CXL memory.
[0062] To reduce unnecessary memory page migrations and improve the accuracy of local memory page migrations, if the access frequency of any local memory page is less than a second migration threshold, the electronic device does not immediately migrate that local memory page to CXL memory. Instead, it counts the number of access requests received by that local memory page within a preset time period (i.e., the number of accesses). For example, if the access frequency of any local memory page is less than the second migration threshold, the electronic device can migrate that local memory page to the electronic device's migration buffer and cache it using the migration buffer. The data of the local memory page will remain in the migration buffer for a preset time. The electronic device counts the number of accesses to the local memory page within the preset time period. In this way, the electronic device can identify whether a local memory page is a consistently hot or cold local memory page or a hot or cold memory page within a short period of time.
[0063] If the number of accesses to a local memory page within a preset time period is less than the second preset threshold, the local memory page is considered a truly cold page, and the electronic device will migrate the local memory page to CXL memory, such as moving the local memory page from the migration buffer to local memory.
[0064] If the number of accesses to a local memory page within a preset time period is greater than or equal to a second preset threshold, the local memory page is considered not a truly cold page and does not require migration. Since the local memory page is not migrated to CXL memory, the number of invalid migrations is reduced, saving the overhead and bandwidth associated with memory migration.
[0065] In practical applications, the second migration threshold can be set according to actual application requirements. Alternatively, the electronic device can dynamically adjust the second migration threshold based on the performance of its local memory. The second preset number of times threshold can also be set according to actual application requirements. This application does not limit the second migration threshold or the second preset number of times threshold.
[0066] In this embodiment, when the access frequency of a local memory page is detected to be less than the second migration threshold, the memory page migration operation is not initiated immediately. Instead, the local memory page is observed through the migration buffer to determine whether it is a truly cold page. Only when the local memory page is confirmed to be a truly cold page is the memory page migration operation performed. This improves the accuracy of memory page migration and reduces the overhead and bandwidth usage caused by frequent memory migration.
[0067] The memory migration method provided in this application embodiment is illustrated below through an application example. In this application example, the structure of the electronic device is as follows: Figure 3As shown. The electronic device includes a multi-core CPU (i.e., CPU cores #0 to #7), an on-chip cache, a memory controller, local memory, a migration buffer, and CXL memory corresponding to the logical CXL memory.
[0068] The CPU of electronic devices is a multi-core CPU. A multi-core CPU consists of multiple CPU cores. Each CPU core is an independent processing unit in a multi-core CPU. The CPU core is used to perform data processing tasks and generate memory access requests.
[0069] On-chip caches are used to temporarily cache data accessed by the CPU core, reducing the CPU's need to access local memory, thereby reducing the pressure on local memory bandwidth and optimizing the performance of electronic devices. On-chip caches can be integrated inside the CPU, serving as a high-speed storage unit for the CPU.
[0070] Local memory is the main memory space used to provide low latency and high bandwidth. Logical CXL memory, corresponding to CXL memory, serves as extended memory for electronic devices, used to expand the memory space of these devices. CXL memory actually resides in CXL memory devices, such as CXL memory pool servers.
[0071] The migration buffer is used to temporarily store memory pages to be migrated during the memory migration process.
[0072] The memory controller is responsible for accessing and managing various types of memory. It includes an address mapping module, a decision-making module, a detection module, and a migration module. The address mapping module maintains the mapping relationship between logical memory addresses and physical memory addresses; the detection module obtains the status of memory pages, such as access frequency and bandwidth utilization; the decision-making module determines whether to perform memory migration based on the access frequency of memory pages; and the migration module performs the migration operation of memory pages between local memory, CXL memory, and the migration buffer.
[0073] like Figure 4 As shown, the memory migration method provided in this application example includes the following steps: Step 401: The electronic device obtains the access frequency of memory pages; The detection module in the memory controller of the electronic device detects and records the access frequency of the local memory page and the access frequency of the CXL memory page. The electronic device further executes steps 402 and 410.
[0074] Step 402: The electronic device determines whether the access frequency of the CXL memory page is greater than the first migration threshold. If the access frequency of the CXL memory page is greater than the first migration threshold, then proceed to step 403; otherwise, end the current process. The decision module in the memory controller of the electronic device compares the access frequency of the CXL memory page with a first migration threshold to decide whether to migrate the CXL memory page to local memory.
[0075] If the access frequency of a CXL memory page is greater than the first migration threshold, it indicates that the CXL memory page is hot, and the electronic device executes step 403.
[0076] If the access frequency of a CXL memory page is greater than the first migration threshold, it indicates that the CXL memory page is less popular, and the electronic device will end the current process.
[0077] Step 403: The electronic device moves the CXL memory pages into the migration buffer; The migration module in the memory controller of the electronic device moves CXL memory pages into the migration buffer.
[0078] Step 404: The electronic device determines whether the number of accesses to the CXL memory page moved into the migration buffer within a preset time period is greater than the first preset number threshold. If the number of accesses is greater than the first preset number threshold, then step 405 is executed; otherwise, the current process ends. The decision module in the memory controller of the electronic device compares the number of times the CXL memory page in the migration buffer is accessed within a preset time period with a first preset number threshold, and decides whether to migrate the CXL memory page to local memory.
[0079] If the number of accesses to a CXL memory page in the migration buffer within a preset time period exceeds a first preset threshold, it indicates that the CXL memory page is a true hot page, and the electronic device executes step 405.
[0080] If the number of accesses to a CXL memory page in the migration buffer within a preset time period is less than or equal to a first preset threshold, it indicates that the CXL memory page is not a true hot page, and the electronic device terminates the current process.
[0081] Step 405: The electronic device determines whether there are available memory pages in the local memory. If there are available memory pages in the local memory, proceed to step 406; otherwise, proceed to step 407. The decision module in the memory controller of an electronic device determines whether there are available memory pages in the local memory and decides whether to migrate the CXL memory page to the local memory.
[0082] If available memory pages exist in local memory, proceed to step 406; otherwise, proceed to step 407.
[0083] Step 406: The electronic device migrates CXL memory pages to local memory; The migration module in the memory controller of an electronic device migrates CXL memory pages from the migration buffer to local memory.
[0084] Step 407: The electronic device determines the coldest page in local memory; The detection module in the memory controller of an electronic device identifies the coldest page in local memory with the lowest access frequency.
[0085] Step 408: The electronic device determines whether the access frequency of the CXL memory page is greater than the access frequency of the coldest page in local memory. If the access frequency of the CXL memory page is greater than the access frequency of the coldest page in local memory, then proceed to step 409; otherwise, end the current process. The decision module in the memory controller of an electronic device compares the access frequency of the CXL memory page with the access frequency of the coldest page in local memory to determine whether the access frequency of the CXL memory page is greater than the access frequency of the coldest page in local memory.
[0086] If the access frequency of the CXL memory page is greater than the access frequency of the coldest page in local memory, then proceed to step 409.
[0087] If the access frequency of the CXL memory page is less than or equal to the access frequency of the coldest page in local memory, then the current process ends.
[0088] Step 409: The electronic device evicts the coldest page in local memory, proceeding to step 406.
[0089] If the access frequency of a CXL memory page is greater than the access frequency of the coldest page in local memory, the electronic device migrates the coldest page with the lowest access frequency from local memory to CXL memory. After migrating the coldest page from local memory to CXL memory, step 406 is executed, which moves the CXL memory from the migration buffer to local memory.
[0090] Step 410: The electronic device determines whether the access frequency of local memory pages is less than the second migration threshold. If the access frequency of local memory pages is less than the second migration threshold, then proceed to step 411; otherwise, end the current process. The decision module in the memory controller of the electronic device compares the access frequency of local memory pages with a second migration threshold to decide whether to migrate local memory pages to CXL memory.
[0091] If the access frequency of local memory pages is less than the second migration threshold, it indicates that the local memory pages are less popular, and the electronic device executes step 411.
[0092] If the access frequency of local memory pages is greater than or equal to the second migration threshold, it indicates that the local memory page is not hot enough, and the electronic device ends the current process.
[0093] Step 411: The electronic device migrates local memory pages to CXL memory; The migration module in the memory controller of the electronic device migrates local memory pages to CXL memory. For example, if the access frequency of a local memory page is less than a second migration threshold, the migration module moves the local memory page to a migration cache based on the number of times the local memory page is moved to the migration cache within a preset time period. If the decision module confirms that the number of times the local memory page is accessed within the preset time period is less than a second preset number threshold, the migration module migrates the local memory page to CXL memory.
[0094] In this application example, by introducing a migration cache, the electronic device can effectively reduce the number of invalid migrations, increase migration benefits, and improve the performance of the electronic device by upgrading hot pages from CXL memory to local memory and evicting cold pages from local memory to CXL memory.
[0095] In this embodiment of the application, in order to improve the accuracy of memory migration, the electronic device can dynamically adjust the first migration threshold and the second migration threshold.
[0096] In some implementations, the electronic device periodically adjusts the first migration threshold. Taking the electronic device determining the first migration threshold in the first adjustment period as an example, the electronic device then determines the migration gain parameter for the first adjustment period and the migration gain parameter for the second adjustment period. The second adjustment period is the migration threshold adjustment period preceding the first adjustment period.
[0097] If the migration gain parameter in the first adjustment period is greater than the preset gain threshold, and the migration gain parameter in the first adjustment period is greater than the migration gain parameter in the second adjustment period, it indicates that the migration gain brought about by the adjustment operation on the first migration threshold in the previous migration threshold adjustment period is effective. In this case, the electronic device increases the first migration threshold, such as by increasing the first migration threshold by 1, to obtain the first migration threshold for the first adjustment period.
[0098] Otherwise, if the migration gain parameter of the first adjustment period is less than or equal to the preset gain threshold, or if the migration gain parameter of the first adjustment period is less than or equal to the migration gain parameter of the second adjustment period, it indicates that the migration gain brought about by the adjustment operation on the first migration threshold in the previous migration threshold adjustment period is invalid. In this case, the electronic device reduces the first migration threshold, such as reducing the first migration threshold by 1, to obtain the first migration threshold of the first adjustment period.
[0099] The preset revenue threshold can be set according to actual application needs. For example, the preset revenue threshold can be 0. This application does not limit the preset revenue threshold.
[0100] In this embodiment, the migration benefit parameter is used to evaluate the memory performance of the electronic device. By adjusting the migration threshold using the migration benefit parameter in adjacent migration threshold adjustment periods, the migration benefit is maximized as much as possible, thereby improving the accuracy of memory migration and enhancing memory read / write performance.
[0101] In this embodiment, the adjustment period for the migration threshold can be set according to actual application requirements. For example, the adjustment period can be 30 seconds, 1 minute, etc. This embodiment does not limit this.
[0102] To more accurately assess migration benefits using migration benefit parameters, some implementations allow electronic devices to determine these parameters for each adjustment cycle based on the status information of local memory and CXL memory pages. The memory page status information reflects the real-time state of the memory pages, such as their load and read / write performance. Determining migration benefit parameters using local memory and CXL memory page status information allows these parameters to dynamically respond to changes in memory load and performance fluctuations, thereby improving the accuracy of memory migration and the efficiency of resource allocation.
[0103] For example, the status information includes bandwidth utilization and / or access latency. Bandwidth utilization reflects load changes. For example, bandwidth utilization is equal to the ratio of the bandwidth rate difference between adjacent clock cycles to the clock cycle. Access latency reflects the rate of memory response. For example, access latency represents the time from issuing a memory access request to receiving the requested data, such as the time it takes for an electronic device to access a remote CXL memory pool via COE. Taking the status information including bandwidth utilization and access latency as an example, the migration benefit parameter can be expressed as formula (1): Migration benefit parameter = Local memory bandwidth utilization + Local memory access latency - CXL memory bandwidth utilization - CXL memory access latency Formula (1) Since the units for bandwidth utilization and access latency are different, the access latency of local memory and CXL memory mentioned above are normalized access latency.
[0104] Understandably, during the initialization phase of an electronic device, the device enumerates and identifies local memory and CXL memory, that is, it detects all available memory resources and sets the adjustment cycle for the migration threshold. In the early stages of operation, local memory is in a warm-up phase, containing many unmapped (i.e., unused) memory pages, resulting in low local memory utilization. Actively migrating frequently accessed CXL memory pages to local memory during this phase helps improve local memory utilization, thereby optimizing the overall performance of the electronic device.
[0105] Once all memory pages in local memory have been mapped at least once, the electronic device enters a stable phase, at which point the probability of memory page replacement increases significantly. If a hot page in CXL memory is identified during this phase, the electronic device can determine whether to perform a memory migration operation by setting a migration threshold. To determine an optimal migration threshold, a migration benefit parameter (i.e., migration benefit metric) is defined to characterize the benefits of memory migration. The difference between migration benefit and migration cost is the net migration benefit. Memory migration costs include CPU overhead, network bandwidth consumption due to page migration, and migration time.
[0106] In this embodiment, the electronic device can adjust the migration strategy at different operating stages. In the stable stage, the migration threshold is dynamically optimized based on the migration benefit parameter, so as to perform memory migration when the migration benefit is improved, thereby achieving a balance between high performance and low overhead.
[0107] The following application example illustrates the adjustment process of the first migration threshold. In this example, the electronic device uses a dynamic threshold adjustment algorithm to dynamically adjust the first migration threshold. For instance, the electronic device inputs the state information of the local memory and CXL memory from two adjacent adjustment cycles into the dynamic threshold adjustment algorithm, and obtains the first migration threshold through the algorithm. The dynamic threshold adjustment algorithm is as follows: Figure 5 As shown below, the process of obtaining the first migration threshold using the dynamic adjustment algorithm of the migration threshold is introduced.
[0108] During the initialization phase, the electronic device enumerates the local memory and CXL memory and sets the adjustment cycle for the migration threshold.
[0109] If all local memory pages have been replaced at least once, it indicates that the electronic device is operating stably and has entered a stable phase. The electronic device then performs fine-tuning and dynamic adjustments to the first migration threshold. In this case, the electronic device determines whether the current first migration threshold is lower than a first preset initial threshold. The first preset initial threshold can be the initial value of the first migration threshold.
[0110] If the first migration threshold is lower than the first preset initial threshold, the electronic device increases the first migration threshold, such as doubling the first migration threshold to quickly increase the first migration threshold.
[0111] Otherwise, if the first migration threshold is greater than or equal to the first preset initial threshold, the electronic device calculates the bandwidth utilization and access latency (i.e., access delay) of the local memory and CXL memory, and normalizes the obtained access latency of the local memory and CXL memory. Then, the electronic device calculates the migration benefit (i.e., migration benefit parameter) of the current adjustment period (such as the first adjustment period) based on the bandwidth utilization and access latency of the local memory and CXL memory, such as calculating the migration benefit of the current adjustment period according to formula (1).
[0112] If the migration gain of the current migration cycle is greater than 0 (i.e., the preset gain threshold), and the migration gain of the current migration cycle is greater than the migration gain of the previous adjustment cycle (such as the second adjustment cycle), the electronic device will increase the first migration threshold by 1 to obtain the adjusted first migration threshold. Otherwise, if the migration gain of the current migration cycle is less than or equal to 0, and the migration gain of the current migration cycle is less than or equal to the migration gain of the previous adjustment cycle, the electronic device will decrease the first migration threshold by 1 to obtain the adjusted first migration threshold.
[0113] If all local memory pages have not been completely replaced even once, it indicates that the electronic device is in its initial operational phase and local memory utilization is low. In this case, the electronic device calculates the migration benefit for the current adjustment period based on the bandwidth utilization and access latency of local memory and CXL memory. If the migration benefit for the current period is greater than 0 and greater than the migration benefit for the previous adjustment period, the electronic device increases the first migration threshold by 1 to obtain the adjusted first migration threshold. Otherwise, if the migration benefit for the current period is less than or equal to 0 and less than or equal to the migration benefit for the previous adjustment period, the electronic device decreases the first migration threshold by 1 to obtain the adjusted first migration threshold.
[0114] Through the above process, the first migration threshold can be dynamically adjusted adaptively using different adjustment strategies according to different stages of electronic device operation, thereby maximizing the benefits of hot page migration and improving the performance of electronic devices.
[0115] The above application example illustrates the dynamic adjustment process of the migration threshold using a first migration threshold as an example. In this embodiment, the electronic device can also dynamically adjust the second migration threshold. For example, if all local memory pages in the local memory have been replaced at least once, and the second migration threshold is greater than a second preset initial threshold, the electronic device will reduce the second migration threshold by half. As another example, if the migration gain of the current migration cycle is greater than 0, and the migration gain of the current migration cycle is greater than the migration gain of the previous adjustment cycle, the electronic device will decrease the second migration threshold by 1 to obtain the adjusted second migration threshold. Otherwise, if the migration gain of the current migration cycle is less than or equal to 0, and the migration gain of the current migration cycle is less than or equal to the migration gain of the previous adjustment cycle, the electronic device will increase the second migration threshold by 1 to obtain the adjusted second migration threshold.
[0116] The initial value of the second migration threshold (i.e., the second preset initial threshold) may be different from or the same as the initial value of the first migration threshold (i.e., the first preset initial threshold). This application embodiment does not limit this. The adjustment process of the second migration threshold is similar to the adjustment process of the first migration threshold, and will not be described again here.
[0117] In this application example, the size of the migration threshold affects the performance of the hybrid memory architecture. The migration benefit takes into account the memory bandwidth utilization and access latency. The migration threshold (i.e., the first migration threshold and the second migration threshold) is dynamically adjusted through the migration benefit to maximize the memory migration benefit and improve the memory read and write performance of electronic devices.
[0118] To implement the memory migration method provided in the embodiments of this application, the embodiments of this application also provide a memory migration apparatus, such as... Figure 6 As shown, the memory migration device includes: The acquisition module 61 is used to acquire the access frequency of the CXL memory page corresponding to the logical CXL memory; The decision module 62 is used to count the number of times the CXL memory page is accessed within a preset time period if the access frequency of the CXL memory page is greater than the first migration threshold. Migration module 63 is used to migrate the CXL memory page to the local memory when the number of accesses exceeds a first preset threshold.
[0119] In some alternative implementations, the decision module 62 is specifically used for: If the access frequency of the CXL memory page is greater than the first migration threshold, then the CXL memory page is migrated to the migration buffer. The number of accesses within a preset time period after the CXL memory page is migrated to the migration buffer is counted.
[0120] In some alternative implementations, the migration module 63 is specifically used for: If available memory pages exist in the local memory, the CXL memory pages are migrated to the local memory.
[0121] In some optional implementations, the decision module 62 is further configured to determine a first memory page in the local memory if no available memory page exists in the local memory, wherein the first memory page is the memory page with the lowest access frequency in the local memory at present. The migration module 63 is further configured to migrate the CXL memory page to the local memory after migrating the first memory page to the CXL memory if the access frequency of the CXL memory page is greater than the access frequency of the first memory page.
[0122] In some alternative implementations, the decision module 62 is further configured to: The migration benefit parameters for the first adjustment period and the second adjustment period are determined respectively; wherein, the second adjustment period is the previous migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used to evaluate memory performance. If the migration benefit parameter of the first adjustment period is greater than the preset benefit threshold, and the migration benefit parameter of the first adjustment period is greater than the migration benefit parameter of the second adjustment period, then the first migration threshold is increased. If the migration benefit parameter of the first adjustment period is less than or equal to the preset benefit threshold, or if the migration benefit parameter of the first adjustment period is less than or equal to the migration benefit parameter of the second adjustment period, then the first migration threshold is reduced.
[0123] In some alternative implementations, the decision module 62 is specifically used for: Obtain the status information of the local memory and the CXL memory page during the first adjustment period, wherein the status information includes bandwidth utilization and / or access latency; Based on the status information of the local memory and the CXL memory page during the first adjustment period, the migration benefit parameters for the first adjustment period are determined.
[0124] In some optional implementations, the acquisition module 61 is further configured to acquire the access frequency of local memory pages; wherein, the local memory page is a memory page in the local memory; The migration module 63 is further configured to migrate the local memory page to CXL memory if the access frequency of the local memory page is less than the second migration threshold.
[0125] In practical applications, the acquisition module 61 can be implemented by the communication interface in the memory migration device combined with the processor, and the decision module 62 and the migration module 63 can be implemented by the processor in the memory migration device.
[0126] It should be noted that the memory migration device provided in this application embodiment is only illustrated by the above-described division of program modules during memory migration. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the memory migration device and memory migration method provided in this application embodiment belong to the same concept, and their specific implementation process can be found in the method embodiment, which will not be repeated here.
[0127] Based on the hardware implementation of the above program modules, and in order to implement the method provided in the embodiments of this application, the embodiments of this application also provide an electronic device, such as... Figure 7 As shown, the electronic device includes: The communication interface 701 enables information exchange with other devices (such as CXL resource management server or CXL memory pool server); The processor 702 is connected to the communication interface 701 to enable information interaction with other devices (such as CXL resource management server or CXL memory pool server) and to execute the methods provided by one or more of the above technical solutions when running computer programs. The computer program is stored in memory 703, which includes local memory and logical CXL memory.
[0128] Specifically, the processor 702, in conjunction with the communication interface 701, obtains the access frequency of the CXL memory page corresponding to the logical CXL memory; The processor 702 is also used for: If the access frequency of the CXL memory page is greater than the first migration threshold, then the number of times the CXL memory page is accessed within a preset time period is counted. If the number of accesses exceeds a first preset threshold, the CXL memory page will be migrated to the local memory.
[0129] In some alternative implementations, the processor 702 is specifically used for: If the access frequency of the CXL memory page is greater than the first migration threshold, then the CXL memory page is migrated to the migration buffer; The number of accesses within a preset time period after the CXL memory page is migrated to the migration buffer is counted.
[0130] In some alternative implementations, the processor 702 is specifically used for: If available memory pages exist in the local memory, the CXL memory pages are migrated to the local memory.
[0131] In some alternative implementations, the processor 702 is further configured to: If there are no available memory pages in the local memory, then the first memory page in the local memory is determined, wherein the first memory page is the memory page with the lowest access frequency in the local memory at present; If the access frequency of the CXL memory page is greater than that of the first memory page, then after migrating the first memory page to the CXL memory, the CXL memory page is migrated to the local memory.
[0132] In some alternative implementations, the processor 702 is further configured to: The migration benefit parameters for the first adjustment period and the second adjustment period are determined respectively; wherein, the second adjustment period is the previous migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used to evaluate memory performance. If the migration benefit parameter of the first adjustment period is greater than the preset benefit threshold, and the migration benefit parameter of the first adjustment period is greater than the migration benefit parameter of the second adjustment period, then the first migration threshold is increased. If the migration benefit parameter of the first adjustment period is less than or equal to the preset benefit threshold, or if the migration benefit parameter of the first adjustment period is less than or equal to the migration benefit parameter of the second adjustment period, then the first migration threshold is reduced.
[0133] In some alternative implementations, the processor 702 is specifically used for: Obtain the status information of the local memory and the CXL memory page during the first adjustment period, wherein the status information includes bandwidth utilization and / or access latency; Based on the status information of the local memory and the CXL memory page during the first adjustment period, the migration benefit parameters for the first adjustment period are determined.
[0134] In some alternative implementations, the processor 702 is further configured to: Obtain the access frequency of local memory pages; wherein, the local memory page is a memory page in the local memory; If the access frequency of the local memory page is less than the second migration threshold, the local memory page will be migrated to CXL memory.
[0135] It should be noted that the specific processing procedures of the processor 702 and the communication interface 701 can be understood by referring to the above method.
[0136] Of course, in practical applications, the various components in an electronic device are coupled together through a bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 7 The general designated all buses as Bus System 704.
[0137] The memory 703 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.
[0138] The methods disclosed in the embodiments of this application can be applied to the processor 702, or implemented by the processor 702. For example, the processor 702 is the main processor, including a central processing unit and a memory controller. The processor 702 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 702 or by instructions in the form of software. The processor 702 can be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 702 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, which is located in the memory 703. The processor 702 reads the information in the memory 703 and completes the steps of the aforementioned method in combination with its hardware.
[0139] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0140] It is understood that the memory 703 in this embodiment can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0141] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 703 storing a computer program, which can be executed by a processor 702 of an electronic device to complete the steps described in the foregoing method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0142] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a processor 702 of an electronic device to perform the steps described in the foregoing method.
[0143] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0144] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0145] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. A memory migration method, characterized in that, Applied to an electronic device, the electronic device including local memory and logical CXL memory; the method includes: Obtain the access frequency of the CXL memory page corresponding to the logical CXL memory; If the access frequency of the CXL memory page is greater than the first migration threshold, then the number of times the CXL memory page is accessed within a preset time period is counted. If the number of accesses exceeds a first preset threshold, the CXL memory page will be migrated to the local memory.
2. The method according to claim 1, characterized in that, The electronic device further includes a migration buffer for caching data; if the access frequency of the CXL memory page is greater than a first migration threshold, the number of accesses to the CXL memory page within a preset time period is counted, including: If the access frequency of the CXL memory page is greater than the first migration threshold, then the CXL memory page is migrated to the migration buffer; The number of accesses within a preset time period after the CXL memory page is migrated to the migration buffer is counted.
3. The method according to claim 1, characterized in that, The step of migrating the CXL memory page to the local memory includes: If available memory pages exist in the local memory, the CXL memory pages are migrated to the local memory.
4. The method according to claim 3, characterized in that, The method further includes: If there are no available memory pages in the local memory, then the first memory page in the local memory is determined, wherein the first memory page is the memory page with the lowest access frequency in the local memory at present; If the access frequency of the CXL memory page is greater than that of the first memory page, then after migrating the first memory page to the CXL memory, the CXL memory page is migrated to the local memory.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: The migration benefit parameters for the first adjustment period and the second adjustment period are determined respectively; wherein, the second adjustment period is the previous migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used to evaluate memory performance. If the migration benefit parameter of the first adjustment period is greater than the preset benefit threshold, and the migration benefit parameter of the first adjustment period is greater than the migration benefit parameter of the second adjustment period, then the first migration threshold is increased. If the migration benefit parameter of the first adjustment period is less than or equal to the preset benefit threshold, or if the migration benefit parameter of the first adjustment period is less than or equal to the migration benefit parameter of the second adjustment period, then the first migration threshold is reduced.
6. The method according to claim 5, characterized in that, Determine the migration benefit parameters for the first adjustment period, including: Obtain the status information of the local memory and the CXL memory page during the first adjustment period, wherein the status information includes bandwidth utilization and / or access latency; Based on the status information of the local memory and the CXL memory page during the first adjustment period, the migration benefit parameters for the first adjustment period are determined.
7. The method according to claim 1, characterized in that, The method further includes: Obtain the access frequency of local memory pages; wherein, the local memory page is a memory page in the local memory; If the access frequency of the local memory page is less than the second migration threshold, the local memory page will be migrated to CXL memory.
8. An electronic device, characterized in that, include: A processor and memory for storing computer programs capable of running on the processor, the memory including local memory and logical CXL memory; When the processor is used to run a computer program, it executes the steps of the method according to any one of claims 1 to 7.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.