Memory data migration method, related device and computer equipment

By identifying hot pages and cold pages according to the statistical pattern of memory media type in computer equipment, the problem of inaccurate recognition of page access in the prior art is solved, and the data migration performance and system data processing speed are improved.

CN119166035APending Publication Date: 2024-12-20HUAWEI TECH CO LTD

Patent Information

Application Number
CN202311133455.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-06-20
Filing Date
2023-09-01
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The prior art cannot promptly and accurately identify whether the page is a frequently accessed page, resulting in memory with fast access speeds that may store data that is not frequently accessed, or memory with slow access speeds may store data that is frequently accessed, affecting the I of the system. /O performance and data processing speed.

Method used

By using the statistical mode statistics page access results associated with the type of memory media accessed by the access request, the hot page statistics mode and the cold page statistics mode are used to identify the hot page and the cold page respectively, reducing the amount of data of the page access result, reducing the storage space and Bandwidth consumption improves storage space utilization and data migration performance.

Benefits of technology

It realizes timely and accurately identifying the frequent access of pages, reducing data processing delays and improving the system's data processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166035A_ABST
    Figure CN119166035A_ABST
Patent Text Reader

Abstract

The invention discloses a memory data migration method, a related device and computer equipment, and relates to the field of computers. The method comprises the steps of counting an access result of a page according to a statistical mode associated with the type of a memory medium accessed by an access request so as to determine the access heat of the page according to the access result of the page, and triggering memory data migration between at least two different types of memory media according to the access heat of the page. Therefore, the page access frequency can be counted timely and accurately, the consumption of the storage space and the bandwidth is reduced by reducing the data volume of the access result of the page, and the utilization rate of the storage space and the data migration performance are improved. Therefore, the data processing speed of the system is improved, and the data processing time delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on June 20, 2023, with application number 202310733172.9 and application name “A Method for Identifying Hot and Cold Pages”. The entire contents of these applications are incorporated by reference into this application. Technical Field

[0002] The present application relates to the computer field, and in particular to a memory data migration method, related devices and computer equipment. Background Art

[0003] At present, data migration is performed based on memory access heat, that is, it is hoped that a memory with a fast access speed stores frequently accessed data, and a memory with a slow access speed stores infrequently accessed data. For example, memory data migration is triggered based on the access heat of a page. However, it is impossible to accurately identify whether a page is a frequently accessed page in a timely manner. As a result, a memory with a fast access speed may store infrequently accessed data, or a memory with a slow access speed may store frequently accessed data, which affects the system input / output (I / O) performance, as well as the system's data processing speed and latency. Summary of the invention

[0004] The present application provides a memory data migration method, related devices and computer equipment, thereby improving the data processing speed of the system and reducing the data processing delay.

[0005] In a first aspect, a method for memory data migration is provided, the method being executed by a controller in a computer device, the method comprising: counting page access results according to a statistical mode associated with the type of memory medium accessed by an access request, so as to determine the access heat of the page according to the page access results, and triggering memory data migration between at least two different types of memory media according to the page access heat. The access request is used to indicate the operation of the memory medium by an application program running on a processor in the computer device. The statistical mode comprises at least one of a cold page statistical mode and a hot page statistical mode. For example, the page access results are counted according to a cold page statistical mode associated with the type of memory medium accessed by an access request, or the page access results are counted according to a hot page statistical mode associated with the type of memory medium accessed by an access request.

[0006] Compared to determining the memory access heat by counting the access frequency of the page. Since the data volume of the page access frequency is large, the required storage space and bandwidth consumption are large, and the processor in the computer device also analyzes the access frequency of the page to determine the access heat of the page, resulting in the consumption of more computing resources. Alternatively, compared to periodically scanning the access bit (Access Bit) in the page table entry (Page Table Entry, PTE) to determine the access heat of the page. Since only whether the page is accessed can be determined based on the access bit, it is impossible to timely and accurately identify whether the page is a frequently accessed page. Therefore, it is impossible to timely and accurately identify whether the page is a hot page or a cold page.

[0007] The solution provided by the present application uses different statistical methods to count the frequency of page access for different types of memory media. For example, different statistical methods are used to count the frequency of page access for hot pages and cold pages, that is, hot pages are counted based on the hot page statistical mode, and cold pages are counted based on the cold page statistical mode. Thus, it is possible to timely and accurately count the frequency of page access, reduce the consumption of storage space and bandwidth by reducing the amount of data in the page access results, and improve the utilization rate of storage space and data migration performance. This improves the data processing speed of the system and reduces the data processing delay.

[0008] In one possible implementation, a hot page statistics mode counts page access results according to a statistics mode associated with the type of memory medium accessed by an access request, including: updating a hot page window according to an address indicated by the access request, the hot page window being used to record frequently accessed pages based on a page access order.

[0009] In another possible implementation, the hot page window is used to indicate replacement of pages in the hot page window based on a page access sequence, so as to record frequently accessed pages.

[0010] Therefore, frequently accessed pages are identified based on the hot page statistical pattern, ensuring timely and accurate statistics of hot pages, reducing the storage space occupied by the access results of hot pages, reducing bandwidth consumption, and improving storage space utilization and data migration performance.

[0011] In another possible implementation, the hot page statistics mode counts page access results according to a statistics mode associated with the type of memory medium accessed by the access request, including: updating a saturation counter of a page associated with the address indicated by the access request, the saturation counter being used to count the access frequency of the page.

[0012] In this way, based on the saturation counter to count the access frequency of the page, only the number of times the saturation counter records needs to be counted, which reduces the storage space occupied by the access results of the hot pages, reduces the bandwidth consumption, and improves the utilization of the storage space and data migration performance.

[0013] In another possible implementation, the method further includes: when the saturation counter overflows, determining that the page is a hot page and feeding back an identification that the page is a hot page; when the saturation counter does not overflow, determining that the page is a cold page and feeding back an identification that the page is a cold page.

[0014] Therefore, by feeding back the hot page identifier and the cold page identifier, the amount of feedback data is reduced, bandwidth consumption is reduced, transmission efficiency is improved, and data migration performance is improved. This avoids the processor analyzing the page access frequency to determine the page access popularity, which results in more computing resources being consumed.

[0015] In another possible implementation, a cold page statistics mode counts page access results according to a statistics mode associated with the type of memory medium accessed by an access request, including: updating an indication bit of a page associated with an address indicated by an access request, the indication bit of the page being used to indicate that the page is accessed.

[0016] Therefore, based on the cold page statistical pattern, pages that are not frequently accessed are identified to ensure timely and accurate statistics of cold pages, reduce the storage space occupied by the access results of cold pages, reduce bandwidth consumption, and improve storage space utilization and data migration performance.

[0017] In another possible implementation, the method further includes: performing information entropy processing on the indicator bits of the multiple pages according to the spatial local features of the multiple pages accessed by the processor to obtain processed data, the processed data being used to indicate the indicator bits of the multiple pages; and storing the processed data.

[0018] Thus, information entropy processing is performed on the indicator bits of multiple pages, further reducing the data volume of the indicator bits of multiple pages, reducing the storage space occupied by the access results of cold pages, and reducing bandwidth consumption, thereby improving the utilization of storage space and data migration performance.

[0019] In another possible implementation, indicator bits of multiple pages are processed according to spatial local characteristics of multiple pages accessed by a processor, including: processing address indexes of multiple pages and indicator bits of multiple pages according to a storage efficiency target to obtain processed data, and the storage efficiency target is used to indicate the utilization rate of storing valid data in a limited storage space.

[0020] In another possible implementation, the method further includes: determining the type of memory medium accessed by the access request according to an address included in the access request.

[0021] In another possible implementation, the page access result is stored in a storage medium of a computer device, so that a processor in the computer device can obtain the page access result as quickly as possible, and trigger memory data migration between at least two different types of memory media according to the page access popularity determined by the page access result.

[0022] In another possible implementation, the method further includes: compressing the access result of the page to obtain compressed data; and feeding back the compressed data. Thus, bandwidth consumption is further reduced and transmission efficiency is improved, so that the out-of-band communication method will not become a bottleneck, and the performance of cold and hot migration is improved.

[0023] In a second aspect, a memory data migration device is provided, the memory data migration device comprising modules for executing the memory data migration method in the first aspect or any possible design of the first aspect. For example, the memory data migration device comprises a communication module, a statistics module and a migration module.

