Memory data migration method and related device
By using a sampling strategy to sample memory channels in multiple dimensions in a hybrid memory system, the problem of large amounts of statistical data on page access frequency in interleaved mode is solved, the access frequency and data migration are quickly obtained, and the data processing speed and data processing speed of the system are improved. Memory access performance.
Patent Information
- Application Number
- PCT/CN2024/083821
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-03-26
- Publication Date
- 2024-10-03
AI Technical Summary
When the processor accesses the memory in an interleaved manner, the amount of statistical data on the page access frequency is large, making it impossible to obtain the access frequency in time, affecting the data processing speed and latency of the system.
A sampling strategy is used to conduct multi-dimensional sampling of multiple memory channels. Based on the spatial dimension and time dimension, it ensures that the access frequency of the interleaved data blocks in the sampled memory channel is representative, reduces the amount of statistical data, and improves the accuracy of the access frequency, thereby Trigger data migration, migrate hot data to local memory, and migrate cold data to remote memory.
It improves the system's data processing speed, reduces data processing delay, improves data migration accuracy, enables the processor to quickly obtain page access frequency, and optimizes memory access performance.
Smart Images

Figure CN2024083821_03102024_PF_FP_ABST
Abstract
Description
Memory data migration method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 31, 2023, with application number 202310363679.X and application name “Memory Data Migration Method and Related Equipment”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computers, and in particular to a memory data migration method, apparatus, memory, chip, processor, computer equipment, and computer-readable storage medium. Background Art
[0003] At present, the processor in the computer device reads or writes the memory in an interleaved manner, that is, the data accessed to the memory is evenly distributed to multiple memory channels according to the unit storage space (for example, cache line), and the multiple memories are read or written to improve the access performance of the system. However, in the application scenario where the processor accesses the memory in an interleaved manner, the memory access heat is determined based on the access frequency of the page. Since more counters are required to count the page access frequency of each memory channel, the statistical data volume of the page access frequency is large, especially for small pages (such as 4 kilobyte (KB) pages). As a result, the processor may not be able to obtain the page access frequency in a timely manner, which may cause the memory with a fast access speed to store data that is not frequently accessed, or cause the memory with a slow access speed to store data that is frequently accessed, affecting the data processing speed and latency of the system.
[0004] Summary of the Invention
[0005] The present application provides a memory data migration method, apparatus, memory, chip, processor, computer device, and computer-readable storage medium, thereby increasing the data processing speed of the system and reducing the data processing latency.
[0006] In a first aspect, a memory data migration method is provided, which is applied to a hybrid memory system. The hybrid memory system includes multiple processors and multiple different types of memory media, and the processors are associated with at least two different types of memory media. The method includes: in a scenario where the processor in a computer device accesses the memory medium in an interleaved manner, sampling multiple memory channels according to a sampling strategy, and determining the access frequency of the page where the interleaved data block is located in the memory medium according to the access frequency of the interleaved data block in the sampled memory channel, so as to determine the access popularity of the page according to the access frequency of the page, and trigger data migration according to the access popularity. Among them, the access frequency intuitively represents the frequency with which the data block is accessed by the application. The more times a data block is accessed by an application, the more frequently the data block is accessed by the application, and the hotter the access popularity of the data block; the fewer times a data block is accessed by an application, the less frequently the data block is accessed by the application, and the colder the access popularity of the data block.
[0007] In this way, the memory data migration method provided by the present application performs multi-dimensional sampling of the memory channel based on the spatial dimension and time dimension indicated by the sampling strategy, thereby ensuring that the access frequency of the interleaved data block in the sampled memory channel is representative, and realizing the determination of the access frequency of the page where the interleaved data block is located based on the access frequency of the interleaved data block in the sampled memory channel, that is, determining the total access frequency of the page based on the partial access frequency of the page, thereby improving the accuracy of the access frequency of the page where the interleaved data block is located, and reducing the statistical data amount of the page access frequency, so that the processor can obtain the page access frequency as quickly as possible. When triggering data migration based on the access heat of the page, hot data can be migrated to near memory (near memory), and cold data can be migrated to far memory (far memory), so that the processor can obtain frequently accessed data from the near memory as quickly as possible, thereby improving the data processing speed of the system and reducing the data processing delay.
[0008] The access speed of the near-end memory is greater than the access speed of the far-end memory. For example, the near-end memory may be dynamic random access memory (DRAM) or double data rate synchronous dynamic random access memory (DDR SDRAM). The far-end memory may be storage-class memory (SCM).
[0009] The multiple different types of memory media include a first memory medium and a second memory medium. The memory media associated with the processor include the first memory medium and the second memory medium. If the access speed of the first memory medium is greater than the access speed of the second memory medium, the access latency of the first memory medium is less than the access latency of the second memory medium. For example, the first memory medium may be local memory, and the second memory medium may be remote memory.
[0010] In a possible implementation, sampling multiple memory channels in a computer device according to a sampling strategy includes: sampling the multiple memory channels to obtain a sampled memory channel according to page identifiers and spatial distribution of the memory channels indicated by the sampling strategy.
[0011] In a possible implementation, sampling from multiple memory channels to obtain sampled memory channels according to the spatial distribution of page identifiers and memory channels indicated by the sampling strategy includes: sampling from multiple memory channels to obtain sampled memory channels according to the correspondence between page identifiers and memory channels.
[0012] Therefore, based on the spatial distribution characteristics of pages and memory channels, spatial sampling is performed on the memory channels, and the access frequency of part of the storage space in the page represents the access frequency of the complete page. That is, the access frequency recorded by the counter in a memory channel represents the access frequency of a page. This not only improves the accuracy of the access frequency of the page where the interleaved data block is located, but also reduces the amount of statistical data on the access frequency of the page.
[0013] In one possible implementation, sampling multiple memory channels in a computer device according to a sampling strategy includes: sampling the multiple memory channels to obtain a sampled memory channel according to a rotational sampling method indicated by the sampling strategy, where the rotational sampling method is used to indicate a change in a correspondence between a page identifier and a memory channel.
[0014] Therefore, the memory channels are sampled based on the spatial dimension and the temporal dimension. By rotating the sampling method, the correspondence between the page identifier and the memory channel is changed, thereby improving the representativeness of the access frequency of the interleaved data blocks in the sampled memory channel and reducing the distortion caused by sampling.
[0015] In a possible implementation, sampling multiple memory channels in a computer device according to a sampling strategy includes: sampling the multiple memory channels to obtain a sampled memory channel according to a correspondence between a time period indicated by the sampling strategy and a storage space of a memory medium.
[0016] In one possible implementation, sampling multiple memory channels in a computer device according to a sampling strategy includes: sampling the sampled memory channel from the multiple memory channels according to a rotational sampling method indicated by the sampling strategy, wherein the rotational sampling method is used to indicate a change in the correspondence between the time period and the storage space of the memory medium.
[0017] Therefore, the memory channel is sampled based on the spatial dimension and the temporal dimension. By rotating the sampling method, the correspondence between the time period and the storage space of the memory medium is changed, thereby improving the representativeness of the access frequency of the interleaved data blocks in the sampled memory channel and reducing the distortion caused by sampling.
[0018] In one possible implementation, sampling multiple memory channels in a computer device according to a sampling strategy includes sampling multiple memory channels corresponding to addresses indicated by access requests according to the sampling strategy, where the access requests are used to instruct an application program running on a processor in the computer device to operate on a memory medium.
[0019] In a possible implementation, the size of the interleaved data block is a multiple of a cache line when the processor accesses a memory medium.
[0020] In one possible implementation, the page size is 4 kilobytes (KB). Because the memory data migration method provided by the present application can improve the accuracy of the access frequency of the page where the interleaved data block is located and reduce the amount of statistical data on the page access frequency, the processor can obtain the page access frequency as quickly as possible. For smaller pages, the amount of statistical data on the access frequency of the small page is reduced and the statistical accuracy is improved, thereby achieving higher data migration accuracy.
[0021] In a second aspect, a memory data migration device is provided, which includes modules for executing the memory data migration method in the first aspect or any possible design of the first aspect.
[0022] In a third aspect, a memory is provided, which includes a storage medium and a controller, the storage medium being 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 identify the access frequency of data blocks in the memory by applications.
[0023] In a fourth aspect, a chip is provided, comprising: a processor and a power supply circuit; wherein the power supply circuit is used to power the processor; 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 identify the access frequency of a data block in a memory by an application.
[0024] In a fifth aspect, a processor is provided, which includes at least two different types of associated memory media, 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 identify the access frequency of data blocks in the memory medium by applications.
[0025] In a sixth aspect, a computer device is provided, which includes a memory, multiple different types of memory media and a processor, wherein the memory is 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 identify the access frequency of data blocks in the memory by applications.
[0026] 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.
[0027] 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 operating steps of the method described in the first aspect or any possible implementation of the first aspect.
[0028] The technical effects brought about by any design method in the second to eighth aspects can be referred to the technical effects brought about by the first aspect or different design methods in the first aspect, and will not be repeated here.
[0029] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic diagram of the composition of a computer device provided by the present application;
[0031] FIG2 is a schematic diagram of memory interleaving provided by the present application;
[0032] FIG3 is a schematic diagram of a memory access heat statistics scenario provided by this application;
[0033] FIG4 is a flow chart of a memory data migration method provided by the present application;
[0034] FIG5 is a schematic diagram of a memory access heat statistics based on spatial dimension provided by the present application;
[0035] FIG6 is a schematic diagram of a time-based memory access heat statistics provided by the present application;
[0036] FIG7 is a flow chart of a memory access heat statistics method provided by the present application;
[0037] FIG8 is a flow chart of a sampling strategy adjustment method provided by the present application;
[0038] FIG9 is a schematic structural diagram of a memory data migration device provided in this application. DETAILED DESCRIPTION
[0039] For the convenience of description, the terms involved in this application are first briefly introduced.
[0040] In the computer memory system hierarchy, the closer the memory is to the processor, the faster it is to access and the smaller its storage capacity. In descending order of distance from the processor, memory is divided into registers, cache memory, main memory, and external memory.
[0041] Main memory, also known as internal memory, is a crucial component of a computer system, serving as the bridge between external memory and the processor. It temporarily stores computational data within the processor and data exchanged between the processor and external memory, such as a hard drive. For example, when a computer starts running, data to be computed is loaded from main memory into the processor for computation. Once the computation is complete, the processor stores the result in main memory. Examples of main memory include dynamic random access memory (DRAM) and double data rate synchronous DRAM (DDR SDRAM).
[0042] External storage, also known as auxiliary storage or simply external memory, has a larger storage capacity than main memory but slower access speeds. Examples of external storage include network storage, solid-state drives (SSDs), and hard disk drives (HDDs).
[0043] Cache memory is a high-speed, small-capacity memory located between the processor and main memory. Cache memory is often referred to as cache. Compared to main memory, cache has a smaller storage capacity and faster access speeds. Cache includes Level 1 (L1 cache), Level 2 (L2 cache), and Level 3 (L3 cache). Level 1 cache is located inside the processor core. Level 2 cache can be located inside or outside the processor core. Level 1 and Level 2 caches are typically exclusive to the processor core they are located in. Level 3 cache is typically located outside the processor core and is shared by multiple processor cores.
[0044] A register is a small memory inside a processor that temporarily stores data and results involved in a calculation. A register can be a commonly used sequential logic circuit.
[0045] Hierarchical Storage Technology (HST) stores data in different storage devices with different performance based on data importance, access frequency, retention time, storage capacity, performance, and other indicators. Hierarchical storage management enables automatic migration of data between storage devices.
[0046] Hot data refers to data that is frequently accessed by the processor. Storing hot data in near memory allows the processor to access the data as quickly as possible, increasing the system's data processing speed and reducing data processing latency, significantly improving system access performance.
[0047] Cold data refers to data that is infrequently accessed by the processor. Storing cold data in far memory allows for more data storage, allowing near memory to store more hot data, improving near memory resource utilization and reducing system costs. Near memory has a higher access speed than far memory. For example, cache memory is near memory relative to main memory, while main memory is far memory. Another example is main memory relative to external memory: main memory is near memory, while external memory is far memory.
[0048] A cache line is a unit of memory that a computer device uses to read or write data. A cache line can be 64 bytes in size.
[0049] A page is a unit used by a computer to manage memory storage space. For example, a page size can be 4KB, 2 megabytes (MB), or other byte sizes. A 4KB page is called a small page. A 2MB page is called a large page. The smaller the page, the more resources the computer requires to manage memory; the larger the page, the fewer resources the computer requires to manage memory. A page can include multiple cache lines, meaning the page size is a multiple of the cache line size.
[0050] Interleaving distributes memory access data evenly across multiple memory channels, based on unit storage space (for example, cache lines). Interleaving is configurable by the system administrator and can be applied across multiple memory channels connected to a single processor or across multiple memory channels of multiple processors.
[0051] Memory channels refer to multiple memory channels connected to a processor in a computer device. Processors can use interleaving techniques to operate on memory. For example, the processor evenly distributes data to be written to memory across multiple memory channels based on cache line sizes. Furthermore, the processor reads data from multiple memory channels based on cache line sizes. Data processing across multiple memory channels improves memory bandwidth utilization and processing performance.
[0052] 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, wherein the hybrid memory system includes multiple processors and multiple different types of memory media, and the processors are associated with at least two different types of memory media. The method includes: in a scenario where the processor in a computer device accesses the memory medium in an interleaved manner, sampling multiple memory channels according to a sampling strategy, determining the access frequency of the page where the interleaved data block is located in the memory medium according to the access frequency of the interleaved data block in the sampled memory channel, so as to determine the access popularity of the page according to the access frequency of the page, and triggering data migration according to the access popularity.
[0053] The memory data migration method provided in the present application performs multi-dimensional sampling of memory channels based on the spatial dimension and time dimension indicated by the sampling strategy, thereby ensuring that the access frequency of the interleaved data blocks in the sampled memory channels is representative, and realizing the determination of the access frequency of the page where the interleaved data blocks are located based on the access frequency of the interleaved data blocks in the sampled memory channels, that is, determining the total access frequency of the page based on the partial access frequency of the page, thereby improving the accuracy of the access frequency of the page where the interleaved data blocks are located, and reducing the amount of statistical data on the access frequency of the page, so that the processor can obtain the access frequency of the page as quickly as possible. When triggering data migration based on the access heat of the page, hot data can be migrated to the near-end memory, and cold data can be migrated to the far-end memory, so that the processor can obtain frequently accessed data from the near-end memory as quickly as possible, thereby improving the data processing speed of the system and reducing the data processing delay.
[0054] The memory data migration method provided in this application can be applied to fields such as artificial intelligence, big data, cloud computing, as well as scenarios such as high-performance, large-capacity storage systems that contain multiple types of storage media.
[0055] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0056] FIG1 is a schematic diagram of the composition of a computer device provided by the present application. As shown in FIG1 , the computer device 100 includes a processor 110 .
[0057] 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 processing unit (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), system on chip (SoC) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The 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.
[0058] Computer device 100 in FIG1 may include one or more processors (e.g., processor 110 and processor 130). The processor may be a multi-core processor, i.e., a processor including one or more processor cores. For example, processor 110 shown in FIG1 includes N processor cores. A processor herein may refer to one or more devices, circuits, and / or computing units for processing data (e.g., computer program instructions).
[0059] As the number of cores in a single processor increases and processor computing speeds continue to improve, the processors' demands for memory access speed and capacity are also increasing. In one possible implementation, multiple different types of storage media are used together as the main memory (abbreviated as "RAM" or "main memory") of a computer device to increase memory capacity. Each processor core is allocated as much memory resources and memory bandwidth as possible from the memory to meet the processor's memory access speed and capacity requirements. A system that uses multiple different types of storage media as memory can be called a hybrid memory system. The storage media used as memory in a hybrid memory system can be called memory media. A processor can be associated with at least one type of memory media, meaning some processors are associated with one type of memory media, while others are associated with two or more types of memory media.
[0060] 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 latency of the first memory medium is lower than the access latency of the second memory medium. The cost of the first memory medium is higher than the cost of the second memory medium.
[0061] The first memory medium may include dynamic random access memory (DRAM). The second memory medium is storage-class memory (SCM), which includes at least one of phase-change memory (PCM), magnetic random access memory (MRAM), resistive random access memory (RRAM / ReRAM), ferroelectric random access memory (FRAM), fast NAND, or nano-RAM (NRAM).
[0062] For 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 SCM 122 via an interface supporting memory semantics.
[0063] The processor 110 is configured to run an application program to perform a read operation or a write operation on a memory medium (eg, DRAM 121 or SCM 122), and to trigger data migration based on the access hotness or coldness of the memory medium.
[0064] Triggering data migration based on the access hotness of the memory medium can be replaced by 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.
[0065] For example, when the cache line is cold data and the memory medium where the cache line is located is DRAM, the cache line is migrated to the SCM.
[0066] For another example, when the cache line is hot data and the memory medium where the cache line is located is SCM, the cache line is migrated to DRAM.
[0067] Understandably, data migration can be triggered for any level of memory media in a computer device based on the level of data access. Each memory medium migrates data based on the level of data access. The next level of memory media has a larger storage capacity than the current one, while the previous level of memory media has a faster access speed.
[0068] In some embodiments, the computer device counts the access frequency of the page at the granularity of the page (such as 4KB page, 2MB page), which is compatible with the page management method of the computer device for the memory, making the memory data migration method easy to use. For example, the processor operates the memory medium at the granularity of the cache line, 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 being operated belongs, effectively improving the accuracy of identifying the access popularity of the page.
[0069] In other embodiments, when an application program executed by processor 110 operates on the memory medium of a computer device in an interleaved manner, the data accessing the memory medium is evenly distributed across multiple memory channels according to unit storage space (e.g., cache lines) to improve access speed. Since each memory channel can only obtain partial space addresses within a page, the page access frequency includes the access frequency of the data blocks contained in the page across the multiple interleaved memory channels.
[0070] For example, as shown in Figure 2, a 2MB page consists of 512 4KB pages. A cache line is 64 bytes, and a 4KB page consists of 64 cache lines. A 2MB page consists of 512 x 64 cache lines, evenly distributed across 8 memory channels. Each memory channel has 512 x 512B cache lines. Each memory channel contains a 256KB interleaved data block.
[0071] For example, the page size is 4KB (X page size =4KB), data is interleaved across 8 memory channels at the cache line granularity (N channel =8), the size of the interleaved data block for each memory channel is 512B. If the memory storage capacity is 128GB, 32K counters are required without interleaving, and 32K*8=256K counters are required with 8 memory channels interleaved.
[0072] For example, the page size is 2MB (X page size =2MB), data is interleaved across four memory channels at the cache line granularity (N channel=4), the size of the interleaved data block for each memory channel is 512KB. If the memory storage capacity is 128GB, 64K counters are required without interleaving, and 64K*4=256K counters are required with four memory channels interleaved.
[0073] In the present application, the processor 110 is used to sample multiple memory channels according to a sampling strategy in a scenario where the memory medium is accessed in an interleaved manner, and determine the access frequency of the page where the interleaved data block is located in the memory medium based on the access frequency of the interleaved data block in the sampled memory channel, so as to determine the access popularity of the page based on the access frequency of the page and trigger data migration based on the access popularity.
[0074] In addition, this application does not limit the execution entity of memory access heat statistics. The execution entity includes a media module in a computer device, other hardware modules or processors with computing functions in the computer device.
[0075] For example, as shown in FIG3 (a), access request collection, memory channel sampling, and access frequency statistics are implemented within a media module. The media module can be any of a variety of different types of memory media. For example, the media module can be DRAM or SCM.
[0076] The processor in a computer device sends an access request to a media module, instructing it to perform a write or read operation on the media module. A controller in the media module, such as a register clock driver (RCD), collects the access requests, samples the memory channels indicated by the access requests, and counts the access frequencies of interleaved data blocks within the sampled memory channels. The access frequencies are then stored and fed back to the processor via in-band or out-of-band communication.
[0077] As shown in Figure 3(b), the difference from Figure 3(a) is that another hardware module within the computer device collects access requests, samples memory channels, counts and stores access frequencies, and then feeds the access frequencies of the interleaved data blocks back to the processor in-band or out-of-band. This hardware module can be a memory controller or a peripheral (such as a complex programmable logical device (CPLD) or FPGA).
[0078] As shown in (c) of Figure 3, the difference from (a) of Figure 3 is that the processor in the computer device is used to collect access requests, sample memory channels, count statistics, and store access frequencies. The processor core can obtain the access frequency of the interleaved data block by reading the registers in the processor.
[0079] Computer device 100 may also include cache memory and registers.
[0080] 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 .
[0081] 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.
[0082] In terms of logical form, a cache memory can be a level 1 cache (L1 cache), a level 2 cache (L2 cache), a level 3 cache (L3 cache), or any other level of cache. For example, a cache memory located inside a processor core can be a level 1 cache (L1 cache) or a level 2 cache (L2 cache). A cache memory located outside a processor core can be a level 3 cache (L3 cache).
[0083] Registers are used to store instructions or data that may be accessed multiple times by the processor core of processor 110. Since register access speed is higher than cache memory access speed, instructions or data that may be accessed multiple times by the processor core can be stored in registers first, which can further increase the speed at which the processor processes data.
[0084] The processor core is connected to other components in the processor (e.g., the processor core, cache memory, and main memory 120) via bus 111, and accesses these components via bus 111. For example, bus 111 transmits access frequencies between the processor core, cache memory, and main memory 120. For another example, bus 111 transmits write instructions or read instructions to main memory 120, causing main memory 120 to write to a cache line according to the write instruction or read from a cache line according to the read instruction. Bus 111 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (UBus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), or a proprietary bus standard of a non-standard system. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG1 , but this does not mean that there is only one bus or one type of bus.
[0085] The connection between the processor core and other components in the processor in Figure 1 is merely illustrative. In one possible implementation, the processor core connects to the other components in the processor via a ring bus, accessing the other components via the ring bus. In another possible implementation, the processor core connects to the other components in the processor via a mesh bus, accessing the other components via the mesh bus.
[0086] 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 accessing data stored in the main memory 120. For example, the processor 110 can collect access requests, sample memory channels, and calculate counts and storage access frequencies through the memory controller 112.
[0087] The main memory 120 may be a read-only memory (ROM) or other static storage device capable of storing static information and instructions, a random access memory (RAM) or other dynamic storage device capable of storing information and instructions, or an electrically erasable programmable read-only memory (EEPROM). The main memory 120 is also used to store programs related to this embodiment.
[0088] The processor 110 may also include an external device 140 and a peripheral management module 113. The peripheral device 140 is connected to the peripheral management module 113 via the bus 111. The peripheral 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 peripheral device 140 may also collect access requests, sample memory channels, count statistics and store access frequencies, and feed back the access frequencies to the processor core via the bus 111, so that the processor core triggers data migration based on the access hotness or coldness of the data.
[0089] The device structure shown in FIG1 does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0090] Next, the memory data migration method provided in this application is described in detail with reference to the accompanying drawings.
[0091] For ease of explanation, the media module statistics scenario shown in (a) of Figure 3 is used as an example to illustrate the collection of access requests, sampling of memory channels, statistical counting, and storage of access frequencies within a memory medium. See Figure 4, which is a flow chart of a memory data migration method provided by this application. As shown in Figure 4, the method includes the following steps.
[0092] Step 410: The processor accesses the memory medium in an interleaved manner and sends access requests to multiple memory media.
[0093] When the processor accesses the memory medium in an interleaved manner, the data accessing the memory medium is evenly distributed across multiple memory channels according to the unit storage space (e.g., cache line). It should be understood that evenly distributing the data accessing the memory medium across multiple memory channels according to the unit storage space means evenly distributing the data accessing the memory medium across multiple memory media according to the unit storage space. For example, the processor sends an access request to multiple memory media, and the access request indicates a read operation or a write operation on the memory medium according to the unit storage space (e.g., cache line). The size of the unit storage space can be the size of a cache line when the processor accesses the memory.
[0094] Step 420: The memory medium samples multiple memory channels in the computer device according to the sampling strategy, and determines the access frequency of the interleaved data blocks in the sampled memory channels.
[0095] The memory medium receives an access request from the processor, which instructs the application program running on the processor to operate on the memory medium of the computer device. The memory medium decodes the access request to obtain the physical address and operation instructions indicated by the access request.
[0096] When a processor uses interleaved access to multiple memory media, a physical address indicates a storage space within one of the multiple memory channels. The size of the storage space can be one or more cache lines. That is, the size of the interleaved data block is a multiple of the cache lines used by the processor to access the memory media. Operation instructions indicate read or write operations to the storage space.
[0097] Understandably, when the processor accesses multiple memory media in an interleaved manner, each of the multiple memory media is determined to have accessed the same page. To reduce the amount of data required to calculate page access frequency statistics, the memory media samples multiple memory channels according to a sampling strategy, and calculates the access frequency of interleaved data blocks within the sampled memory channels. The sampling strategy indicates how to sample memory channels based on spatial and temporal dimensions.
[0098] The following describes how the memory medium samples multiple memory channels.
[0099] In the first approach, the memory samples multiple memory channels based on the page IDs and the spatial distribution of memory channels indicated by the sampling strategy. When the processor accesses multiple memory media in an interleaved manner, the access frequencies of the storage spaces accessed in these multiple memory media are similar, and the storage spaces accessed in these multiple memory media belong to different address segments of the same page. Based on this regularity, the correspondence between page IDs and memory channels can be preconfigured.
[0100] In some embodiments, a memory medium receives an access request, determines the page accessed by the processor and the address segment indicated by the physical address in the page based on the physical address indicated by the access request; determines the memory channel corresponding to the accessed page based on the correspondence between the page identifier and the memory channel; determines whether the memory channel receiving the access request is the same as the memory channel corresponding to the accessed page; if they are the same, the access frequency of the interleaved data block is counted in the memory channel receiving the access request; if they are not the same, there is no need to count the access frequency of the interleaved data block in the memory channel receiving the access request, thereby sampling multiple memory channels to obtain a sampled memory channel, and counting the access frequency of the interleaved data block in the sampled memory channel.
[0101] For example, the correspondence between page identifiers and memory channels indicates that when the page identifier and the memory channel identifier are the same, there is a correspondence, that is, the access frequency of the interleaved data block is counted in the memory channel with the same page identifier. For example, page 0 corresponds to memory channel 0, and the access frequency of the interleaved data block in page 0 is counted in memory channel 0. Page 1 corresponds to memory channel 1, and the access frequency of the interleaved data block in page 1 is counted in memory channel 1. If memory channel 0 receives an access request and determines that the processor accesses page 0 based on the physical address indicated by the access request, the access frequency of the interleaved data block in page 0 is counted in memory channel 0. If the processor accesses page 1 based on the physical address indicated by the access request, there is no need to count the access frequency of the interleaved data block in page 1 in memory channel 0. If memory channel 1 receives an access request and determines that the processor accesses page 0 based on the physical address indicated by the access request, there is no need to count the access frequency of the interleaved data block in page 0 in memory channel 1.
[0102] For another example, the correspondence between the page identifier and the memory channel indicates that the memory channel having the same operation result as the page identifier has a correspondence.
[0103] For example, as shown in Figure 5 (a), the processor uses a 4-way interleaving method to access four memory media. This means that the memory access data is evenly distributed across four memory channels, including memory channels 0 to 3, based on the unit storage space. Each memory channel contains storage space for the address segments of five pages. If the access frequency of the five pages is counted on each memory channel, a counter for each page must be deployed on all four memory channels.
[0104] As shown in (b) of Figure 5 , assuming that the correspondence between page identifiers and memory channels indicates a correspondence with the memory channel that has the same modulo-4 operation result as the page identifier, the access frequency of the interleaved data blocks in the page is counted in the memory channel that has the same modulo-4 operation result as the page identifier. Page 0 corresponds to memory channel 0, and the access frequency of the interleaved data blocks in page 0 is counted in memory channel 0. Page 1 corresponds to memory channel 1, and the access frequency of the interleaved data blocks in page 1 is counted in memory channel 1. Similarly, page 4 corresponds to memory channel 0, and the access frequency of the interleaved data blocks in page 4 is counted in memory channel 0.
[0105] In other embodiments, due to the loss of some access frequency characteristics during the statistics of access frequencies of interleaved data blocks within the sampled memory channels, the access frequencies of the interleaved data blocks within the sampled memory channels may not fully represent the access frequencies of the pages. The memory samples the sampled memory channels from multiple memory channels according to a rotational sampling method indicated by the sampling strategy. The rotational sampling method is used to indicate how the correspondence between page identifiers and memory channels changes.
[0106] For example, the rotation sampling method is used to calculate the correspondence between page identifiers and memory channels at different times. As shown in (c) in Figure 5, at time 0, page 0 corresponds to memory channel 0, and the access frequency of the interleaved data blocks in page 0 is counted in memory channel 0; at time 1, page 0 corresponds to memory channel 1, and the access frequency of the interleaved data blocks in page 0 is counted in memory channel 1; at time 2, page 0 corresponds to memory channel 2, and the access frequency of the interleaved data blocks in page 0 is counted in memory channel 2; at time 3, page 0 corresponds to memory channel 3, and the access frequency of the interleaved data blocks in page 0 is counted in memory channel 3.
[0107] Method 2: The memory samples the sampled memory channels from multiple memory channels based on the correspondence between the time period indicated by the sampling strategy and the storage space of the memory. It can be understood that the storage space of the memory medium is divided into multiple partial spaces, and the multiple partial spaces have a correspondence with multiple time periods. When the memory medium receives an access request, it determines whether the page accessed by the processor and the address segment indicated by the physical address in the page belong to the partial space corresponding to the time period. If so, the access frequency statistics of the address segment in the page are performed; if not, there is no need to perform access frequency statistics on the address segment in the page.
[0108] For example, as shown in (a) of FIG6 , at time 0, the frequency of access to the 0th portion of the space is counted; at time 1, the frequency of access to the 1st portion of the space is counted; at time 2, the frequency of access to the 2nd portion of the space is counted; and at time 3, the frequency of access to the 3rd portion of the space is counted. Assuming that at time 0, the memory medium receives an access request and determines that the page accessed by the processor and the address segment indicated by the physical address in the page belong to the 0th portion of the space, the access frequency statistics for the address segment in the page are performed. If the memory medium determines that the page accessed by the processor and the address segment indicated by the physical address in the page belong to the 1st portion of the space, there is no need to perform frequency statistics for the address segment in the page.
[0109] In other embodiments, due to the loss of some frequency characteristics when sampling based on the time dimension, the access frequency of the interleaved data blocks within the sampled memory channels may not fully represent the access frequency of the pages. The memory medium samples from multiple memory channels according to the rotational sampling method indicated by the sampling strategy to obtain the sampled memory channels. The rotational sampling method is used to indicate how the correspondence between time periods and storage spaces of the memory medium changes, namely, changing the order of time sampling in different storage spaces.
[0110] For example, the rotation sampling method is used to correspond to the storage space of the memory medium based on different time periods. As shown in (b) of Figure 6, the difference from (a) of Figure 6 is that in the second cycle, the partial space corresponding to each moment is replaced. For example: at time 0, the third part of the space is counted; at time 1, the 0th part of the space is counted; at time 2, the 1st part of the space is counted; at time 3, the 2nd part of the space is counted. Assuming that the memory medium receives an access request at time 0, it is determined that the page accessed by the processor and the address segment indicated by the physical address in the page belong to the third part of the space, then the access frequency statistics of the address segment in the page are performed.
[0111] This application does not limit the variations in the rotational sampling method based on the spatial and temporal dimensions. When sampling memory channels based on the spatial and temporal dimensions, the rotational sampling method increases the likelihood of corresponding relationships, improves the representativeness of the access frequency of the interleaved data blocks within the sampled memory channels, and reduces the distortion caused by post-sampling.
[0112] It should be noted that when the processor accesses multiple memory media in an interleaved manner, each memory medium can perform memory channel sampling based on the memory data migration method provided by this application, count the access frequency of the interleaved data blocks in the sampled memory channels, and trigger data migration between at least two different types of memory media based on the access heat of the page where the interleaved data blocks are located. In addition, the memory access heat statistics provided by this application can be executed by the RCD in the memory medium. The memory medium can sample multiple memory channels according to the sampling strategy each time it receives an access request; it can also sample multiple memory channels according to the sampling strategy after receiving multiple access requests based on the sampling period.
[0113] In this way, by sampling memory channels based on both spatial and temporal dimensions, we can achieve smaller page access frequencies while using fewer counters (requiring less RAM storage resources to store access frequencies). Furthermore, a rotational sampling method is used to compensate for some of the distortion effects introduced by sampling.
[0114] For example, if the storage capacity of the memory medium is 128 GB and the page size is 4 KB, only 128M counters are required when 4 memory channels are interleaved.
[0115] Step 430: The processor determines the access frequency of the page where the interleaved data block is located in the memory medium according to the access frequency of the interleaved data block fed back by the memory medium.
[0116] Since the access frequency of the interleaved data block reported by the memory medium is the access frequency of the interleaved data block within the sampled memory channel, that is, the access frequency of a portion of the storage space within the page, and since the access frequencies of the storage spaces of multiple memory media are similar when the processor uses interleaving to access multiple memory media, the processor determines the access frequency of the page containing the interleaved data block within the memory medium based on the access frequency of the interleaved data block and the number of interleaving paths.
[0117] For example, the processor uses a 4-way interleaving method to access four memory media. The access frequency of the page where the interleaved data block is located in one of the memory media is 10,000 times, and the access frequency of the page where the interleaved data block is located is approximately 40,000 times.
[0118] Step 440: The processor determines the access popularity of the page based on the access frequency and triggers data migration.
[0119] The processor determines the page's access frequency based on the interleaved data block's page, triggering data migration. For example, if the access frequency is greater than or equal to a threshold, the data block is considered hot; if the cold access frequency is less than the threshold, the data block is considered cold. When triggering data migration based on page access frequency, hot data can be migrated to local memory and cold data to remote memory.
[0120] Optionally, the present application does not limit the order of the steps in the above embodiment, and the order of the steps can be adjusted. For example, the memory medium determines the access popularity of the page based on the access frequency of the interleaved data block, and feeds back the access popularity of the page to the processor, and the processor triggers data migration based on the fed-back access popularity of the page. Alternatively, the memory medium feeds back the access frequency of the interleaved data block to the processor, and the processor determines the access popularity of the page based on the access frequency of the page where the interleaved data block is located, and then triggers data migration based on the access popularity of the page.
[0121] Due to the multi-dimensional sampling of the memory channel based on the spatial dimension and time dimension indicated by the sampling strategy, it is ensured that the access frequency of the interleaved data block in the sampled memory channel is representative, and the access frequency of the page where the interleaved data block is located is determined based on the access frequency of the interleaved data block in the sampled memory channel, that is, the total access frequency of the page is determined based on the partial access frequency of the page. Therefore, the accuracy of the access frequency of the page where the interleaved data block is located is improved, and the statistical data amount of the page access frequency is reduced, so that the processor can obtain the page access frequency as quickly as possible. When data migration is triggered according to the access heat of the page, hot data can be migrated to the near-end memory, and cold data can be migrated to the far-end memory, so that the processor can obtain frequently accessed data from the near-end memory as quickly as possible, thereby improving the data processing speed of the system, reducing the data processing delay, and significantly improving the access performance of the system.
[0122] Figure 7 is a flow chart of a memory access heat statistics method provided by the present application. The processor receives the configuration operation indicated by the user through the interface, configures the filtering mode in the sampling filter module, that is, configures the sampling strategy (step 710). The processor enables the sampling filter module, collects access requests and performs sampling operations (step 720). The counting module distributes the addresses sampled by the collection filter module to the corresponding counters and performs counting operations. All count values will be stored in RAM (step 730). After the sampling period, the processor issues a stop sampling instruction to stop counting, and all count values are stored in RAM (step 740). The processor reads all count values in RAM and stores them in the memory space (step 750). The processor determines whether all pages have completed collection (step 760). If not all pages have been collected, step 710 is executed and the sampling operation continues. If all pages have been collected, the process ends. The specific sampling process can be referred to the description of the above embodiment and will not be repeated here.
[0123] Figure 8 is a flow chart of a sampling strategy adjustment method provided by the present application. The processor determines whether the memory access performance is less than a threshold value (step 810). If the memory access performance is less than the threshold value, the sampling filter mode is changed (step 820). For example, the sampling strategy is changed from sampling the memory channel based on the spatial dimension to sampling the memory channel based on the time dimension; or, a rotation sampling method is used to sample multiple memory channels; if the memory access performance is greater than or equal to the threshold value, the sampling operation is continued. Memory access performance includes the data processing speed and data processing delay when the processor accesses the memory. For the sampling memory channel method described in steps 830 to 860, reference can be made to the description of steps 720 to 750 above.
[0124] It is worth noting that for the memory access heat statistics scenarios within the hardware module shown in Figure 3 (b) and Figure 3 (c), as well as the memory access heat statistics scenario within the processor, the data processing process is similar to the processing process in Figure 3 (a). For the sake of brevity, only the scenario shown in Figure 3 (a) is used as an example. The data processing processes for other scenarios are similar to the data processing process shown in Figure 3 and will not be repeated here.
[0125] It is understood that in order to implement the functions in the above embodiments, the processor includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art 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.
[0126] The memory data migration method provided in accordance with the present embodiment is described in detail above with reference to FIG. 1 to FIG. 8 . The memory data migration device provided in accordance with the present embodiment will be described below with reference to FIG. 9 .
[0127] FIG9 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 functions of the memory medium in the above-mentioned method embodiments, thereby also achieving the beneficial effects of the above-mentioned method embodiments. In this embodiment, the memory data migration device can be the first memory medium shown in FIG4 , or it can be a module (such as a chip) applied to a processor.
[0128] As shown in Figure 9 , memory data migration apparatus 900 includes a communication module 910, a sampling module 920, a statistics module 930, a migration module 940, and a storage module 950. Memory data migration apparatus 900 is used to implement the functions of the memory and processor in the method embodiment shown in Figure 4 .
[0129] The communication module 910 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. For example, the communication module 910 is used to execute step 410 in FIG4 .
[0130] The sampling module 920 is configured to sample multiple memory channels in the computer device according to a sampling strategy, where the sampling strategy indicates sampling rules for the memory channels based on spatial and temporal dimensions. For example, the sampling module 920 is configured to execute step 420 in FIG. 4 .
[0131] The statistics module 930 is configured to determine the access frequency of the interleaved data blocks in the sampled memory channels. For example, the statistics module 930 is configured to execute step 420 in FIG. 4 .
[0132] The statistics module 930 is further configured to determine the access frequency of the page containing the interleaved data block in the memory medium based on the access frequency of the interleaved data block. The access frequency of the page containing the interleaved data block is used to determine the access popularity of the page. For example, the statistics module 930 is configured to execute step 430 in FIG. 4 .
[0133] The migration module 940 is configured to trigger data migration between at least two different types of memory media based on access popularity. For example, the migration module 940 is configured to execute step 440 in FIG. 4 .
[0134] Optionally, the sampling module 920 is specifically configured to obtain a sampled memory channel by sampling from multiple memory channels according to the page identifiers and the spatial distribution of the memory channels indicated by the sampling strategy.
[0135] Optionally, the sampling module 920 is specifically configured to obtain a sampled memory channel by sampling from a plurality of memory channels according to a correspondence between a time period indicated by the sampling strategy and a storage space of the memory medium.
[0136] Optionally, the sampling module 920 is specifically configured to obtain a sampled memory channel by sampling from multiple memory channels according to a rotation sampling method indicated by the sampling strategy, where the rotation sampling method is used to indicate a change method of a correspondence between a page identifier and a memory channel.
[0137] Optionally, the sampling module 920 is specifically configured to obtain a sampled memory channel by sampling from multiple memory channels according to a rotation sampling method indicated by the sampling strategy, where the rotation sampling method is used to indicate a change in the correspondence between the time period and the storage space of the memory medium.
[0138] The storage module 950 is used to store sampling strategies and access frequencies, so that the sampling module 920 can sample multiple memory channels when the processor in the computer device accesses the memory medium in an interleaved manner.
[0139] It should be understood that the memory data migration device 900 of the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), wherein 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. Alternatively, when the memory data migration shown in FIG. 4 is implemented by software, the memory data migration device 900 and its modules can also be software modules.
[0140] According to the embodiment of the present application, the memory data migration device 900 can correspond to executing the method described in the embodiment of the present application, and the above-mentioned and other operations and / or functions of each unit in the memory data migration device 900 are respectively for implementing the corresponding processes of each method in Figure 4. For the sake of brevity, they will not be repeated here.
[0141] 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 methods described in the above embodiments are executed to identify the access frequency of data blocks in the memory medium by applications.
[0142] The present application also provides a chip comprising: 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, thereby realizing the identification of the access frequency of data blocks in memory by applications.
[0143] 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.
[0144] 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 read-only memory (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 an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in a computer device. Of course, the processor and storage medium can also exist in a computer device as discrete components.
[0145] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, all or part of the embodiments can be implemented 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 instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is performed in whole or in part. The computer can 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 can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as a solid state drive (SSD). The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A memory data migration method, characterized in that: The hybrid memory system includes a plurality of processors and a plurality of different types of memory media, wherein the processors are associated with at least two different types of memory media, and the method includes: Sampling a plurality of memory channels in a computer device according to a sampling strategy, and determining an access frequency of an interleaved data block in the sampled memory channels, wherein the plurality of memory channels allow a processor in the computer device to access a memory medium in an interleaved manner, and the sampling strategy is used to indicate a sampling rule for the memory channels based on a spatial dimension and a temporal dimension; Determining the access frequency of the page where the interleaved data block is located in the memory medium according to the access frequency of the interleaved data block, wherein the access frequency of the page where the interleaved data block is located is used to determine the access popularity of the page; Data migration is triggered between the at least two different types of memory media according to the access heat.
2. The method according to claim 1, characterized in that Sampling multiple memory channels in a computer device according to a sampling strategy, including: The sampled memory channel is obtained by sampling the multiple memory channels according to the page identifiers indicated by the sampling strategy and the spatial distribution of the memory channels.
3. The method according to claim 2, characterized in that According to the page identifiers indicated by the sampling strategy and the spatial distribution of the memory channels, sampling from the multiple memory channels to obtain the sampled memory channels includes: The sampled memory channel is obtained by sampling from the multiple memory channels according to the correspondence between the page identifier and the memory channel.
4. The method according to any one of claims 1 to 3, characterized in that Sampling multiple memory channels in a computer device according to a sampling strategy, including: The sampled memory channel is obtained by sampling from the multiple memory channels according to a rotation sampling method indicated by the sampling strategy, wherein the rotation sampling method is used to indicate a change method of a corresponding relationship between a page identifier and a memory channel.
5. The method according to any one of claims 1 to 3, characterized in that: Sampling multiple memory channels in a computer device according to a sampling strategy, including: The sampled memory channel is obtained by sampling from the multiple memory channels according to the correspondence between the time period indicated by the sampling strategy and the storage space of the memory medium.
6. The method according to claim 5, characterized in that Sampling multiple memory channels in a computer device according to a sampling strategy, including: The sampled memory channel is obtained by sampling from the multiple memory channels according to a rotation sampling method indicated by the sampling strategy, wherein the rotation sampling method is used to indicate a change manner of a corresponding relationship between a time period and a storage space of the memory medium.
7. The method according to any one of claims 1 to 6, characterized in that Sampling multiple memory channels in a computer device according to a sampling strategy, including: The plurality of memory channels corresponding to the addresses indicated by the access request are sampled according to the sampling strategy, wherein the access request is used to instruct the application program running on the processor in the computer device to operate the memory medium.
8. The method according to any one of claims 1 to 7, characterized in that The size of the interleaved data block is a multiple of a cache line when the processor accesses the memory medium.
9. The method according to any one of claims 1 to 8, characterized in that The multiple different types of memory media include a first memory medium and a second memory medium, the memory medium associated with the processor includes the first memory medium and the second memory medium, the access speed of the first memory medium is greater than the access speed of the second memory medium, and the access delay of the first memory medium is less than the access delay of the second memory medium.
10. A memory data migration device, characterized in that: include: A sampling module, configured to sample a plurality of memory channels in a computer device according to a sampling strategy, wherein the plurality of memory channels allow a processor in the computer device to access a memory medium in an interleaved manner, and the sampling strategy is configured to indicate a sampling rule for the memory channels based on a spatial dimension and a temporal dimension; A statistics module for determining the access frequency of the interleaved data blocks in the sampled memory channels; The statistical module is further used to determine the access frequency of the page where the interleaved data block is located in the memory medium according to the access frequency of the interleaved data block, and the access frequency of the page where the interleaved data block is located is used to determine the access popularity of the page; A migration module is used to trigger data migration between at least two different types of memory media according to the access heat.
11. The device according to claim 10, characterized in that When the sampling module samples multiple memory channels in the computer device according to the sampling strategy, it is specifically used to: The sampled memory channel is obtained by sampling the multiple memory channels according to the page identifiers indicated by the sampling strategy and the spatial distribution of the memory channels.
12. The device according to claim 11, characterized in that When the sampling module obtains the sampled memory channel by sampling from the multiple memory channels according to the page identifiers indicated by the sampling strategy and the spatial distribution of the memory channels, the sampling module is specifically used to: The sampled memory channel is obtained by sampling from the multiple memory channels according to the correspondence between the page identifier and the memory channel.
13. The device according to any one of claims 10 to 12, characterized in that When the sampling module samples multiple memory channels in the computer device according to the sampling strategy, it is specifically used to: The sampled memory channel is obtained by sampling from the multiple memory channels according to a rotation sampling method indicated by the sampling strategy, wherein the rotation sampling method is used to indicate a change method of a corresponding relationship between a page identifier and a memory channel.
14. The device according to any one of claims 10 to 12, characterized in that When the sampling module samples multiple memory channels in the computer device according to the sampling strategy, it is specifically used to: The sampled memory channel is obtained by sampling from the multiple memory channels according to the correspondence between the time period indicated by the sampling strategy and the storage space of the memory medium.
15. The device according to claim 14, characterized in that When the sampling module samples multiple memory channels in the computer device according to the sampling strategy, it is specifically used to: The sampled memory channel is obtained by sampling from the multiple memory channels according to a rotation sampling method indicated by the sampling strategy, wherein the rotation sampling method is used to indicate a change manner of a corresponding relationship between a time period and a storage space of the memory medium.
16. The device according to any one of claims 10 to 15, characterized in that When the sampling module samples multiple memory channels in the computer device according to the sampling strategy, it is specifically used to: The plurality of memory channels corresponding to the addresses indicated by the access request are sampled according to the sampling strategy, wherein the access request is used to instruct the application program running on the processor in the computer device to operate the memory medium.
17. The device according to any one of claims 10 to 16, characterized in that The size of the interleaved data block is a multiple of a cache line when the processor accesses the memory medium.
18. The device according to any one of claims 10 to 17, characterized in that The multiple different types of memory media include a first memory medium and a second memory medium, the memory medium associated with the processor includes the first memory medium and the second memory medium, the access speed of the first memory medium is greater than the access speed of the second memory medium, and the access delay of the first memory medium is less than the access delay of the second memory medium.
19. A memory, characterized in that: The memory 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 described in any one of claims 1 to 9 are executed to realize the identification of the access frequency of the data block in the memory by the application program.
20. A chip, characterized in that: include: A processor and a power supply circuit; wherein the power supply circuit is used to supply power to the processor; The processor is used to execute the operating steps of the method described in any one of claims 1-9 to realize the identification of the access frequency of the data block in the memory by the application program.
21. A processor, characterized in that: The processor is associated with at least two different types of memory media, and is used to execute the operation steps of the method described in any one of claims 1 to 9 to identify the access frequency of data blocks in the memory medium being accessed by the application.
22. 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 9 are executed to identify the access frequency of data blocks in the memory medium by the application program.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Memory data migration method and related equipment
CN118732931A
Hybrid main storage architecture based efficient dynamic page scheduling method
CN107193646A
Hot page prediction method and page scheduling method for storage medium
CN110795363A
Data migration method and device
CN110858124A
Data migration method and device based on heterogeneous memory
CN113835624A
