CN-122019404-A - Memory migration method, electronic device, storage medium and computer program product
Abstract
The application provides a memory migration method, electronic equipment, a storage medium and a computer program product, wherein the method comprises the steps of obtaining access frequency of CXL memory pages corresponding to a logic CXL memory, counting the access times of the CXL memory pages within a preset time period if the access frequency of the CXL memory pages is larger than a first migration threshold value, and migrating the CXL memory pages to a local memory if the access times of the CXL memory pages within the preset time period are larger than a first preset time threshold value. By the method and the device, unnecessary memory migration can be reduced, and the performance of the electronic equipment is improved.
Inventors
- ZHOU TONG
- WANG SHANLONG
- JIA YU
- QIAN LING
Assignees
- 中移(苏州)软件技术有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260127
Claims (10)
- 1. The memory migration method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a local memory and a logic CXL memory, and the method comprises the following steps: acquiring the access frequency of CXL memory pages corresponding to the logic CXL memory; If the access frequency of the CXL memory page is greater than a first migration threshold value, counting the access times of the CXL memory page within a preset duration; and under the condition that the access times are larger than a first preset times threshold value, migrating the CXL memory page to the local memory.
- 2. The method of claim 1, wherein the electronic device further comprises a migration buffer, the migration buffer is configured to buffer data, and if the access frequency of the CXL memory page is greater than a first migration threshold, counting the number of accesses of the CXL memory page within a preset duration, the method comprises: if the access frequency of the CXL memory page is greater than a first migration threshold, migrating the CXL memory page to the migration buffer area; and counting the access times in a preset time period after the CXL memory page is migrated to the migration buffer zone.
- 3. The method of claim 1, wherein said migrating the CXL memory page to the local memory comprises: and if the available memory page exists in the local memory, migrating the CXL memory page to the local memory.
- 4. A method according to claim 3, characterized in that the method further comprises: If the local memory does not have the available memory pages, determining a first memory page in the local memory, wherein the first memory page is the memory page with the lowest access frequency in the current local memory; and if the access frequency of the CXL memory page is greater than that of the first memory page, after the first memory page is migrated 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, further comprising: Determining migration benefit parameters of a first adjustment period and a second adjustment period respectively, wherein the second adjustment period is the last migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used for evaluating the performance of a memory; If the migration benefit parameter of the first adjustment period is greater than a 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, increasing the first migration threshold; And if the migration benefit parameter of the first adjustment period is smaller than or equal to a preset benefit threshold, or the migration benefit parameter of the first adjustment period is smaller than or equal to the migration benefit parameter of the second adjustment period, reducing the first migration threshold.
- 6. The method of claim 5, wherein determining a migration benefit parameter for the first adjustment period comprises: acquiring state information of the local memory and the CXL memory page in the first adjustment period, wherein the state information comprises bandwidth utilization rate and/or access time delay; and determining migration benefit parameters of the first adjustment period according to the state information of the local memory and the CXL memory page.
- 7. The method according to claim 1, wherein the method further comprises: acquiring access frequency of a local memory page, wherein the local memory page is a memory page in the local memory; and if the access frequency of the local memory page is smaller than a second migration threshold, migrating the local memory page to the CXL memory.
- 8. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, the memory comprising a local memory and a logical CXL memory; wherein the processor is adapted to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
- 9. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 7.
- 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Description
Memory migration method, electronic device, storage medium and computer program product Technical Field The present application relates to the field of memory management technologies, and in particular, to a memory migration method, an electronic device, a storage medium, and a computer program product. Background With the rapid development of the technical fields of artificial intelligence, cloud computing and the like, the performance of a processor of electronic equipment is also continuously increased. However, the increase in memory performance of electronic devices is far behind processors, thereby limiting the overall performance of the electronic devices. To cope with this problem, fast links (CXL, compute Express Link) have been calculated. CXL is a high-speed interconnect protocol for efficient communication between hardware components such as processors, memory, etc. In recent years, CXL (chip on Ethernet) implemented by Ethernet has further expanded the application boundary of CXL. The COE enables the electronic device to access the remote CXL storage device across the cabinet, thereby laying a foundation for realizing large-scale memory resources. This has spawned a hybrid storage architecture consisting of local memory and CXL memory. To fully utilize the hybrid storage architecture, performance of the hybrid storage architecture is typically improved by memory migration. However, the current memory migration scheme may cause unnecessary memory migration, resulting in performance degradation of the electronic device. Disclosure of Invention In order to solve the related technical problems, embodiments of the present application provide a memory migration method, an electronic device, a storage medium, and a computer program product. The technical scheme of the embodiment of the application is realized as follows: The embodiment of the application provides a memory migration method which is applied to electronic equipment, wherein the electronic equipment comprises a local memory and a logic CXL memory, and the method comprises the following steps: acquiring the access frequency of CXL memory pages corresponding to the logic CXL memory; If the access frequency of the CXL memory page is greater than a first migration threshold value, counting the access times of the CXL memory page within a preset duration; and under the condition that the access times are larger than a first preset times threshold value, migrating the CXL memory page to the local memory. In the above scheme, the electronic device further includes a migration buffer area, the migration buffer area is used for caching data, and if the access frequency of the CXL memory page is greater than a first migration threshold, counting the number of accesses of the CXL memory page within a preset duration includes: if the access frequency of the CXL memory page is greater than a first migration threshold, migrating the CXL memory page to the migration buffer area; and counting the access times in a preset time period after the CXL memory page is migrated to the migration buffer zone. In the above solution, the migrating the CXL memory page to the local memory includes: and if the available memory page exists in the local memory, migrating the CXL memory page to the local memory. In the above scheme, the method further comprises: If the local memory does not have the available memory pages, determining a first memory page in the local memory, wherein the first memory page is the memory page with the lowest access frequency in the current local memory; and if the access frequency of the CXL memory page is greater than that of the first memory page, after the first memory page is migrated to the CXL memory, the CXL memory page is migrated to the local memory. In the above scheme, the method further comprises: Determining migration benefit parameters of a first adjustment period and a second adjustment period respectively, wherein the second adjustment period is the last migration threshold adjustment period of the first adjustment period, and the migration benefit parameters are used for evaluating the performance of a memory; If the migration benefit parameter of the first adjustment period is greater than a 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, increasing the first migration threshold; And if the migration benefit parameter of the first adjustment period is smaller than or equal to a preset benefit threshold, or the migration benefit parameter of the first adjustment period is smaller than or equal to the migration benefit parameter of the second adjustment period, reducing the first migration threshold. In the above solution, determining the migration benefit parameter of the first adjustment period includes: acquiring state information of the local memory and the CXL memory page in the first adjustment p