[0024] A communication module is used to obtain an access request, where the access request is used to instruct an application program running on a processor in a computer device to operate on a memory medium; a statistical module is used to count page access results according to a statistical mode associated with the type of memory medium accessed by the access request, where the page access results are used to determine page access popularity, where the statistical mode includes at least one of a cold page statistical mode and a hot page statistical mode; and a migration module is used to trigger memory data migration between at least two different types of memory media according to the access results.

[0025] In one possible implementation, in a hot page statistics mode, when a statistics module counts page access results according to a statistics mode associated with the type of memory medium accessed by an access request, it is specifically used to: update a hot page window according to the address indicated by the access request, and the hot page window is used to record frequently accessed pages based on the page access order.

[0026] In another possible implementation, the hot page window is used to indicate replacement of pages in the hot page window based on a page access sequence, so as to record frequently accessed pages.

[0027] In another possible implementation, in the hot page statistics mode, when the statistics module counts the access results of the page according to the statistics mode associated with the type of memory medium accessed by the access request, it is specifically used to: update the saturation counter of the page associated with the address indicated by the access request, and the saturation counter is used to count the access frequency of the page.

[0028] In another possible implementation, the communication module is further configured to: when the saturation counter overflows, feedback an identifier that the page is a hot page; when the saturation counter does not overflow, feedback an identifier that the page is a cold page.

[0029] In another possible implementation, in the cold page statistics mode, when the statistics module counts the access results of the page according to the statistics mode associated with the type of memory medium accessed by the access request, it is specifically used to: update the indication bit of the page associated with the address indicated by the access request, and the indication bit of the page is used to indicate that the page is accessed.

[0030] In another possible implementation, the statistical module is also used to perform information entropy processing on the indicator bits of multiple pages according to the spatial local characteristics of the multiple pages accessed by the processor to obtain processed data, and the processed data is used to indicate the indicator bits of the multiple pages; and the processed data is stored.

[0031] In another possible implementation, when the statistical module processes the indicator bits of multiple pages according to the spatial local characteristics of multiple pages accessed by the processor, it is specifically used to: process the address indexes of multiple pages and the indicator bits of multiple pages according to a storage efficiency target to obtain processed data, and the storage efficiency target is used to indicate the utilization rate of storing valid data in a limited storage space.

[0032] In another possible implementation, the statistical module is further configured to determine the type of memory medium accessed by the access request according to the address included in the access request.

[0033] In another possible implementation, the access result of the page is stored in a storage medium of the computer device.

[0034] In another possible implementation, the migration module is also used to compress the page access results to obtain compressed data and feed back the compressed data, thereby further reducing bandwidth consumption and improving transmission efficiency, so that the out-of-band communication method will not become a bottleneck, and improving the performance of cold and hot migration.

[0035] In a third aspect, a memory is provided, which includes a storage medium and a controller, the storage medium is used to store a set of computer instructions; when the controller executes the set of computer instructions, the operating steps of the method in the first aspect or any possible implementation of the first aspect are executed to realize the identification of the access popularity of the page in the memory.

[0036] In a fourth aspect, a controller is provided, which is used to execute the operating steps of the method in the first aspect or any possible implementation of the first aspect to realize the identification of the access heat of the page in the memory.

[0037] In a fifth aspect, a processor is provided, the processor including at least two different types of memory media associated therewith, and the processor is used to execute the operating steps of the method in the first aspect or any possible implementation of the first aspect to realize the identification of the access heat of the page in the memory.

[0038] In a sixth aspect, a computer device is provided, which includes a memory, multiple different types of memory media and a processor, the memory being used to store a set of computer instructions; when the processor executes the set of computer instructions, the processor is used to execute the operating steps of the method in the first aspect or any possible implementation of the first aspect to realize identifying the access heat of pages in the memory.

[0039] In the seventh aspect, a computer-readable storage medium is provided, comprising: computer software instructions; when the computer software instructions are executed in a processor, the processor executes the operating steps of the method described in the first aspect or any possible implementation of the first aspect.

[0040] In an eighth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the operation steps of the method described in the first aspect or any possible implementation manner of the first aspect.

[0041] The technical effects brought about by any design method in the second to eighth aspects can refer to the technical effects brought about by the first aspect or different design methods in the first aspect, and will not be repeated here.

[0042] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic diagram of the composition of a computer device provided for this application;

[0044] Figure 2 A schematic diagram of the relationship between address and access frequency provided for this application;

[0045] Figure 3 A schematic diagram of various types of memory media deployment and data migration provided for this application;

[0046] Figure 4 A schematic diagram of a memory access heat statistics scenario provided for this application;

[0047] Figure 5 A flowchart of a memory data migration method provided in this application;

[0048] Figure 6 A schematic diagram of hot page identification provided by this application;

[0049] Figure 7 A schematic diagram of hot page identification provided by this application;

[0050] Figure 8 A schematic diagram of address clipping provided for this application;

[0051] Fig. 9 A schematic diagram of cold page identification and cold page information entropy processing provided by this application;

[0052] Fig.10 A schematic diagram of a memory data migration process provided by this application;

[0053] Fig.11 A schematic diagram of a memory data migration process provided by this application;

[0054] Fig.12 A schematic diagram of a memory data migration process provided by this application;

[0055] Fig.13 A schematic diagram of a memory data migration process provided by this application;

[0056] Fig.14 A schematic diagram of the structure of a memory data migration device provided in this application. DETAILED DESCRIPTION

[0057] To facilitate understanding, the main terms involved in this application are first explained.

[0058] In the hierarchy of computer storage systems, the closer the memory is to the processor, the faster the access speed and the smaller the storage capacity. Based on the order from closest to farthest from the processor, the memory is divided into: registers, cache memory, main memory, external memory.

[0059] Main memory, also known as internal memory, is abbreviated as main memory or memory. Main memory is an important component of the computer system, that is, the bridge for communication between external memory and processor. Main memory is used to temporarily store the calculation data in the processor and the data exchanged between the processor and external memory such as hard disk. For example, when the computer starts running, the data to be calculated is loaded from the main memory to the processor for calculation. After the calculation is completed, the processor stores the calculation result in the main memory. For example, main memory includes dynamic random access memory (DRAM) and double data rate synchronous dynamic random access memory (DDR SDRAM).

[0060] External storage, also known as auxiliary storage, is referred to as external storage or auxiliary storage for short. Compared with main storage, external storage has a large storage capacity and a slow access speed. For example, external storage includes network storage, solid state disk (SSD), and hard disk drive (HDD).

[0061] Cache memory is a high-speed, small-capacity memory between the processor and the main memory. Cache memory is referred to as cache. Compared with the main memory, the cache has a small storage capacity and a fast access speed. The cache includes the first-level cache (L1 cache), the second-level cache (L2 cache), and the third-level cache (L3 cache). The first-level cache is set inside the processor core. The second-level cache can be set inside or outside the processor core. The first-level cache and the second-level cache are usually exclusive to the processor core where they are located. The third-level cache is generally set outside the processor core and shared by multiple processor cores.

[0062] A register is a small memory located inside a processor, which is used to temporarily store the data and results of operations. A register can be a commonly used sequential logic circuit.

[0063] Hierarchical Storage Technology (HST) stores data in different storage devices with different performances in different ways according to data importance, access frequency, retention time, storage capacity, performance and other indicators, and realizes automatic migration of data between storage media through hierarchical storage management.

[0064] Hot data refers to data that is frequently accessed by the processor. If hot data is stored in a memory close to the processor, the processor can obtain the data as quickly as possible, which increases the data processing speed of the system and reduces the data processing delay, significantly improving the access performance of the system.

[0065] Cold data refers to data that is not frequently accessed by the processor. If cold data is stored in a memory far away from the processor, more data can be stored, and the memory close to the processor can store more hot data, thereby improving storage resource utilization and reducing system costs.

[0066] A cache line is a unit in which a computer device reads or writes memory. The size of a cache line can be 64 bytes.

[0067] Page refers to the unit in which a computer device manages the storage space of memory. For example, the page size (pagesize) is 4 kilobytes (KB), 2 megabytes (MB), or other byte sizes. A 4KB page can be called a small page. A 2MB page can be called a large page. The smaller the page, the more resources the computer device needs to manage memory; the larger the page, the fewer resources the computer device needs to manage memory. A page can include multiple cache lines, that is, the page size is a multiple of the cache line size.

