Data processing method and apparatus, chip and computer readable storage medium
By identifying the physical address of memory access instructions and performing data prefetching, the problem of low data prefetching accuracy in existing technologies is solved, and the data processing efficiency of hybrid memory systems is improved.
Patent Information
- Application Number
- CN202611047216.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, memory page hotness determination methods based on access bits are not accurate enough, resulting in low accuracy of data prefetching and reduced data processing efficiency.
By identifying the physical address corresponding to the memory access instruction, it is determined whether it is a memory pointer. If it is determined to be a storage-level memory pointer, the data is prefetched to dynamic random access memory, thereby improving the accuracy of data prefetching.
It improves the accuracy of data prefetching and accelerates subsequent data processing, while optimizing data access efficiency in hybrid memory systems.
Smart Images

Figure CN123157628A_ABST
Abstract
Description
[0001] This application is a divisional application. The original application has the application number 202211687803.X and the original application date is December 27, 2022. The entire contents of the original application are incorporated herein by reference. Technical Field
[0002] This application relates to the field of communications, and more particularly to a data processing method, apparatus, chip, and computer-readable storage medium. Background Technology
[0003] The era of big data has spawned a large number of data-intensive applications, leading to an increasing demand for memory subsystem capacity and bandwidth. Dynamic random access memory (DRAM) is also accounting for a growing proportion of the total cost of ownership in servers. To improve the overall cost-effectiveness of memory systems, hybrid memory systems typically employ DRAM and storage-class memory. This requires statistical analysis of memory access information, transferring cold data to extended storage media, and then transferring it back to DRAM for access as needed.
[0004] One existing data processing method primarily uses memory page access bits to indicate the frequency of memory pages in the storage-level memory, thereby performing data migration. For example, during a scan cycle, if a memory page in the storage-level memory is accessed, the value of that memory page access bit is set to 1. When that memory page is accessed again, since the access bit is 1, it is considered a hot memory page, and the data in that memory page is prefetched into dynamic random access memory.
[0005] In the above data processing method, the value of the access bit can only indicate whether a memory page has been accessed in the current scan cycle. Judging hot and cold memory pages based solely on this is inaccurate and reduces the accuracy of data prefetching. Summary of the Invention
[0006] This application provides a data processing method, apparatus, chip, and computer-readable storage medium. In the data processing method, by determining the first physical address corresponding to a memory access instruction, and if the first physical address is within the physical address range corresponding to the storage-level memory, the data of the target memory page corresponding to the first physical address is prefetched into dynamic random access memory. In other words, by identifying the physical address corresponding to the memory access instruction, the memory page to be accessed in the future is promoted to dynamic random access memory, improving the accuracy of data prefetching and accelerating subsequent data processing.
[0007] Firstly, a data processing method is provided, applicable to a hybrid memory system including different types of memory, specifically storage-level memory (SCM) and dynamic random access memory (DRAM). The method involves obtaining a first memory access instruction, triggering a data access process that includes addressing, reading, or writing data. The first memory access instruction carries a target virtual address (VA) and a target process identification number (PID), with the PID indicating the process corresponding to the first memory access instruction. In the case of multiple processes running simultaneously, the process identification number distinguishes memory access instructions from different processes, thus preventing errors in data operations. Before reading or writing data, it is determined whether the memory region to be accessed is located in SCM and whether the physical address corresponding to the first memory access instruction is a memory pointer, to determine whether data prefetching is necessary. Specifically, a mapping table is consulted based on the target virtual address and the target process device number. This mapping table includes the correspondence between at least one virtual address, at least one physical address, and at least one process identification number. If a first physical address corresponding to the target virtual address and the target process ID exists in the mapping table, and this first physical address is included in the physical address range of the SCM, then it means that the first physical address is a memory pointer, and the memory page to be accessed by the first memory access instruction is located in the SCM. Based on this, the data of the target memory page corresponding to the first physical address is prefetched into the DRAM.
[0008] As can be seen from the above technical solutions, this application has the following advantages: By analyzing memory access instructions, it is determined whether the instruction corresponds to a memory pointer and whether the accessed region is located in storage-level memory. If the pointer is to a storage-level memory pointer, data prefetching is performed, prefetching the data of the target memory page to be accessed into dynamic random access memory. In other words, by identifying the physical address corresponding to the memory access instruction, the memory page to be accessed in the future is promoted to dynamic random access memory, improving the accuracy of data prefetching and accelerating the performance of subsequent data processing.
[0009] In one possible implementation, the mapping table may include a page table, or it may include both a page table and a translation lookaside buffer (TLB). This TLB can be either an existing TLB in the multiplexer or a separately configured TLB; the specific implementation is not limited here. When the mapping table includes both a page table and a TLB, the process of querying the mapping table includes: querying the TLB based on the target virtual address and the target process ID; and if the TLB does not contain the first physical address, then querying the page table based on the target virtual address and the target process ID.
[0010] The mapping table has multiple possibilities. When the mapping table includes both a page table and a translation back buffer table, the implementation of the translation back buffer table also has various possibilities, enriching the implementation methods of the technical solution in this application and improving its flexibility and practicality. Furthermore, when the mapping table includes both a page table and a translation back buffer table, the translation back buffer table is queried first, leveraging its fast query speed to improve data processing speed.
[0011] In one possible implementation, prefetching the data of the target memory page corresponding to the first physical address into dynamic random access memory (DRAM) includes: prefetching the data of the target memory page into a second physical address, where the second physical address is contained within the physical address range corresponding to DRAM. Based on this, the physical addresses corresponding to the target virtual address and the target process ID change, i.e., the correspondence changes. Therefore, the mapping table needs to be updated. That is, the correspondence between the target virtual address, target process ID, and the first physical address in the mapping table needs to be updated to a correspondence between the target virtual address, target process ID, and the second physical address.
[0012] In one possible implementation, the method of updating the mapping table varies depending on its type. If the mapping table includes a page table, the mapping between the target virtual address, target process ID, and first physical address in the page table is updated to a mapping between the target virtual address, target process ID, and second physical address. If the mapping table includes both a page table and a translation lookup buffer table, in addition to updating the mapping between the target virtual address, target process ID, and first physical address in the page table to a mapping between the target virtual address, target process ID, and second physical address, the mapping between the target virtual address, target process ID, and second physical address also needs to be stored in the translation lookup buffer table.
[0013] After prefetching data from the storage-level memory to dynamic random access memory, the corresponding relationships in the mapping table are updated to adapt the mapping table to the actual data processing process. The specific update method varies depending on the type of mapping table, enriching the implementation options while ensuring smooth subsequent access operations, thus improving the feasibility of the technical solution.
[0014] In one possible implementation, a mapping table needs to be constructed before retrieving the query mapping table. Specifically, it is possible to obtain the correspondence between at least one virtual address, at least one process ID, and at least one physical address. Based on this correspondence, a mapping table is constructed.
[0015] The storage-class memory controller can obtain the correspondence between at least one virtual address, at least one process ID and at least one physical address, and construct a mapping table based on this, which provides technical support for the implementation of the technical solution of this application and improves the feasibility of the technical solution of this application.
[0016] Secondly, this application provides a data processing apparatus, which includes modules for performing the data processing method in the first aspect or any possible implementation of the first aspect.
[0017] Thirdly, a chip is provided, including a processing unit and a power supply circuit, wherein the power supply circuit supplies power to the processing unit, and the processing unit is used to implement the methods shown in the first aspect and any possible implementation of the first aspect.
[0018] Fourthly, a computer-readable storage medium is provided, which stores instructions that, when executed on a processor, implement the methods shown in the first aspect and any possible implementation thereof.
[0019] Fifthly, a computer program product is provided that, when executed on a processor, implements the method shown in the first aspect and any possible implementation of the first aspect.
[0020] The beneficial effects shown in the second to fifth aspects are similar to those of the first aspect in implementing the first aspect and any possible implementation of the first aspect, and will not be repeated here.
[0021] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description
[0022] Figure 1a This is a schematic diagram of a system architecture used in this application; Figure 1b This is a schematic diagram of another system architecture used in this application; Figure 2 A flowchart illustrating the data processing method provided in this application; Figure 3 Another flowchart illustrating the data processing method provided in this application; Figure 4 Another flowchart illustrating the data processing method provided in this application; Figure 5 A schematic diagram of the data processing apparatus provided in this application; Figure 6 A schematic diagram of the chip provided in this application; Figure 7 A schematic diagram of the data processing system provided in this application. Detailed Implementation
[0023] To improve the accuracy of data prefetching, this application provides a data processing method, apparatus, chip, and computer-readable storage medium. By identifying and analyzing memory access instructions, it determines whether the instruction corresponds to a memory pointer and whether the indicated access region is located in storage-level memory. If the pointer corresponds to a memory pointer in storage-level memory, data prefetching is performed, prefetching the data of the target memory page to be accessed into dynamic random access memory (DRAM). In other words, by identifying the physical address corresponding to the memory access instruction, the memory page to be accessed in the future is promoted to DRAM, improving the accuracy of data prefetching and accelerating subsequent data processing.
[0024] The embodiments of this application will now be described with reference to the accompanying drawings.
[0025] First, please refer to Figure 1a and Figure 1b , Figure 1a and Figure 1b All of these are schematic diagrams of the system architecture provided in this application.
[0026] like Figure 1a As shown, the data processing method provided in this application embodiment is applied to a hybrid memory system, which includes multiple types of memory, such as storage-class memory 103 and dynamic random access memory 104. Storage-class memory 103 is a type of physical computer memory, and it treats non-volatile memory as dynamic random access memory 104. In terms of read / write speed and data processing, dynamic random access memory 104 performs better than storage-class memory 103.
[0027] During data processing, processor 101 obtains a memory access instruction and sends it to storage-class memory controller 102. In this embodiment, storage-class memory controller 102 parses the memory access instruction and executes the corresponding operation, thereby accessing the data corresponding to the memory access instruction in storage-class memory 103 or dynamic random access memory 104. The specific process will be described in detail later and will not be elaborated here.
[0028] It is important to note that Figure 1a This is merely a schematic diagram of the system architecture and does not constitute a limitation on the system applied in the embodiments of this application. Figure 1a In the illustrated embodiment, the storage-level memory controller 102 is decoupled from the processor 101; in practical applications, such as Figure 1b As shown, the storage-level memory controller 102 can also be coupled to the processor 101, but the specifics are not limited here.
[0029] It should be noted that storage class memory 103 has multiple memory forms, such as datacenter persistent memory (DC PMem), for example, AEP; it can also be other storage class memory, such as phase-change memory (PCM), persistent memory (PMem), non-volatile memory (NVM), etc., which are not limited here.
[0030] It should be noted that the dynamic random access memory 104 can have various memory forms, including synchronous dynamic random access memory (SDRAM) and double data rate (DDR). In addition, it can also be other types of memory, such as remote direct memory access (RDMA) memory or memory fabric, etc., which are not limited here.
[0031] It should be noted that in this embodiment, the bus protocol used to establish the connection between the storage-class memory controller 102 and the processor 101, the storage-class memory 103, and the dynamic random access memory 104 can be varied, such as: dual in-line memory module (DIMM) bus protocol, DDR-T, computeexpress link (CXL) protocol, open coherent accelerator processor interface (OpenCAPI) protocol, Gen-Z protocol, cache coherent interconnect for accelerators (CCIX) protocol. In addition, other bus protocols can also be used, such as InfiniBand / RoCE, QuickPath, NVLink, etc., which are not limited here.
[0032] The data processing method provided in this application embodiment can be applied to the architecture described above. A detailed explanation follows with reference to the schematic diagrams. Please refer to... Figure 2 , Figure 2 A flowchart illustrating the data processing method provided in this application includes at least the following steps: 201. The storage-class memory controller fetches the first memory access instruction from the processor.
[0033] After the processor obtains the first memory access instruction, it sends the instruction to the storage-level memory controller. The storage-level memory controller analyzes the instruction to determine whether the accessed region indicated by the instruction is in the storage-level memory of the mixed memory region or in dynamic random access memory, and whether the memory address (i.e., the physical address) corresponding to the instruction is a memory pointer.
[0034] In this context, a memory pointer means that the memory address does not store the actual data to be accessed, but rather indicates a large memory block. The amount of data in this memory block is greater than the memory space occupied by the memory pointer itself. The content of a memory pointer is usually the address of a memory page, pointing to a large block of memory space allocated in the early stages of memory allocation.
[0035] In addition, the first memory access instruction carries the target virtual address and the target process identifier. The target process identifier indicates the process corresponding to the first memory access instruction, enabling the storage-level memory controller to distinguish the memory access instructions corresponding to different business processes, and avoid access errors even in the case of multiple concurrent services.
[0036] 202. The storage-level memory controller queries the mapping table based on the first memory access instruction.
[0037] After receiving the first memory access instruction, the storage-class memory controller queries a mapping table based on the target virtual address and target process ID included in the instruction. This determines whether the accessed region indicated by the instruction is located in storage-class memory or dynamic random access memory (DRAM) within a mixed memory region, and whether the physical address corresponding to the instruction is a memory pointer. The mapping table includes a correspondence between at least one virtual address, at least one process ID, and at least one physical address.
[0038] In the embodiments of this application, the mapping table can take various forms, including a page table, or a page table and a translation lookaside buffer (TLB) table. The lookup method differs for each case, and the possible scenarios are described below.
[0039] 1) The mapping table includes the page table.
[0040] In this scenario, the storage-class memory controller queries the page table based on the target virtual address and the target process ID. The page table can be stored in the control register (CR). Specifically, the storage-class memory controller can send a query instruction to the CR controller, carrying the target virtual address and the target process ID. The query instruction instructs the controller to query the physical address corresponding to the target virtual address and the target process ID.
[0041] The page table stores the correspondence between at least one virtual address, at least one process ID, and at least one physical address. There is a one-to-one correspondence between at least one virtual address and at least one physical address. Each process ID can correspond to one or more virtual addresses and physical addresses. This is because the data corresponding to a business process can be stored in multiple storage areas.
[0042] 2) The mapping table includes the page table and the translation backup buffer table.
[0043] Considering that the performance of the translation lookup table (mainly lookup speed) is better than that of the page table, when the mapping table includes both the page table and the translation lookup table, the storage-level memory controller will first look up the translation lookup table. If the first physical address that meets the conditions is not found in the translation lookup table, then the page table will be looked up. The conditions that the first physical address needs to meet are explained in step 203 and will not be repeated here.
[0044] It should be noted that the translation backup buffer table mentioned in the embodiments of this application can be either a reused translation backup buffer table in the existing processor, that is, an extension of the functionality of the existing translation backup buffer table to enable it to store corresponding relationships; or it can be a separately set translation backup buffer table. In this case, the separately set translation backup buffer table can be called a mini translation backup buffer (miniTLB) table to distinguish it from the existing translation backup buffer table in the processor. The specific implementation method of the translation backup buffer table can be selected according to the needs of the actual application, and is not limited here.
[0045] In this application's embodiments, the mapping table has multiple possibilities. When the mapping table includes a page table and a translation back buffer table, the implementation of the translation back buffer table also has multiple possibilities, all of which enrich the implementation methods of the technical solution of this application and improve the flexibility and practicality of the technical solution. Furthermore, when the mapping table includes a page table and a translation back buffer table, the translation back buffer table is queried first, leveraging its fast query speed to improve data processing speed.
[0046] 203. The storage-level memory controller determines whether there is a first physical address in the mapping table that corresponds to the first memory access instruction and is contained in the physical address range of the storage-level memory. If so, it executes step 204.
[0047] The first physical address that meets the conditions mentioned above refers to the physical address that corresponds to the first memory access instruction in the mapping table and is included in the physical address range of the storage-level memory. Here, "corresponding to the first memory access instruction" means corresponding to the target virtual address and target process identifier carried by the first memory access instruction.
[0048] If such a first physical address exists in the mapping table, it means that the first physical address is a memory pointer, and the data region accessed by the first memory access instruction is located in storage-level memory. In other words, the data to be accessed is not only large in volume but also stored in storage-level memory, which has relatively weak processing performance.
[0049] 204. Prefetch the data of the target memory page corresponding to the first physical address into dynamic random access memory.
[0050] If the storage-level memory controller determines that a first physical address corresponding to the first memory access instruction exists in the mapping table and is contained within the physical address range of the storage-level memory, the storage-level memory controller will prefetch the data of the target memory page corresponding to the first physical address into the dynamic random access memory. The target memory page corresponding to the first physical address can be a single memory page or multiple memory pages stored in the storage-level memory; the specific choice is not limited here.
[0051] Prefetching memory pages is performed because the data processing performance of storage-level memory is weaker than that of dynamic random access memory, and the amount of data to be accessed by the first memory access instruction is large. Without prefetching, the processor accesses data in storage-level memory, which is slower and has poorer performance. Prefetching can solve this problem.
[0052] Prefetching the target memory page corresponding to the first physical address into dynamic random access memory (DRAM) can also be understood as identifying the target memory page that is about to be accessed as a hot memory page, and the data in that memory page as hot data. Prefetching the data of the target memory page into DRAM actually prefetches the data of the target memory page into a second physical address, which is contained within the physical address range corresponding to DRAM. In other words, it changes the storage location of the data in the target memory page.
[0053] In this embodiment, by identifying and analyzing memory access instructions, it is determined whether the memory access instruction corresponds to a memory pointer and whether the indicated access region is located in storage-level memory. If the pointer indicates a memory pointer in storage-level memory, data prefetching is performed, prefetching the data of the target memory page to be accessed into dynamic random access memory. In other words, by identifying the physical address corresponding to the memory access instruction, the memory page to be accessed in the future is promoted to dynamic random access memory, improving the accuracy of data prefetching and accelerating the performance of subsequent data processing.
[0054] In some optional implementations, the storage-class memory controller constructs the mapping table before querying it, i.e., before step 202. The storage-class memory controller obtains the mapping between at least one virtual address, at least one process ID, and at least one physical address, and constructs the mapping table based on this mapping. Regardless of whether the mapping table includes a page table or a translation lookup buffer table, the mapping between virtual addresses, physical addresses, and process IDs is explicitly configured for the storage-class memory controller during the initialization phase (i.e., when the operating system running on the processor allocates new memory space). Here, the physical address, when within the physical address range of storage-class memory, refers to a memory pointer. The storage-class memory controller constructs the page table based on this and places the address of the page table in the CR register.
[0055] In this embodiment, the storage-level memory controller can obtain the correspondence between at least one virtual address, at least one process identifier and at least one physical address, and construct a mapping table based on this, which provides technical support for the implementation of the technical solution of this application and improves the feasibility of the technical solution of this application.
[0056] In some optional implementations, the storage-level memory controller also updates the mapping table. Specifically, after the data of the target memory page corresponding to the first physical address is prefetched into dynamic random access memory, that is, after step 204, the physical address corresponding to the target virtual address and the target process ID changes, so the mapping table needs to be updated.
[0057] Specifically, the operation of the storage-level memory controller prefetching data from the target memory page corresponding to the first physical address to dynamic random access memory involves first unmapping the mapping between the first physical address and the target virtual address and target process ID included in the first memory access instruction, and then establishing the mapping between the second physical address and the target virtual address and target process ID included in the first memory access instruction. The operation of unmapping the mapping between the first physical address and the target virtual address and target process ID included in the first memory access instruction can be called the unmap operation; the operation of establishing the mapping between the second physical address and the target virtual address and target process ID included in the first memory access instruction can be called the map operation.
[0058] Since there are multiple possibilities for the mapping table, there are also multiple ways to update the mapping table, which will be explained below.
[0059] 1) The mapping table includes the page table.
[0060] In this case, simply update the first physical address corresponding to the target virtual address and target process ID in the page table to the second physical address.
[0061] 2) The mapping table includes the page table and the translation backup buffer table.
[0062] In this scenario, the first physical address corresponding to the target virtual address and target process ID in the page table needs to be updated to the second physical address. Furthermore, since the translation lookup buffer table does not store the corresponding relationship during the initialization phase, the newly established relationship is stored in the translation lookup buffer table after prefetching. Corresponding to the previous embodiment, this means storing the correspondence between the target virtual address, target process ID, and second physical address in the translation lookup buffer table.
[0063] In this embodiment, after prefetching data from the storage-level memory to dynamic random access memory, the corresponding relationships in the mapping table are updated to adapt the mapping table to the actual data processing process. The specific update method varies depending on the type of mapping table, enriching the implementation options while ensuring smooth subsequent access operations, thus improving the feasibility of the technical solution.
[0064] After data prefetching, the processor can directly access the dynamic random access memory (DRAM) side when performing subsequent page accesses. That is, after step 204, step 205 can also be executed: the processor accesses the target memory page via DRAM.
[0065] In step 204, the storage-level memory controller prefetches the data of the target memory page corresponding to the first physical address into dynamic random access memory (DRAM). Therefore, the data accessed based on the first memory access instruction is also located in DRAM. Thus, the processor accesses DRAM to access the target memory page. Specifically, after prefetching, the physical address corresponding to the target inner page changes from the first physical address to the second physical address, and the processor actually accesses the data at the second physical address.
[0066] It is important to note that Figure 2 The main focus is on the storage-level memory controller, explaining the series of operations (including table lookup and data prefetching) performed by the controller after receiving a memory access instruction. The following section will introduce... Figure 3 This section focuses on explaining the changing process of the correspondence between virtual addresses, physical addresses, and target process IDs, from the perspective of registration, use, and migration. In other words, Figure 2 and Figure 3 Both are descriptions of the data processing procedure, but with slightly different focuses. Please refer to the following. Figure 3 , Figure 3 A flowchart illustrating the data processing method provided in this application.
[0067] like Figure 3 As shown, during the registration phase, the SCM controller initiates a memory request, the processor (central processing unit, CPU) allocates new memory space, and explicitly configures the mapping relationship of PA->VA->PID to the SCM controller, which records and builds a mapping table based on the mapping relationship.
[0068] During the usage phase, that is, after the CPU issues a memory access instruction to the SCM controller, the SCM controller will look up the mapping table based on the VA and PID carried by the memory access instruction to determine whether the physical address corresponding to the memory access instruction is a memory pointer and whether it is included in the physical address range of the SCM. The memory access instruction indicates access to data in the hybrid memory, which can be a load instruction or a store instruction, and the specific choice is not limited here.
[0069] When the SCM controller determines that the physical address corresponding to the memory access instruction is a memory pointer and falls within the SCM's physical address range, the SCM controller will remove the previous mapping relationship for that physical address, initiate a prefetch, point the physical address to a memory page, migrate that memory page and its data to DRAM, and then refresh the corresponding page table entries, thus establishing a new PA->VA->PID mapping relationship. Based on this, the CPU can directly access the DRAM side when performing subsequent page accesses.
[0070] The preceding explanation described the case where a physical address exists in the mapping table that meets the conditions—that is, a physical address in the mapping table that corresponds to the virtual address and process ID in the memory access instruction and is included within the SCM's physical address range. However, in practical applications, the SCM controller can also handle other types of memory access instructions, which will be explained below with reference to the diagram.
[0071] Please see Figure 4 , Figure 4 A flowchart illustrating the data processing method provided in this application.
[0072] like Figure 4 As shown, the physical address corresponding to VA#1 indicates a memory page in the SCM; that is, the physical address corresponding to VA#1 is a memory pointer in the SCM. In this embodiment, the SCM controller can identify this memory pointer and prefetch the data of the memory page corresponding to the memory pointer into the DRAM. The specific process has been explained above and will not be repeated here. It should be noted that... Figure 4 The process ID is omitted in the code. In practical applications, the process ID is still required to determine whether a memory pointer is a memory pointer.
[0073] The SCM controller can also identify virtual addresses corresponding to other data types. For example, the SCM controller can identify VA#2, which indicates data stored in DRAM, and / or VA#3, which indicates data stored in the SCM. In the former case, the data is already located in the high-performance DRAM and does not need to be migrated. In the latter case, what is being indicated is the data itself, not a memory pointer, and the amount of this data is usually small, typically 1 byte. Whether or not prefetching is performed has little impact on the data processing process; to conserve computing resources, this data can be left unfetched.
[0074] The above text combines Figures 2 to 4 The data processing method provided in this application is described in detail below, and will be combined with... Figures 5 to 6 This describes the data processing apparatus and chip provided according to embodiments of the present application.
[0075] Figure 5 A schematic diagram of the data processing apparatus provided in this application. Figure 5 As shown, the data processing device 500 includes a determination module 501 and a prefetch module 502.
[0076] The determination module 501 is used to obtain a first memory access instruction, which carries a target virtual address and a target process identifier, and the target process identifier indicates the process corresponding to the first memory access instruction; based on the target virtual address and the target process identifier, it queries a mapping table, which includes the correspondence between at least one virtual address, at least one process identifier and at least one physical address.
[0077] The prefetch module 502 is used to prefetch the data of the target memory page corresponding to the first physical address into dynamic random access memory if there is a first physical address corresponding to the target virtual address and the target process identifier in the mapping table, and the first physical address is included in the physical address range corresponding to the storage level memory.
[0078] It should be understood that the data processing apparatus 500 of this embodiment of the present invention can be implemented by a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a system-on-chip (SoC), or any combination thereof. It can also be implemented in software. Figures 2 to 4 In the data processing method shown, the data processing device 500 and its various modules can also be software modules.
[0079] In some optional implementations, the mapping table includes a page table, or the mapping table includes a page table and a translation back buffer table. If the mapping table includes a page table and a translation back buffer table, then the determination module 501 is specifically used to: query the translation back buffer table based on the target virtual address and the target process ID; if the translation back buffer table does not include the first physical address, then query the page table based on the target virtual address and the target process ID.
[0080] In some optional implementations, the prefetch module 502 is specifically used to prefetch data from the target memory page to a second physical address, the second physical address being included in the physical address range corresponding to the dynamic random access memory.
[0081] The determination module 501 is also used to update the correspondence between the target virtual address, the target process ID and the first physical address in the mapping table to the correspondence between the target virtual address, the target process ID and the second physical address.
[0082] In some optional implementations, the determination module 501 is specifically used to update the correspondence between the target virtual address, the target process ID and the first physical address in the page table to the correspondence between the target virtual address, the target process ID and the second physical address if the mapping table includes a page table and a translation back buffer table; and to store the correspondence between the target virtual address, the target process ID and the second physical address in the translation back buffer table.
[0083] In some optional implementations, the determination module 501 is further configured to obtain the correspondence between at least one virtual address, at least one process ID and at least one physical address; and to construct a mapping table based on the correspondence between at least one virtual address, at least one process ID and at least one physical address.
[0084] The data processing apparatus 500 according to the embodiments of this application can correspond to executing the method described in the embodiments of this application, and the above and other operations and / or functions of each unit in the data processing apparatus 500 are respectively for implementing Figures 2 to 4 For the sake of brevity, the corresponding processes executed by the SCM controller in each method are not described in detail here.
[0085] Please see Figure 6 , Figure 6 A schematic diagram of the structure of the chip provided in this application.
[0086] like Figure 6 As shown, chip 600 includes a power supply circuit 601 and a processing unit 602. The power supply circuit 601 supplies power to the processing unit 602, which is used to implement the aforementioned... Figures 1a to 4 The method shown will not be elaborated further here.
[0087] This application also provides a data processing system, such as Figure 7 As shown, Figure 7 This application also provides a schematic diagram of the structure of a data processing system 700.
[0088] like Figure 7As shown, the data processing system 700 includes an SCM controller 701, a memory 702, a communication interface 703 and a bus 704, a storage-level memory 705, and a dynamic random access memory 706. The SCM controller 701, memory 702, communication interface 703, storage-level memory 705, and dynamic random access memory 706 communicate via the bus 704, or via other means such as wireless transmission. The memory 702 stores instructions, and the SCM controller 701 executes the instructions stored in the memory 702. The memory 702 stores program code, and the SCM controller 701 can call the program code stored in the memory 702 to perform the following operations: A first memory access instruction is retrieved, carrying a target virtual address and a target process ID, with the target process ID indicating the process corresponding to the first memory access instruction. Based on the target virtual address and target process ID, a mapping table is consulted. The mapping table includes mappings between at least one virtual address, at least one process ID, and at least one physical address. If a first physical address corresponding to the target virtual address and target process ID exists in the mapping table, and this first physical address is within the physical address range corresponding to the storage-level memory, then the data of the target memory page corresponding to the first physical address is prefetched into dynamic random access memory. Furthermore, it is also possible to achieve... Figures 2 to 4 For the sake of brevity, the corresponding processes executed by the SCM controller in each method are not described in detail here.
[0089] It should be understood that in the embodiments of this application, the SCM controller 701 may be a CPU, or it may be other digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0090] The memory 702 may be a disk or hard disk, and provides instructions and data to the SCM controller 701. The memory 702 may also include non-volatile random access memory. For example, the memory 702 may also store device type information. The memory 702 may be volatile memory or non-volatile memory, or may include both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.
[0091] There are several types of 706 dynamic random access memory, such as synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), and synchronous link dynamic random access memory (SLDRAM), etc., which are not limited here.
[0092] In addition to the data bus, bus 704 may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus 704 in the diagram.
[0093] The 704 bus can be a Peripheral Component Interconnect Express (PCIe) bus, or an Extended Industry Standard Architecture (EISA) bus, a unified bus (Ubus or UB), a Compute Express Link (CXL) bus, a Cache Coherent Interconnect for Accelerators (CCIX) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc.
[0094] It should be understood that the SCM controller 701 in this application embodiment can correspond to the data processing device 500 in this application embodiment, and can correspond to the corresponding subject in executing the method of this application embodiment, and the above and other operations and / or functions of each module in the data processing device 500 are respectively for implementing Figures 1a to 4 For the sake of brevity, the corresponding processes of each method in the code will not be elaborated here.
[0095] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive (SSD).
[0096] The above description is merely a specific embodiment of the present invention. Those skilled in the art can conceive of variations or substitutions based on the specific embodiments provided in this application, and all such variations or substitutions should be covered within the protection scope of this application.
Claims
1. A data processing method, characterized by, The method is applied to a hybrid memory system, which includes storage-level memory and dynamic random access memory. The method includes: Obtain a first memory access instruction, the first memory access instruction carrying a target virtual address and a target process identifier, the target process identifier indicating the process corresponding to the first memory access instruction; Based on the target virtual address and the target process ID, a mapping table is queried, the mapping table including the correspondence between at least one virtual address, at least one process ID and at least one physical address; If the mapping table contains a first physical address corresponding to the target virtual address and the target process identifier, and the first physical address is included in the physical address range corresponding to the storage-level memory, then the data of the target memory page corresponding to the first physical address is prefetched into the dynamic random access memory.
2. The method of claim 1, wherein, The mapping table includes a page table, or the mapping table includes a page table and a translation fallback buffer table; If the mapping table includes the page table and the translation back buffer table, then querying the mapping table based on the target virtual address and the target process ID includes: Based on the target virtual address and the target process identifier, query the translation backup buffer table; If the first physical address is not included in the translation backup buffer table, then the page table is queried based on the target virtual address and the target process identifier.
3. The method according to claim 1 or 2, characterized in that, The step of prefetching the data of the target memory page corresponding to the first physical address into dynamic random access memory includes: The data of the target memory page is prefetched to a second physical address, where the second physical address is included in the physical address range corresponding to the dynamic random access memory; The method further includes: The mapping relationship between the target virtual address, the target process ID, and the first physical address in the mapping table is updated to the mapping relationship between the target virtual address, the target process ID, and the second physical address.
4. The method of claim 3, wherein, The step of updating the mapping table from the target virtual address, the target process ID, and the first physical address to the mapping table from the target virtual address, the target process ID, and the second physical address includes: If the mapping table includes the page table and the translation back buffer table, then the correspondence between the target virtual address, the target process ID and the first physical address in the page table is updated to the correspondence between the target virtual address, the target process ID and the second physical address. The method further includes: The correspondence between the target virtual address, the target process identifier, and the second physical address is stored in the translation backup buffer table.
5. The method according to any one of claims 1 to 4, characterized in that, Prior to querying the mapping table, the method further includes: Obtain the correspondence between at least one virtual address, at least one process ID, and at least one physical address; The mapping table is constructed based on the correspondence between the at least one virtual address, the at least one process identifier, and the at least one physical address.
6. A data processing apparatus, characterized by include: The determination module is used to obtain a first memory access instruction, the first memory access instruction carrying a target virtual address and a target process identifier, the target process identifier indicating the process corresponding to the first memory access instruction; The determination module is further configured to query a mapping table based on the target virtual address and the target process identifier, wherein the mapping table includes a correspondence between at least one virtual address, at least one process identifier and at least one physical address; The prefetch module is configured to prefetch data from the target memory page corresponding to the first physical address to the dynamic random access memory if the mapping table contains a first physical address corresponding to the target virtual address and the target process identifier, and the first physical address is included in the physical address range corresponding to the storage-level memory.
7. The apparatus of claim 6, wherein, The mapping table includes a page table, or the mapping table includes a page table and a translation fallback buffer table; If the mapping table includes the page table and the translation backup buffer table, then the determination module is specifically used for: Based on the target virtual address and the target process identifier, query the translation backup buffer table; If the first physical address is not included in the translation backup buffer table, then the page table is queried based on the target virtual address and the target process identifier.
8. The apparatus of claim 6 or 7, wherein, The prefetch module is specifically used to prefetch the data of the target memory page to a second physical address, wherein the second physical address is included in the physical address range corresponding to the dynamic random access memory; The determination module is further configured to update the correspondence between the target virtual address, the target process identification number and the first physical address in the mapping table to the correspondence between the target virtual address, the target process identification number and the second physical address.
9. The apparatus of claim 8, wherein, The determination module is specifically used to update the correspondence between the target virtual address, the target process ID and the first physical address in the page table to the correspondence between the target virtual address, the target process ID and the second physical address if the mapping table includes the page table and the translation backup buffer table. The determination module is further configured to store the correspondence between the target virtual address, the target process identifier and the second physical address in the translation backup buffer table.
10. The apparatus of any one of claims 6 to 9, wherein, The determination module is further configured to: Obtain the correspondence between at least one virtual address, at least one process ID, and at least one physical address; The mapping table is constructed based on the correspondence between the at least one virtual address, the at least one process identifier, and the at least one physical address.
11. A chip, characterized by include: Processing unit and power supply circuit; The power supply circuit supplies power to the processing unit; The processing unit is used to execute the method of any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a processor, implement the method of any one of claims 1 to 5.