[0068] In order to improve the data processing speed of the system and reduce the data processing delay, the present application provides a memory data migration method, which is applied to a hybrid memory system, the hybrid memory system includes multiple processors and multiple different types of memory media, and the processor is associated with at least two different types of memory media. The method includes: according to the statistical mode associated with the type of memory medium accessed by the access request, the access result of the page is counted, so as to determine the access heat of the page according to the access result of the page, and trigger the memory data migration between at least two different types of memory media according to the access heat of the page. Thus, different statistical methods are used for different memory media to count the frequency of page access, so as to achieve timely and accurate identification of hot pages and cold pages, reduce the consumption of storage space and bandwidth by reducing the data volume of the page access results, and improve the utilization rate of storage space and data migration performance. Thus, the data processing speed of the system is improved, and the data processing delay is reduced. Avoid determining the memory access heat only by counting the access frequency of the page, because the data volume of the page access frequency is large, the required storage space and bandwidth consumption is large, or only determine whether the page is accessed based on the access bit of the page, and cannot timely and accurately identify whether the page is a frequently accessed page.

[0069] The memory data migration method provided in this application can be applied to fields such as artificial intelligence, big data, cloud computing, and scenarios containing multiple types of storage media, such as high-performance, large-capacity storage systems.

[0070] The implementation methods of the present application are described in detail below with reference to the accompanying drawings.

[0071] Figure 1 A schematic diagram of the composition of a computer device provided in this application. Figure 1 As shown, computer device 100 includes a processor 110 .

[0072] The processor 110 is the control center of the computer device 100. The processor 110 can be a computing unit with computing power such as a central processing unit (CPU), a graphics processing unit (GPU), a data processing unit (DPU), a neural processing unit (NPU), and an embedded neural network processor (NPU). The processor 110 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), systems on chip (SoC) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor, etc. For ease of description, the following embodiments are described by taking the processor 110 as a CPU as an example.

[0073] Figure 1 The computer device 100 may include one or more processors (e.g., processor 110 and processor 130). The processor may be a multi-core processor, that is, the processor includes one processor core or multiple processor cores. For example, Figure 1 The processor 110 shown in FIG. 1 includes N processor cores. A processor herein may refer to one or more devices, circuits, and / or computing units for processing data (eg, computer program instructions).

[0074] As the number of cores of a single processor increases, the computing speed of the processor also increases, and the processor's demand for memory access speed and memory capacity is also increasing. In one possible implementation, multiple different types of storage media are used together as the main memory (referred to as: memory or main memory) of a computer device to increase memory capacity, and allocate as much memory resources and memory bandwidth as possible from the memory to each processor core to meet the processor's demand for memory access speed and memory capacity. A system that uses multiple different types of storage media as memory can be called a hybrid memory system. The storage medium used as memory in a hybrid memory system can be called a memory medium. A processor can be associated with at least one type of memory medium, that is, some processors are associated with one type of memory medium, and some processors are associated with two or more types of memory medium.

[0075] For example, a computer device includes multiple different types of memory media. The multiple different types of memory media include a first memory medium and a second memory medium, the storage capacity of the first memory medium is lower than the storage capacity of the second memory medium, the access speed of the first memory medium is higher than the access speed of the second memory medium, the access delay of the first memory medium is lower than the access delay of the second memory medium, and the cost of the first memory medium is higher than the cost of the second memory medium.

[0076] The first memory medium may include a dynamic random access memory (DRAM). The second memory medium is a storage-class memory (SCM), and the SCM includes at least one of a phase-change memory (PCM), a magnetic random access memory (MRAM), a resistive random access memory (RRAM / ReRAM), a ferroelectric random access memory (FRAM), a fast NAND, or a nano-RAM (Nano-RAM, NRAM).

[0077] By way of example, the various types of memory media used as the main memory 120 in the computer device 100 include DRAM 121 and SCM 122. The processor 110 is connected to the DRAM 121 and the SCM 122 via an interface supporting memory semantics.

[0078] The processor 110 is used to run an application program to perform a read operation or a write operation on a memory medium (eg, DRAM 121, SCM 122), and to trigger data migration according to the access hotness or coldness of the memory medium.

[0079] Triggering data migration based on the access hotness of the memory medium can be alternatively described as triggering data migration based on the access hotness of the data stored in the memory medium. Data migration includes migrating cold data to the next level memory medium and migrating hot data to the previous level memory medium.

[0080] For example, when the cache line is cold data, the memory medium where the cache line is located is DRAM, and the cache line is migrated to the SCM.

[0081] For another example, when the cache line is hot data, the memory medium where the cache line is located is SCM, and the cache line is migrated to DRAM.

[0082] Understandably, any level of memory medium in the computer device can trigger data migration based on the degree of data access. Each memory medium migrates data level by level based on the degree of data access. Compared with the current memory medium, the storage capacity of the next level of memory medium is larger; the access speed of the previous level of memory medium is faster.

[0083] In some embodiments, the computer device counts pages according to the memory access tracking (MAT) method, that is, the page access frequency is counted with the page (such as 4KB page, 2MB page) as the granularity, which is compatible with the computer device's page management method for memory, so that the memory data migration method is easy to use. For example, the processor operates the memory medium with the cache line as the granularity, and the cache line belongs to a certain page under management. Then the cache line in the memory medium is operated once, and the page to which the cache line belongs is also read and written once. The controller counts the access frequency of the page to which the cache line is operated to identify the access heat of the page. However, since the data volume of the page access frequency is large, the required storage space and bandwidth consumption are large, and the controller needs to process the page access frequency to obtain the hot and cold properties of the page, the memory access heat recognition efficiency is low, resulting in the memory data migration efficiency affecting the data processing speed and latency of the system.

[0084] In some other embodiments, the computer device periodically scans the access bit in the page table entry (PTE) to determine whether the page is accessed based on the access bit. However, it is not possible to accurately identify whether the page is a frequently accessed page in a timely manner. Moreover, frequent scanning of the page table entry results in the consumption of more computing resources (such as CPU resources).

[0085] It should be noted that by analyzing the behavior of the processor accessing the memory medium, for example, by sorting the addresses according to the access frequency of the addresses of the memory medium, the following can be obtained: Figure 2 The relationship between the address and the access frequency shown in Figure 1 is Figure 2 It can be seen that most pages are not accessed by the processor or are accessed in small quantities, and a small number of pages are frequently accessed by the processor. According to the access frequency of the page, the page can be divided into cold pages and hot pages. The frequently accessed page can be called a hot page. The hot page can contain hot data. The page that is not frequently accessed can be called a cold page. The cold page can contain cold data.

[0086] Optionally, pages can be divided into more levels according to the access frequency of the pages. For example, a page that has never been accessed is called an absolutely cold page. A page that is accessed less frequently is called a relatively cold page. A page that is accessed more frequently than a relatively cold page and less frequently than a hot page can be called a warm page.

[0087] Since only a small number of pages are frequently accessed during the process of memory medium access, and most pages are not accessed by the processor or are accessed in small quantities, there is only a small amount of valid data in the storage space used to store the access frequency. The small amount of valid data may refer to the access frequency of frequently accessed pages, resulting in low utilization of the storage space.

[0088] In the present application, the processor 110 is used to count the access results of the page according to the statistical mode associated with the type of memory medium accessed by the access request, so as to determine the access popularity of the page according to the access results of the page and trigger data migration according to the access popularity.

[0089] For example, the statistical mode may include at least one of a cold page statistical mode and a hot page statistical mode. The processor 110 is used to count the access results of the page according to the cold page statistical mode associated with the type of the memory medium accessed by the access request, or the processor 110 is used to count the access results of the page according to the hot page statistical mode associated with the type of the memory medium accessed by the access request, or the processor 110 is used to count the access results of the page according to the cold page statistical mode and the hot page statistical mode associated with the type of the memory medium accessed by the access request.

[0090] Optionally, the present application does not limit the division method of the statistical mode. More types of modes can be divided. For example, the statistical mode can include at least one of a cold page statistical mode, a warm page statistical mode, or a hot page statistical mode.

[0091] For example, Figure 3As shown, it is assumed that the processor 110 is associated with three different types of memory media, which are memory medium 1, memory medium 2, and memory medium 3, respectively, in order from near to far from the processor 110. The level of memory medium 1 is higher than the level of memory medium 2; the level of memory medium 2 is higher than the level of memory medium 3. For example, memory medium 1 is a first-level memory medium, memory medium 2 is a second-level memory medium, and memory medium 3 is a third-level memory medium.

[0092] Generally, the storage capacity of memory medium 1 is lower than the storage capacity of memory medium 2, the access speed of memory medium 1 is higher than the access speed of memory medium 2, the access delay of memory medium 1 is lower than the access delay of memory medium 2, and the cost of memory medium 1 is higher than the cost of memory medium 2. The storage capacity of memory medium 2 is lower than the storage capacity of memory medium 3, the access speed of memory medium 2 is higher than the access speed of memory medium 3, the access delay of memory medium 2 is lower than the access delay of memory medium 3, and the cost of memory medium 2 is higher than the cost of memory medium 3.

[0093] Memory medium 1 is used to store frequently accessed hot data. Cold data that is not frequently accessed can be migrated to memory medium 2. The cold page statistics mode can be used to count the access results of pages in memory medium 1, identify cold pages to trigger data migration, and thus ensure the statistical accuracy of cold pages.

[0094] Memory medium 3 is used to store cold data that is not frequently accessed. Frequently accessed hot data can be migrated to memory medium 2. Then, the hot page statistics mode can be used to count the access results of pages in memory medium 3, identify hot pages, and trigger data migration, thereby ensuring the accuracy of hot page statistics.

[0095] Memory medium 2 is used to store warm data between cold data that is not frequently accessed and hot data that is frequently accessed. The hot page statistics mode and the cold page statistics mode can be used to count the access results of pages in memory medium 2. Cold data can be migrated to memory medium 3, and hot data can be migrated to memory medium 1.

[0096] Therefore, different statistical methods are used for different memory media to count the frequency of page access, and then data migration is triggered based on the page access results, so as to timely and accurately count the frequency of page access, reduce the consumption of storage space and bandwidth by reducing the amount of statistical data, and improve the utilization of storage space and data migration performance. This will increase the data processing speed of the system and reduce the data processing delay.

[0097] In addition, the present application does not limit the execution subject of the memory access heat statistics, and the execution subject includes a medium module in a computer device, a hardware module with computing function, or a processor.

[0098] For example, Figure 4 As shown in (a), the access result of the statistical page is realized in the medium module. The medium module can be any of a variety of different types of memory media. For example, the medium module can be DRAM or SCM.

[0099] The processor in the computer device sends an access request to the media module, indicating that a write operation or a read operation is to be performed on the media module. The controller in the media module (such as a register clock driver (RCD)) can collect the access request, count the page access results according to the statistical mode associated with the type of memory medium accessed by the access request, store the page access results; and then, feedback the page access results to the processor in an in-band or out-of-band manner.

[0100] like Figure 4 As shown in (b) of Figure 4 The difference from (a) is that other hardware modules in the computer device implement the statistics of page access results and feed back the page access results to the processor in an in-band or out-of-band manner. The hardware module can be a memory controller or a peripheral (such as a complex programmable logical device (CPLD), FPGA), etc.

[0101] like Figure 4 As shown in (c) of Figure 4 The difference from (a) in the figure is that the page access result statistics are implemented by the processor in the computer device, and the processor core can obtain the page access result by reading the register in the processor.

[0102] Computer device 100 may also include cache memory and registers.

[0103] The cache memory is used to store instructions or data that may be accessed multiple times by the processor core in the processor 110 , thereby increasing the speed at which the processor processes data and preventing the processor from frequently accessing the main memory 120 .

[0104] In physical form, cache memory can be random access memory (RAM), static random-access memory (SRAM), dynamic RAM (DRAM), or other types of storage devices that can store information and instructions.

[0105] In terms of logical form, a cache memory may be a level 1 cache (L1 cache), a level 2 cache (L2 cache), a level 3 cache (L3 cache), or any level of cache device. For example, a cache memory disposed inside a processor core may be a level 1 cache (L1 cache) and a level 2 cache (L2 cache). A cache memory disposed outside a processor core may be a level 3 cache (L3 cache).

[0106] The register is used to store instructions or data that may be accessed multiple times by the processor core in the processor 110. Since the access speed of the register is higher than the access speed of the cache memory, the instructions or data that may be accessed multiple times by the processor core can be stored in the register first, which can further improve the speed of the processor processing data.

[0107] The processor core is connected to other devices in the processor (such as the processor core, cache memory, and main memory 120) through the bus 111, and accesses other devices through the bus 111. For example, the processor core, cache memory, and main memory 120 transmit access results through the bus 111. For another example, the processor core transmits a write instruction or a read instruction to the main memory 120 through the bus 111, so that the main memory 120 writes to the cache line according to the write instruction or reads the cache line according to the read instruction. The bus 111 can be an industry standard architecture (ISA) bus, a peripheral component interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc., or a private bus standard of a non-standard system. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 1 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0108] Figure 1The connection method between the processor core and other devices in the processor is only a schematic illustration. In one possible implementation, the processor core is connected to other devices in the processor through a ring bus, and accesses other devices in the processor through the ring bus. In another possible implementation, the processor core and other devices in the processor are connected through a mesh bus, and the processor core accesses other devices in the processor through the mesh bus.

[0109] The processor 110 is connected to the main memory 120 through a memory controller (MC) 112. The processor 110 can perform various functions of the computer device 100 by running or executing software programs stored in the main memory 120 and calling data stored in the main memory 120. For example, the processor 110 implements the access result of the statistical page through the memory controller 112.

[0110] The main memory 120 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), etc. The main memory 120 is also used to store programs related to the present embodiment.

[0111] The processor 110 may also include an external device 140 and an external device management module 113. The external device 140 is connected to the external device management module 113 via the bus 111. The external device 140 may be an application specific integrated circuit (ASIC). For example: a microprocessor (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA), or a graphics processing unit (graphics processing unit, GPU), or a neural network processing unit (neural-network processing unit, NPU). The external device 140 may also implement the access results of the statistical page, and feed back the access results to the processor core via the bus 111, so that the processor core triggers data migration according to the access hotness and coldness of the data.

[0112] Figure 1 The device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0113] Next, the memory data migration method provided by the present application is described in detail with reference to the accompanying drawings.

[0114] For ease of explanation, Figure 4 The media module statistics scenario shown in (a) in FIG. 1 is used as an example to implement the statistics of page access results in the memory medium. That is, the controller for the statistics of page access results can be the controller in the memory medium. Figure 5 , Figure 5 A flowchart of a memory data migration method provided in this application. Figure 5 As shown, the method includes the following steps.

[0115] Step 510: The processor sends an access request to the memory medium.

[0116] When an application program executed by a processor in a computer device needs to perform a read operation or a write operation on a memory medium, an access request is sent to the memory medium. Optionally, the access request indicates that a read operation or a write operation is performed on the memory medium according to a unit storage space (e.g., a cache line). The size of the unit storage space may be the size of a cache line when the processor accesses the memory medium. The access request may include the address and offset value of the memory medium, or the access request may include the starting address and the ending address of the memory medium to indicate a section of storage space accessed in the memory medium.

[0117] Step 520: Calculate page access results based on a statistical mode associated with the type of memory medium accessed by the obtained access request.

[0118] The processor can access the memory medium according to the memory address, for example, read the data in the storage space indicated by the memory address from the memory medium according to the memory address, or write data to the storage space indicated by the memory address in the memory medium. In some embodiments, the processor accesses the memory medium according to the logical address, and the memory management unit (MMU) maps the logical address to the physical address of the memory medium to access the memory medium. Different memory media in the computer device have different physical addresses, so the processor can access different memory media according to the physical addresses of different memory media.

[0119] In some embodiments, after the controller collects the access request sent by the processor, it determines the type of memory medium accessed by the access request according to the address contained in the access request, and counts the access results of the page according to the statistical mode associated with the type of memory medium. The address contained in the access request may refer to the physical address of the memory medium.

[0120] Optionally, the controller further sends an indication message, where the indication message includes the type of memory medium accessed by the access request and a statistical pattern associated with the type of memory medium.

[0121] In a first possible implementation, the access result of the page is counted according to the hot page statistics mode associated with the type of memory medium accessed by the access request. For example, if the processor accesses a memory medium far away from the processor, the controller counts the access result of the page according to the hot page statistics mode. That is, the address included in the access request indicates the memory medium far away from the processor, and the controller determines that the processor needs to access the memory medium far away from the processor based on the address included in the access request, and counts the access result of the accessed page according to the hot page statistics mode.

[0122] Since the access speed and access delay of the memory medium far from the processor are relatively slow compared to the memory medium close to the processor, the memory medium far from the processor is used to store cold data. When the processor accesses the cold data in the memory medium far from the processor, it means that the cold data is the data needed by the processor. In order to enable the processor to obtain hot data from the memory medium close to the processor as quickly as possible, improve the data processing speed of the system, and reduce the data processing delay, the page where the cold data is located is counted as a hot page according to the hot page statistics mode, and the cold data is converted into hot data, so as to facilitate the migration of hot data from the memory medium far from the processor to the memory medium close to the processor.

[0123] The memory medium close to the processor may be called the near memory. The memory medium far from the processor may be called the far memory. The access speed of the near memory is greater than the access speed of the far memory. For example, the near memory may be DRAM or DDRSDRAM. The far memory may be SCM. When the processor accesses the SCM, the controller may count the access results of the pages in the SCM according to the hot page statistics mode.

[0124] Optionally, the controller determines the statistical mode based on the association between the address segments of multiple memory media and the statistical mode. The controller queries the address segment of the memory medium to which the association relationship belongs based on the address contained in the access request, and determines the statistical mode corresponding to the address segment of the memory medium in the association relationship as the statistical mode of the access result of the statistical page. For example, the remote memory is associated with the hot page statistical mode, and when the processor accesses the remote memory, the controller can count the access results of the pages in the remote memory based on the hot page statistical mode.

[0125] In some embodiments, the hot page window is updated according to the address indicated by the access request. The hot page window is used to filter frequently accessed pages based on the page access order. The hot page window can be a filtering window, which is used to collect N frequently accessed pages according to the page access order, that is, the N frequently accessed pages collected by the hot page window are sorted according to the access order, and N is a positive integer. Understandably, the page currently accessed by the processor is placed in the first record of the N pages counted by the hot page window. The page access result includes N frequently accessed pages recorded based on the page access order. For example, the page access result includes the identifiers of N frequently accessed pages recorded based on the page access order.

[0126] After the controller obtains the access request, it can determine the page to which the accessed data block belongs according to the address indicated by the access request, and judge whether the hot page window contains the currently accessed page. If the hot page window contains the currently accessed page, the page containing the currently accessed page is adjusted to be the first record of the hot page window. If the hot page window does not contain the currently accessed page, the page record of the hot page window is updated, and the currently accessed page is adjusted to be the first record of the hot page window.

[0127] Optionally, the hot page window is used to indicate that the pages in the hot page window are replaced based on the page access order to record the frequently accessed pages. That is, the frequently accessed pages are used to replace the infrequently accessed pages. If the hot page window does not contain the currently accessed page, and the hot page window has collected N pages, the currently accessed page is used to replace the Nth record of the hot page window, and the currently accessed page is adjusted to the first record of the hot page window.

[0128] For example, the hot page window is used to record the page identifier. The page identifier can be the starting address of the page. Figure 6 As shown in (a) in the figure, the hot page window records the addresses of N pages. The currently accessed page is the page at address 1, and the hot page window records the page at address 1. The addresses recorded in the hot page window are reordered, and the page at address 1 is adjusted to be the first record in the hot page window. Figure 6 As shown in (b), the hot page window records the addresses of N pages. The currently accessed page is the page at address 4, and the hot page window does not record the page at address 4. The number of addresses recorded in the hot page window is equal to N. The page at address 4 is adjusted to the first record of the hot page window, replacing the Nth record of the hot page window, that is, deleting the Nth record address 10 of the hot page window. Alternatively, the number of addresses recorded in the hot page window is less than N, and the hot page window adds a page at address 4, and adjusts the page at address 4 to the first record of the hot page window.

[0129] Compared with counting the access frequency of pages, the solution provided in the present application only records the identification of hot pages, which can effectively reduce the storage capacity occupied by storing page access results and reduce the consumption of bandwidth required for transmitting page access results.

[0130] In some other embodiments, a saturation counter of a page associated with the address indicated by the access request is updated. The saturation counter is used to count the access frequency of the page.

[0131] After the controller obtains the access request, it can determine the page to which the accessed data block belongs according to the address indicated by the access request and update the access frequency of the page. For example, each time the page is accessed, the access frequency of the page is increased by one, that is, the count value of the saturation counter is increased by one. The page access result includes the page access frequency recorded by the saturation counters of multiple pages.

[0132] When the saturation counter overflows, the page is determined to be a hot page; when the saturation counter does not overflow, the page is determined to be a cold page.

[0133] For example, Figure 7 As shown, the access frequencies of multiple pages are sorted according to the page identifiers. When the access frequency of a page is equal to the saturation value of the saturation counter, the value of the page indicator bit is 1. When the access frequency of a page is not equal to the saturation value of the saturation counter, the value of the page indicator bit is 0. The page indicator bit is used to indicate whether the page has been accessed.

[0134] Optionally, the memory medium may not need to store the indicator bit of the page. When the controller feeds back the page access result to the processor, it feeds back the page access result based on the page access frequency recorded by the saturation counter. For example, the controller determines that the saturation counter overflows, and feeds back the value of the indicator bit of the page as 1, indicating that the page is a hot page. The controller determines that the saturation counter does not overflow, and feeds back the value of the indicator bit of the page as 0, indicating that the page is a cold page. The controller can output a bitmap, and the bitmap represents the values ​​of the indicator bits of multiple pages. For example, the bitmap is 111000, indicating that the values ​​of the indicator bits of 6 pages are 111000.

[0135] Since the processor can directly obtain the access heat of the page from the storage medium (such as RAM), it avoids the identification operation of analyzing the access frequency of the page to determine the access heat of the page, reducing the consumption of computing resources. In addition, since the access result of the page obtained by the processor is determined based on the access frequency of the page, the accuracy of hot page identification is ensured, avoiding the problem of inaccurate hot page identification caused by determining whether the page is accessed only based on the access bit of the page.

[0136] It should be noted that the page identifier may be the starting address of the page or the address index of the starting address of the page. Thus, the storage space occupied by the access results of the stored pages is reduced. Under different system architectures, the supported page size may be 4KB, 64KB or 2MB. The address can be clipped according to different page sizes, and the clipped address is used as the address index. The pages counted in the hot page window are sorted according to the address index or the access frequency of the page is recorded to obtain the access results of the page.

[0137] For example, Figure 8 As shown, it is assumed that the address indicated by the access request collected is 64B, that is, the address after collection is 64B. The address index obtained after clipping the address after collection can be 4KB, 64KB or 2MB.

[0138] In some embodiments, an address index is determined according to the address indicated by the access request, a saturation counter of a page associated with the address index is updated, and a count value of the saturation counter is increased by one.

[0139] In a second possible implementation, the access result of the page is counted according to the cold page statistics mode associated with the type of memory medium accessed by the access request. For example, if the processor accesses a memory medium close to the processor, the controller counts the access result of the page according to the cold page statistics mode. That is, the address included in the access request indicates the memory medium close to the processor, and the controller determines that the processor needs to access the memory medium close to the processor based on the address included in the access request, and counts the access result of the accessed page according to the cold page statistics mode.

[0140] Since the memory medium close to the processor has a faster access speed and a shorter access delay than the memory medium far away from the processor, the memory medium close to the processor is used to store hot data. When the processor accesses the hot data in the memory medium close to the processor, it means that the hot data is the data required by the processor. In order to enable the processor to obtain hot data from the memory medium close to the processor as quickly as possible, improve the data processing speed of the system, and reduce the data processing delay, the page where the hot data is located is counted as a hot page, and the page where the cold data is located is counted as a cold page according to the cold page statistics mode, and the unaccessed hot data is converted to cold data, so as to facilitate the migration of cold data from the memory medium close to the processor to the memory medium far away from the processor, so that the memory medium close to the processor can store more hot data.

[0141] For example, the near-end memory may be DRAM or DDR SDRAM. The far-end memory may be SCM. When the processor accesses the DRAM, the controller may count the access results of the pages in the DRAM according to the cold page statistics mode.

[0142] For example, the proximal memory is associated with the cold page statistics mode. When the processor accesses the proximal memory, the controller can count the access results of the pages in the remote memory according to the cold page statistics mode.

[0143] In some embodiments, an indicator bit of a page associated with the address indicated by the access request is updated.

[0144] The page indicator bit is used to indicate whether the page is accessed or not. For example, the initial value of the page indicator bit indicates that the page is not accessed. After the controller obtains the access request, it can determine the page to which the accessed data block belongs according to the address indicated by the access request, and adjust the value of the indicator bit corresponding to the page to indicate that the page is accessed. The page access result includes the values ​​of the indicator bits of multiple pages.

[0145] In some embodiments, an address index is determined according to an address indicated by an access request, and indication bits of a page associated with the address index are counted.

[0146] For example, when the value of the page indicator bit is 1, it indicates that the page has been accessed; when the value of the page indicator bit is 0, it indicates that the page has not been accessed. Alternatively, when the value of the page indicator bit is 0, it indicates that the page has been accessed; when the value of the page indicator bit is 1, it indicates that the page has not been accessed.

[0147] Optionally, the initial value of the indicator bit of the page may be 0, indicating that the page has not been accessed.

[0148] For example, Fig. 9 As shown in (a) of FIG. 1 , the indicator bits of multiple pages are sorted according to the page identifiers. When the page is accessed, the value of the indicator bit of the page is 1. When the page is not accessed, the value of the indicator bit of the page is 0.

[0149] Therefore, based on the bit array to record unaccessed pages and accessed pages, compared with determining the memory access heat by counting the access frequency of pages, this method only needs 1 bit of indicator bit to indicate the cold page, so as to identify the cold page, which can effectively reduce the data volume of the page access results, reduce the consumption of storage space and bandwidth, and improve the utilization rate of storage space. In addition, there is no need for the processor to perform additional operations, and data migration can be performed according to the access results containing the value of the indicator bit, thereby improving the data migration performance.

[0150] In other embodiments, information entropy processing is performed on the indicator bits of the multiple pages according to the spatial local characteristics of the multiple pages accessed by the processor to obtain processed data. The processed data is used to indicate the indicator bits of the multiple pages; the processed data is stored. The processor accesses the memory medium according to the spatial local characteristics of the page, that is, it can access multiple consecutive pages or multiple adjacent pages, and the values ​​of the indicator bits corresponding to the multiple consecutive pages or multiple adjacent pages can be the same.

[0151] Optionally, the controller processes the address indexes of the multiple pages and the indicator bits of the multiple pages according to the storage efficiency target to obtain processed data. The storage efficiency target is used to indicate the utilization rate of storing valid data in a limited storage space. The controller can map the indicator bits corresponding to the address indexes of the multiple pages to at least two indicator bits according to a preset rule.

[0152] For example, the indication bits corresponding to the address indexes of the multiple pages are mapped to at least two indication bits based on a hash algorithm.

[0153] For another example, if the preset rule is to map the indication bits corresponding to the address indexes of at least two pages into one indication bit, then the indication bits corresponding to the address indexes of multiple pages are mapped into at least two indication bits according to the preset rule. For example, the indication bits corresponding to the address indexes of two adjacent pages are mapped into one indication bit. For another example, the indication bits corresponding to the address indexes of two interval pages are mapped into one indication bit, and the two interval pages can be separated by at least one page.

[0154] Optionally, multiple indicator bits with the same value are mapped to one indicator bit. For example, an indicator bit with a value of 1 is mapped to one indicator bit; an indicator bit with a value of 0 is mapped to one indicator bit. The processed data includes the identifier of the page corresponding to the indicator bit with a value of 1 and the identifier of the page corresponding to the indicator bit with a value of 0.

[0155] For example, Fig. 9 As shown in (b), the values ​​of the indicator bits corresponding to the address indexes of at least two pages are ORed and mapped into one indicator bit. When the value of at least one indicator bit is 1, the values ​​of the indicator bits corresponding to the address indexes of at least two pages are ORed and mapped into 1; when the values ​​of the indicator bits corresponding to the address indexes of at least two pages are both 0, the values ​​of the indicator bits are ORed and mapped into 0.

[0156] Thus, information entropy processing is performed on the indicator bits of multiple pages, further reducing the data volume of the indicator bits of multiple pages, reducing the storage space occupied by the access results of cold pages, and reducing bandwidth consumption, thereby improving the utilization of storage space and data migration performance.

[0157] In other embodiments, a plurality of pages accessible to the processor are sampled, and an indication bit of the sampled page associated with the address indicated by the access request is updated. For example, the initial value of the indication bit associated with the sampled page is 0. When the access request indicates access to the sampled page, the indication bit associated with the sampled page is updated to 1.

[0158] The present application does not limit the sampling rules and sampling rate of pages, for example, random sampling, equal interval sampling, sampling based on spatial local features of pages, etc. The sampling rate may refer to the ratio of the number of pages after sampling to the total amount of data on the pages.

[0159] It should be noted that the above-mentioned method of counting page access results can be used alone or in combination, and this application is not limited thereto. For example, for a memory medium storing warm data between cold data and hot data, the controller can use both the hot page statistics mode to count page access results and the cold page statistics mode to count page access results.

[0160] In addition, the storage location of the address indicated by the access request and the storage location of the access result of the page may be the same or different. For example, a portion of the storage space in the memory medium is used to store the access result of the page. The address indicated by the access request may be stored in a storage medium other than the memory medium. For another example, a storage medium other than the memory medium (e.g., RAM) stores the access result of the page.

[0161] Optionally, the RAM stores an address index corresponding to each page, and after the memory medium obtains the address index by clipping according to the address indicated by the access request, the access result corresponding to the address index in the RAM is updated.

[0162] Optionally, when the RAM does not store the address index determined by the memory medium, a new address index and a corresponding access result are written into the RAM.

[0163] Step 530: trigger memory data migration between at least two different types of memory media according to the access result.

[0164] The processor determines the access heat of the page based on the access result of the page and triggers data migration. When data migration is triggered based on the access heat of the page, hot data can be migrated to the proximal memory and cold data can be migrated to the remote memory. For example, the access result indicates N hot pages, and the hotness of the data blocks in the N hot pages is determined to be hot. For another example, if the access result indicates the indicator bit of the page, it is determined that the indicator bit indicates that the page has not been accessed, and the hotness of the data blocks in the page is cold, or the indicator bit indicates that the page has been accessed, and the hotness of the data blocks in the page is hot.

[0165] Optionally, the access result indicates the processed data after information entropy processing, and the processed data is restored to the indicator bits of multiple pages, and the access popularity of the page is determined according to the indicator bits. For example, the controller counts the indicator bits of 4 pages, and takes or maps the values ​​of the indicator bits corresponding to the address indexes of 2 adjacent pages into one indicator bit, and the processed data contains the indicator bits of 2 pages. Assuming that the processed data contains 01, the processed data is restored to the indicator bits of 4 pages, then the value of the indicator bit of page 1 and the value of the indicator bit of page 2 are both 0; the value of the indicator bit of page 3 is 1, and the value of the indicator bit of page 4 is 0, or the value of the indicator bit of page 3 is 0, and the value of the indicator bit of page 4 is 1, or the value of the indicator bit of page 3 is 1, and the value of the indicator bit of page 4 is 1, or the value of the indicator bit of page 3 is 1, and the value of the indicator bit of page 4 is 1.

[0166] Therefore, different statistical methods are used for different types of memory media to count the frequency of page access, so as to achieve timely and accurate statistics on the frequency of page access, reduce the amount of data in the page access results, reduce the consumption of storage space and bandwidth, and improve the utilization of storage space and data migration performance. This will increase the data processing speed of the system and reduce the data processing delay.

[0167] The following is an example of the memory data migration process with reference to the accompanying drawings.

[0168] Fig.10 A schematic diagram of a memory data migration process provided for this application.

[0169] 1. Configuration process

[0170] (1) Configuring a statistical mode. For example, configuring a cold page statistical mode to identify cold pages in a memory medium (step 1010).

[0171] (2) A collection stop threshold may also be configured. If the time of the collection access request reaches the collection stop threshold, or the number of the collection access request reaches the collection stop threshold, the collection access request is stopped. For example, the collection stop threshold size register is configured.

[0172] 2. Collection process

[0173] (1) Determine whether the RAM is empty (step 1020). If the RAM is not empty, that is, data is stored in the RAM, clear the data in the RAM (step 1030). The RAM is used to store the access results of the page.

[0174] (2) If the RAM is empty, enable acquisition (step 1040) and acquire access requests (step 1050).

[0175] (3) According to the address in the access request, the indicator bit of the page corresponding to the address in the RAM is set to 1 (step 1060); if the page has not been accessed, the value of the indicator bit of the page is not changed. The RAM stores the one-to-one mapping relationship between the pages and the indicator bits in the system.

[0176] (4) After the sampling period has passed, the acquisition can be stopped. For example, there are two ways to stop the acquisition.

[0177] For example, the processor core instructs to stop the collection (step 1070), and the value of the indicator bit of the accessed page is stored in the RAM. If the processor core instructs to stop the collection, step 1090 is executed to compress the access result of the page and feed back the compressed data to the processor. If the processor core does not instruct to stop the collection, step 1080 is executed.

[0178] For another example, the number of indicator bits with values ​​of 1 is detected, and it is determined whether the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold (step 1080). If the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold, the acquisition is stopped and step 1090 is executed. Optionally, an interrupt is issued to inform the processor core that the acquisition has stopped. If the number of indicator bits with values ​​of 1 does not reach the acquisition, the access request continues to be acquired and step 1050 is executed.

[0179] 3. Cold and hot page reading process

[0180] (1) The processor core reads the access result of the page stored in the RAM. Since the data stored in the RAM may contain a large number of consecutive 0s and a large number of consecutive 1s, the access result of the page is compressed and the compressed data is fed back to the processor (step 1090). The compression processing method is not limited.

[0181] (2) The processor core decompresses the compressed data and obtains the access result of the page (step 10100).

[0182] 4. Cold and hot page migration process

[0183] (1) The processor core triggers memory data migration between at least two different types of memory media according to the access popularity of the page indicated by the access result of the page (step 10110). After the migration is completed, the collection process, the hot and cold page reading process, and the hot and cold page migration process are continued.

[0184] Fig.11 A schematic diagram of a memory data migration process provided for this application.

[0185] 1. Configuration process

[0186] (1) Configuring a statistical mode. For example, configuring a cold page statistical mode to identify cold pages in a memory medium (step 1110).

[0187] (2) A collection stop threshold may also be configured. If the time of the collection access request reaches the collection stop threshold, or the number of the collection access request reaches the collection stop threshold, the collection access request is stopped. For example, the collection stop threshold size register is configured.

[0188] 2. Collection process

[0189] (1) Determine whether the RAM is empty (step 1120). If the RAM is not empty, that is, data is stored in the RAM, clear the data in the RAM (step 1130).

[0190] (2) If the RAM is empty, enable acquisition (step 1140) and acquire access requests (step 1150).

[0191] (3) A hash function is performed on the address index of the page to obtain a new address index, and the indicator bit corresponding to the new address index is set to 1 (step 1160); if the page has not been accessed, the value of the indicator bit of the page is not changed. The one-to-one mapping relationship between the address index and the indicator bit of the page in the storage system is stored in the RAM (step 1170).

[0192] (4) After the sampling period has passed, the acquisition can be stopped. For example, there are two ways to stop the acquisition.

[0193] For example, the processor core instructs to stop the collection (step 1180), and the value of the indicator bit of the accessed page is stored in the RAM. If the processor core instructs to stop the collection, step 11100 is executed to compress the access result of the page and feed back the compressed data to the processor. If the processor core does not instruct to stop the collection, step 1190 is executed.

[0194] For another example, the number of indicator bits with values ​​of 1 is detected, and it is determined whether the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold (step 1190). If the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold, the acquisition is stopped and step 11100 is executed. Optionally, an interrupt is issued to inform the processor core that the acquisition has stopped. If the number of indicator bits with values ​​of 1 does not reach the acquisition, the access request continues to be acquired and step 1150 is executed.

[0195] 3. Cold and hot page reading process

[0196] (1) The processor core reads the access result of the page stored in the RAM. Since the data stored in the RAM may contain a large number of consecutive 0s and a large number of consecutive 1s, the access result of the page is compressed and the compressed data is fed back to the processor (step 11100). The compression processing method is not limited.

[0197] (2) The processor core decompresses the compressed data and obtains the access result of the page (step 11110).

[0198] 4. Cold and hot page migration process

[0199] (1) The processor core remaps the bit array through the hash function, and the processor core calculates the address index corresponding to the bit array through the hash function, and queries the address index. If the values ​​of the indicator bits corresponding to the address index are all 1, it indicates that the page is an extremely cold attribute page; if the corresponding values ​​queried are not all 1, it indicates that the page is not an extremely cold attribute page (step 11120).

[0200] (2) The processor core triggers memory data migration between at least two different types of memory media according to the access popularity of the page indicated by the access result of the page (step 11130). After the migration is completed, the processor core continues to execute the collection process, the hot and cold page reading process, and the hot and cold page migration process.

[0201] Fig.12 A schematic diagram of a memory data migration process provided for this application.

[0202] 1. Configuration process

[0203] (1) Configuring a statistical mode. For example, configuring a hot page statistical mode to identify hot pages in a memory medium (step 1210).

[0204] (2) A collection stop threshold may also be configured. If the time of the collection access request reaches the collection stop threshold, or the number of the collection access request reaches the collection stop threshold, the collection access request is stopped. For example, the collection stop threshold size register is configured.

[0205] 2. Collection process

[0206] (1) Determine whether the RAM is empty (step 1220). If the RAM is not empty, that is, data is stored in the RAM, clear the data in the RAM (step 1230).

[0207] (2) If the RAM is empty, enable acquisition (step 1240), and acquire the access request, for example, acquire the address indicated by the access request (step 1250).

[0208] (3) There is a hot page window of size N, and the hot page window can sort the pages according to the order in which the pages are accessed. For example, the currently accessed page is recorded in the first entry, and the least recently accessed page is recorded in the last entry. If the currently accessed page is not recorded in the hot page window, the least recently accessed page record is replaced, and the currently accessed page is placed in the first entry (step 1260). The identifiers of the N pages screened by the hot page window are stored in the RAM.

[0209] (4) After the sampling period, the collection can be stopped. For example, the processor core instructs to stop the collection (step 1270), and the identifiers of the N pages screened by the hot page window are stored in the RAM. If the processor core instructs to stop the collection, step 1280 is executed to feed back the identifiers of the N pages screened by the hot page window to the processor. If the processor core does not instruct to stop the collection, step 1250 is executed.

[0210] 3. Cold and hot page reading process

[0211] (1) The processor core reads the access result of the page stored in the RAM, that is, performs hot page identification according to the access result (step 1280).

[0212] 4. Cold and hot page migration process

[0213] (1) The processor core triggers memory data migration between at least two different types of memory media according to the access popularity of the page indicated by the access result of the page (step 1290). After the migration is completed, the processor core continues to execute the collection process, the hot and cold page reading process, and the hot and cold page migration process.

[0214] Fig.13 A schematic diagram of a memory data migration process provided for this application.

[0215] 1. Configuration process

[0216] (1) Configuring a statistical mode. For example, configuring a hot page statistical mode to identify hot pages in a memory medium (step 1310).

[0217] (2) A collection stop threshold may also be configured. If the time of the collection access request reaches the collection stop threshold, or the number of the collection access request reaches the collection stop threshold, the collection access request is stopped. For example, the collection stop threshold size register is configured.

[0218] (3) Configure the saturation value of the saturation counter.

[0219] (4) If sampling operations are involved, the sampling rate must also be configured.

[0220] 2. Collection process

[0221] (1) Determine whether the RAM is empty (step 1320). If the RAM is not empty, that is, data is stored in the RAM, clear the data in the RAM (step 1330).

[0222] (2) If the RAM is empty, enable acquisition (step 1340) and acquire access requests (step 1350).

[0223] (3) Determine whether the saturation counter overflows (step 1360). If the saturation counter does not overflow, add 1 to the count value of the saturation counter corresponding to the page (step 1370). If the saturation counter overflows, do not change the count value of the saturation counter (step 1380). If the page has not been accessed, do not change the count value of the saturation counter. The count value of the saturation counter of the page is stored in RAM.

[0224] (4) After the sampling period has passed, the acquisition can be stopped. For example, there are two ways to stop the acquisition.

[0225] For example, the processor core instructs to stop the collection (step 1390), and the value of the indicator bit of the accessed page is stored in the RAM. If the processor core instructs to stop the collection, step 13110 is executed to compress the access result of the page and feed back the compressed data to the processor. If the processor core does not instruct to stop the collection, step 13100 is executed.

[0226] For another example, the number of indicator bits with values ​​of 1 is detected, and it is determined whether the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold (step 13100). If the number of indicator bits with values ​​of 1 reaches the acquisition stop threshold, the acquisition is stopped and step 13110 is executed. Optionally, an interrupt is issued to inform the processor core that the acquisition has stopped. If the number of indicator bits with values ​​of 1 does not reach the acquisition, the access request continues to be acquired and step 1350 is executed.

[0227] 3. Cold and hot page reading process

[0228] (1) The processor core reads the access results of the pages stored in the RAM. During the reading process, the count value of each page is detected. If the count value is equal to the saturation value, the page is represented by bit 1. If the count value is not equal to the saturation value, it is represented by 0. Since the data stored in the RAM may contain a large number of consecutive 0s and a large number of consecutive 1s, the access results of the pages are compressed and the compressed data is fed back to the processor (step 13110). The compression processing method is not limited.

[0229] (2) The processor core decompresses the compressed data and obtains the access result of the page (step 13120).

[0230] 4. Cold and hot page migration process

[0231] (1) The processor core triggers memory data migration between at least two different types of memory media according to the access popularity of the page indicated by the access result of the page (step 13130). After the migration is completed, the processor core continues to execute the collection process, the hot and cold page reading process, and the hot and cold page migration process.

[0232] Optionally, if the access request statistics function is implemented by other hardware modules or memories outside the processor in the computer device, the statistical mode can be transmitted by out-of-band communication or in-band communication to configure, enable the access request sampling function and the access results of the page.

[0233] For a detailed explanation of the process of collecting the access results of the statistical pages, reference may be made to the description of the above embodiment, which will not be described in detail here.

[0234] It is worth noting that for Figure 4 (b) and Figure 4 For the memory access heat statistics scenario in the hardware module shown in (c) and the memory access heat statistics scenario in the processor, the data processing process is the same as Figure 4 The processing of (a) in is similar. Figure 4 The scenario (a) in Figure 1 is used as an example to illustrate the data processing process of other scenarios. Figure 5-Figure 9 The data processing process shown is similar and will not be repeated here.

[0235] It is understandable that in order to implement the functions in the above embodiments, the controller includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.

[0236] Combined with the above Figures 1 to 13 , describes in detail the memory data migration method provided according to this embodiment, and will now be combined with Fig.14 , describing the memory data migration device provided according to this embodiment.

[0237] Fig.14 The following is a schematic diagram of the structure of a possible memory data migration device provided in this embodiment. These memory data migration devices can be used to implement the memory function in the above method embodiment, and thus can also achieve the beneficial effects possessed by the above method embodiment. In this embodiment, the memory data migration device can be as follows Figure 5 The first memory medium shown may also be a module (such as a chip) applied to a processor.

[0238] like Fig.14 As shown, the memory data migration device 1400 includes a communication module 1410, a statistics module 1420, a migration module 1430 and a storage module 1440. The memory data migration device 1400 is used to implement the above Figure 5 The functions of the memory and the processor are shown in the method embodiments.

[0239] The communication module 1410 is used to obtain an access request, which is used to instruct the application program running on the processor of the computer device to operate the memory medium. Figure 5 Step 510.

[0240] The statistical module 1420 is used to count the access results of the pages according to the statistical mode associated with the type of the memory medium accessed by the access request, and the access results of the pages are used to determine the access popularity of the pages. The statistical mode includes at least one of a cold page statistical mode and a hot page statistical mode. For example, the statistical module 1420 is used to perform Figure 5 Step 520.

[0241] Optionally, the statistics module 1420 is specifically used to update the hot page window according to the address indicated by the access request, and the hot page window is used to record frequently accessed pages based on the page access sequence.

[0242] Optionally, the statistics module 1420 is specifically used to update a saturation counter of a page associated with the address indicated by the access request, and the saturation counter is used to count the access frequency of the page.

[0243] Optionally, the statistics module 1420 is specifically used to update the indication bit of the page associated with the address indicated by the access request, and the indication bit of the page is used to indicate that the page is accessed.

[0244] The migration module 1430 is used to trigger memory data migration between at least two different types of memory media according to the access result. Figure 5 Step 530.

[0245] The storage module 1440 is used to store the access results and statistical patterns of the pages, so that the statistical module 1420 can count the access results of the pages according to the statistical pattern associated with the type of memory medium accessed by the access request.

[0246] It should be understood that the memory data migration device 1400 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. It can also be implemented by software. Figure 5 The memory data migration shown and its various modules may also be software modules, and the memory data migration device 1400 and its various modules may also be software modules.

[0247] The memory data migration device 1400 according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each unit in the memory data migration device 1400 are respectively to implement Figure 5 For the sake of brevity, the corresponding processes of each method in are not repeated here.

[0248] The present application also provides a processor, which includes a memory and at least two processor cores. The processor is associated with at least two different types of memory media, and the memory is used to store a set of computer instructions. When the processor core executes the set of computer instructions, the operating steps of the method described in the above embodiments are executed to identify the access heat of pages in the memory.

[0249] The present application also provides a chip, including: a processor and a power supply circuit; wherein the power supply circuit is used to supply power to the processor; and the processor is used to execute the operation steps of the methods described in the above embodiments to realize the identification of the access heat of pages in the memory.

[0250] The present application also provides a computer system, which includes multiple computer devices, and the computer devices are used to execute the operating steps of the methods described in the above embodiments.

[0251] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist in a computing device as discrete components.

[0252] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD). The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A memory data migration method, characterized in that: The method is executed by a controller in a computer device, and the method includes: Obtaining an access request, wherein the access request is used to instruct an application program running on a processor in the computer device to operate a memory medium; Counting access results of pages according to a statistical mode associated with the type of memory medium accessed by the access request, wherein the access results of the pages are used to determine access heat of the pages, and the statistical mode includes at least one of a cold page statistical mode and a hot page statistical mode; Memory data migration is triggered between at least two different types of memory media according to the access result.

2. The method according to claim 1, characterized in that The hot page statistics mode counts the access results of the page according to the statistics mode associated with the type of the memory medium accessed by the access request, including: A hot page window is updated according to the address indicated by the access request, wherein the hot page window is used to record frequently accessed pages based on a page access sequence.

3. The method according to claim 2, characterized in that The hot page window is used to indicate that pages in the hot page window are replaced based on a page access sequence to record frequently accessed pages.

4. The method according to any one of claims 1 to 3, characterized in that The hot page statistics mode counts the access results of the page according to the statistics mode associated with the type of the memory medium accessed by the access request, including: A saturation counter of the page associated with the address indicated by the access request is updated, wherein the saturation counter is used to count the access frequency of the page.

5. The method according to claim 4, characterized in that The method further comprises: When the saturation counter overflows, feeding back an indication that the page is a hot page; When the saturation counter does not overflow, an indication that the page is a cold page is fed back.

6. The method according to any one of claims 1 to 5, characterized in that The cold page statistics mode counts the access results of the page according to the statistics mode associated with the type of the memory medium accessed by the access request, including: An indication bit of the page associated with the address indicated by the access request is updated, wherein the indication bit of the page is used to indicate that the page is accessed.

7. The method according to claim 6, characterized in that The method further comprises: Performing information entropy processing on the indicator bits of the multiple pages accessed by the processor according to the spatial local features of the multiple pages to obtain processed data, wherein the processed data is used to indicate the indicator bits of the multiple pages; The processed data is stored.

8. The method according to claim 7, characterized in that Processing indication bits of the plurality of pages according to spatial local features of the plurality of pages accessed by the processor comprises: The address indexes of the plurality of pages and the indicator bits of the plurality of pages are processed according to a storage efficiency target to obtain the processed data, wherein the storage efficiency target is used to indicate a utilization rate of storing valid data in a limited storage space.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: The type of the memory medium accessed by the access request is determined according to the address included in the access request.

10. The method according to any one of claims 1 to 9, characterized in that The access result of the page is stored in the storage medium of the computer device.

11. A memory data migration device, characterized in that: include: A communication module, used for obtaining an access request, wherein the access request is used for instructing an application program running on a processor in the computer device to operate a memory medium; a statistical module, configured to count access results of pages according to a statistical mode associated with the type of memory medium accessed by the access request, wherein the access results of the pages are used to determine access popularity of the pages, and the statistical mode includes at least one of a cold page statistical mode and a hot page statistical mode; A migration module is used to trigger memory data migration between at least two different types of memory media according to the access result.

12. A controller, characterized in that: The controller is used to execute the operation steps of the method described in any one of claims 1 to 10 to identify the access heat of pages in the memory.

13. A chip, characterized in that: The chip includes a logic circuit and a power supply circuit; wherein the power supply circuit is used to supply power to the logic circuit; and the logic circuit is used to execute the operation steps of the method described in any one of claims 1 to 10.

14. A computer device, characterized in that: The computer device includes a memory, a processor and multiple different types of memory media, the processor is associated with at least two different types of memory media, and the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions, the operating steps of the method described in any one of claims 1 to 10 are executed to identify the access heat of pages in the memory.

Citation Information

Patent Citations

  • Hybrid memory data management method and device and storage medium

    CN111984188A

  • Data migration method and device based on heterogeneous memory

    CN113835624A

  • Memory cold page processing method and electronic equipment

    CN114116191A

  • Memory management method and device, equipment and storage medium

    CN114253873A

  • Methods to utilize heterogeneous memories with variable properties

    US20180260323A1

Cited By

  • Data storage method and device, electronic equipment and storage medium

    CN120848810A

  • Data storage method and device, electronic equipment and storage medium

    CN120848810B

  • Storage control system and storage control method

    CN120892218A

  • Data migration method, system and equipment

    CN120909533A

  • A data migration method, system and device

    CN120909533B