WO2023098032A1 - 一种内存空间扩展方法、装置及电子设备和存储介质 - Google Patents

一种内存空间扩展方法、装置及电子设备和存储介质 Download PDF

Info

Publication number
WO2023098032A1
WO2023098032A1 PCT/CN2022/099646 CN2022099646W WO2023098032A1 WO 2023098032 A1 WO2023098032 A1 WO 2023098032A1 CN 2022099646 W CN2022099646 W CN 2022099646W WO 2023098032 A1 WO2023098032 A1 WO 2023098032A1
Authority
WO
WIPO (PCT)
Prior art keywords
page table
virtual address
physical address
remote
server
Prior art date
Application number
PCT/CN2022/099646
Other languages
English (en)
French (fr)
Inventor
刘伟
宿栋栋
沈艳梅
阚宏伟
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023098032A1 publication Critical patent/WO2023098032A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/109Address translation for multiple virtual address spaces, e.g. segmentation

Definitions

  • the present application relates to the field of computer technology, and more specifically, to a memory space expansion method and device, an electronic device, and a computer-readable storage medium.
  • Virtual memory management (Virtual Memory Management) technology divides the address space into virtual addresses and physical addresses, and the memory management unit (MMU, Memory Management Unit) is used to realize the conversion between virtual addresses and physical addresses.
  • MMU Memory Management Unit
  • each application has its own page table, which is created by the operating system when the program starts. But at this time, there are no valid entries in the page table (initializing all the entries when the page table is created is a waste of time and memory space occupied by the page table itself), only when the application actually accesses a certain address, the relevant The table entry will be created by the page fault exception handler in the operating system.
  • the range of physical addresses is limited by the specific hardware.
  • the physical address of a single server is generally between tens of GB and several TB, which is far smaller than the virtual address space. That is, the physical address space of a single server cannot meet the needs of the virtual address space. .
  • the present application provides a memory space expansion method, which is applied to a server.
  • the server includes a first FPGA, and the first FPGA is connected to a second FPGA in a remote memory array device;
  • the method includes:
  • the first FPGA includes a first RDMA network card module
  • the second FPGA includes a second RDMA network card module
  • the first RDMA network card module and the second RDMA network card module are connected through a network.
  • it also includes:
  • the virtual address is converted into a physical address based on the local page table entry or the remote page table entry.
  • it also includes:
  • a native page table entry corresponding to the virtual address is created based on the unallocated physical address in the server.
  • the access instruction is a data movement instruction
  • the data is moved according to the data movement direction
  • the access instruction is a calculation instruction and contains calculation data, calculate the calculation data according to the instruction code
  • the access instruction is a computing instruction and includes the source virtual address for reading computing data
  • data migration is performed according to the direction of data migration, including:
  • the access instruction includes the first virtual address and the second virtual address
  • the first physical address corresponding to the first virtual address is queried in the local page table, and the remote page table querying the second physical address corresponding to the second virtual address
  • the access instruction includes the first virtual address and the second virtual address
  • the first physical address corresponding to the first virtual address is queried in the local page table, and the remote page table Querying the second physical address corresponding to the second virtual address
  • the destination physical address corresponding to the destination virtual address is queried from the local page table or the remote page table, and the calculation result is written into the destination physical address.
  • the present application provides a memory space expansion device, which is applied to a server.
  • the server includes a first FPGA, and the first FPGA is connected to a second FPGA in a remote memory array device;
  • the unit includes:
  • a query module configured to receive an access instruction including a virtual address
  • a judging module configured to start the workflow of the first creation module when there is no page table entry corresponding to the virtual address in the query local page table and the remote page table, and there is no unallocated physical address in the server;
  • the first creating module is configured to create a remote memory page table entry corresponding to the virtual address based on the physical address in the remote memory array device.
  • the present application provides an electronic device, including a memory and one or more processors.
  • Computer-readable instructions are stored in the memory.
  • the one or more The processor executes the steps of any one of the memory space expansion methods above.
  • the present application also provides one or more non-volatile computer-readable storage media storing computer-readable instructions.
  • the above-mentioned computer-readable instructions are executed by one or more processors, the above-mentioned one or more processors execute The steps of any one of the memory space expansion methods above.
  • FIG. 1 is an architecture diagram of a memory expansion system provided by the present application according to one or more embodiments
  • Fig. 2 is a flowchart of a memory space expansion method shown according to one or more embodiments
  • Fig. 3 is a flowchart of another memory space expansion method shown according to one or more embodiments.
  • FIG. 4 is a schematic diagram of converting a virtual address into a physical address by the MMU
  • Fig. 5 is a flow chart showing another method for expanding memory space according to one or more embodiments.
  • Fig. 6 is a processing flow chart of a data movement instruction according to one or more embodiments.
  • Fig. 7 is a flowchart showing a processing instruction according to one or more embodiments.
  • Fig. 8 is a structural diagram of a device for expanding memory space according to one or more embodiments.
  • Fig. 9 is a structural diagram of an electronic device according to one or more embodiments.
  • Fig. 1 shows the framework diagram of a kind of memory expansion system that the embodiment of the present application provides, as shown in Fig. 1, comprises server and remote memory array device, and server comprises CPU (central processing unit (central processing unit)
  • CPU central processing unit
  • the chip and the first FPGA Field Programmable Gate Array, Field Programmable Logic Gate Array
  • the remote memory array device includes memory and the second FPGA, and the first FPGA is connected to the second FPGA.
  • the first FPGA is inserted into the PCIE (peripheral component interconnect express, a high-speed serial computer expansion bus standard) slot of the server, that is, the FPGA and the external bus are connected through the PCIE bridge, and the CPU can pass the external address bus-PCIE
  • the bridge accesses the first FPGA, and the first FPGA can access the local memory through the PCIE bridge-external address bus.
  • the local memory includes multiple DDR (Double Data Rate SDRAM) memory sticks.
  • the memory in the remote memory array device and the second FPGA may also be connected through PCIE.
  • the first FPGA includes a processor instruction module and the first RDMA (remote direct address access, Remote Direct Memory Access) network card module
  • the second FPGA includes the second RDMA network card module, the first RDMA network card module and the second RDMA network card module connected through the network.
  • the remote memory array is used as the physical carrier to expand the memory space, and the remote memory array is connected to the local server host through the RDMA network card.
  • the processor instruction module is used to access the remote memory based on the access instructions issued by the CPU. .
  • the virtual address generated by the processor core is first transmitted to the MMU through the internal bus.
  • the MMU converts the virtual address into a physical address, and accesses the memory through the external bus through the physical address.
  • the local MMU After the CPU sends an instruction related to address access, if the corresponding physical address is in the remote memory array device, the local MMU will inevitably have a page fault exception.
  • the page fault exception handler in the operating system will check whether the physical address is local or remote. If it is remote, it will search or create a remote memory page table entry to obtain the physical address of the remote memory. Then pass the specific instruction code to the processor instruction processing module in the FPGA. After parsing the processor instruction and looking for the remote memory page table entry, this module will access the remote memory through the RDMA network card module in the FPGA. If necessary Instruction results can also be saved to native memory or to processor registers.
  • the maximum capacity of a single memory is 128GB, and a CPU can support 8 memory slots, that is, the maximum support is 1TB.
  • a server with a single NUMA system can support multiple CPUs. If it is two-way, the maximum supported memory will be multiplied by 2, and the highest is 8-way, that is, multiplied by 8. That is, the current stand-alone server supports a maximum of 8TB of memory.
  • This application can extend the physical memory to multiple remote memory array devices through the RDMA network, which can theoretically reach the upper limit of 64-bit addresses. But the so-called 64-bit CPU in reality may only support 48-bit virtual addresses, and here even with 48-bit calculations, the expandable address space can reach 32 times that of 8T.
  • the embodiment of the present application discloses a memory space expansion method, which solves the technical problem that the physical address space of a single server cannot meet the requirement of the virtual address space.
  • FIG. 2 a flow chart of a memory space expansion method shown according to an exemplary embodiment, as shown in FIG. 2, is described by taking the method applied to the server in FIG. 1 as an example, including:
  • S101 Receive an access instruction containing a virtual address, and query whether there is a page table entry corresponding to the virtual address in the local page table and the remote page table; if there is a local page table corresponding to the virtual address in the local page table or the remote page table entry or remote page table entry, then enter S102; if there is no local page table entry or remote page table entry corresponding to the virtual address in the local page table and remote page table, then enter S103;
  • the execution subject of this embodiment is the server introduced in the above embodiment, as shown in Figure 3, when the MMU receives the access command containing the virtual address sent by the CPU, it queries whether there is If the page table entry corresponding to the virtual address exists, go to S102; if not, go to S103.
  • S102 Translate the virtual address into a physical address based on the local page table entry or the remote page table entry;
  • the virtual address is converted to a physical address based on the native page table entry; if the remote page table has a remote page corresponding to the virtual address table entry, the virtual address is converted into a physical address based on the remote page table entry, and the access instruction is sent to the external bus.
  • the MMU uses a first-level page table to convert virtual addresses to physical addresses.
  • the MMU will use the first few digits of the virtual address issued by the processor core (the specific digits depend on the CPU manufacturer or processor implementation standard) as an index to look up the page table, and the found page table entry stores the corresponding physical address page The starting address, and then this starting address will be combined as the page frame number and the page offset in the virtual address to become the physical address.
  • S103 Determine whether there is an unallocated physical address in the server; if yes, proceed to S104; if not, proceed to S105;
  • the page fault exception handling program in the operating system in the prior art is modified, and before creating the local page table entry, it is judged whether there is an unallocated physical address in the server, that is, it is judged that the address corresponding to the access instruction Whether the physical address is in the memory of the server, if yes, go to S104, if not, go to S105.
  • S104 Create a native page table entry corresponding to the virtual address based on the unallocated physical address in the server;
  • S105 Create a remote memory page table entry corresponding to the virtual address based on the physical address in the remote memory array device.
  • the server receives the access command containing the virtual address, and queries whether there is a page table entry corresponding to the virtual address in the local page table and the remote page table. For the page table entry corresponding to the address, it is judged whether there is an unallocated physical address in the server, and it is judged that there is no unallocated physical address in the server. Based on the judgment result, the remote memory array device based on the physical address in the virtual address is created. Memory page table entries.
  • the access instruction is sent to the first FPGA through the PCIE channel, and is received by the processor instruction processing module therein.
  • the creation and search methods of the remote memory page table entries are similar to those of the native page table entries. What needs to be noted is that if the server uses multiple remote memory array devices, the remote memory page table entries contain the value of the physical address , it is also necessary to add the ID number of the remote memory array device for distinction.
  • the server includes a first FPGA
  • the remote memory array device includes a second FPGA
  • the first FPGA is connected to the second FPGA to enable the server to access the remote memory array device.
  • the physical address in the remote memory array device can be allocated. It can be seen that the embodiment of the present application expands the physical address space of a single server, which solves the technical problem that the physical address space of a single server cannot meet the requirements of the virtual address space.
  • the embodiment of the present application discloses a memory space expansion method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. specific:
  • FIG. 5 a flowchart of another memory space expansion method shown according to an exemplary embodiment, as shown in FIG. 5 , includes:
  • the processor instruction processing module in the first FPGA after the processor instruction processing module in the first FPGA receives the access instruction issued by the processor core, it needs to analyze it to determine the instruction type, and further process it.
  • the instruction type may include Data movement class and computing class.
  • the access instruction includes the source virtual address in the server, that is, the first virtual address, and the destination virtual address in the remote memory array device.
  • the address is the second virtual address.
  • the first physical address corresponding to the first virtual address is queried in the local page table, and the second physical address corresponding to the second virtual address is queried in the remote page table.
  • the first physical address of the slave server The first data is read in, and the first data is sent to the remote memory array device, and written into the second physical address.
  • the access command includes the destination virtual address in the server, which is the first virtual address, and the source virtual address in the remote memory array device, which is the second virtual address, then the local Query the first physical address corresponding to the first virtual address in the page table, query the second physical address corresponding to the second virtual address in the remote page table, and send a memory read instruction to the remote memory array device to read from the remote memory
  • the second physical address in the array device reads the second data, and writes the second data into the first physical address of the server.
  • the access instruction is a computing instruction and includes a source virtual address for reading computing data, query the source physical address corresponding to the source virtual address from the local page table or remote page table, and read the computing data from the source physical address After that, calculate the calculation data according to the instruction code.
  • the access instruction is a calculation instruction, as shown in Figure 7, it needs to be further classified, if its type is read first and then calculate, that is, the access instruction contains the source virtual address of the read calculation data, then query Local page table or remote page table. If the source physical address corresponding to the source virtual address is in the server, the calculation data is read from the local memory through PCIE; if the source physical address corresponding to the source virtual address is in the remote memory array device, the data is sent to the second The RDMA module sends the RDMA_READ command to read computing data from the remote memory array device. After the calculation data is read, the calculation data is calculated according to the CPU instruction code. If the type of the calculation instruction is direct calculation, that is, the access instruction contains calculation data, the calculation data is directly calculated according to the CPU instruction code.
  • the instruction code after calculating the calculation data according to the instruction code, it also includes: if the calculation result needs to be saved, and the access instruction contains the destination virtual address for saving the calculation result, querying from the local page table or the remote page table The destination physical address corresponding to the destination virtual address, and the calculation result is written into the destination physical address.
  • the access instruction includes the destination virtual address for saving the calculation result, and queries the local page table or the remote page table. If the destination physical address corresponding to the destination virtual address is in the server, the calculation result is written into the local memory through PCIE; if the destination physical address corresponding to the destination virtual address is in the remote memory array device, the calculation result is written to the second
  • the RDMA module sends the RDMA_WRITE command to write the calculation result to the remote memory array device.
  • the processor instruction code is written into the execution receiving register of the first FPGA, and is received by the processor instruction processing module in the first FPGA.
  • the processor instruction processing module After the processor instruction processing module searches the page table, if it finds that the destination address in the processor instruction is in the remote memory array and the source address is in the local memory, it will perform the following operations.
  • a device for expanding memory space provided by an embodiment of the present application is introduced below.
  • the device for expanding memory space described below and the method for expanding memory space described above may refer to each other.
  • FIG. 8 a structural diagram of a device for expanding memory space according to an exemplary embodiment, as shown in FIG. 8 , includes:
  • the query module 801 is configured to receive an access command including a virtual address, and query whether there is a page table entry corresponding to the virtual address in the local page table and the remote page table; if none exists, start the workflow of the judgment module 802;
  • a judging module 802 configured to judge whether there is an unallocated physical address in the server; if not, start the workflow of the first creating module 803;
  • the first creating module 803 is configured to create a remote memory page table entry corresponding to the virtual address based on the physical address in the remote memory array device.
  • the server includes a first FPGA
  • the remote memory array device includes a second FPGA
  • the first FPGA is connected to the second FPGA to enable the server to access the remote memory array device.
  • the physical address in the remote memory array device can be allocated. It can be seen that the embodiment of the present application expands the physical address space of a single server, which solves the technical problem that the physical address space of a single server cannot meet the requirements of the virtual address space.
  • the first FPGA includes a first RDMA network card module
  • the second FPGA includes a second RDMA network card module
  • the first RDMA network card module and the second RDMA network card module pass through a network connect.
  • the conversion module is used to convert the virtual address into physical address.
  • the second creating module is configured to create a native page table entry corresponding to the virtual address based on the unallocated physical address in the server if there is an unallocated physical address in the server.
  • the analysis module is used to analyze the access instruction to determine the instruction type of the access instruction
  • the data movement module is used to perform data movement according to the data movement direction if the access instruction is a data movement instruction;
  • the first calculation module is used to calculate the calculation data according to the instruction code if the access instruction is a calculation instruction and contains calculation data;
  • the second calculation module is used to query the source physical address corresponding to the source virtual address from the local page table or the remote page table if the access instruction is a calculation instruction and includes a source virtual address for reading calculation data, and obtains the source physical address from the source physical address. After the calculation data is read by the address, the calculation data is calculated according to the instruction code.
  • the data movement module includes:
  • the first query unit is configured to query the first physical address corresponding to the first virtual address in the local page table if the data migration direction is from the server to the remote memory array device and the access instruction includes the first virtual address and the second virtual address. address, querying the second physical address corresponding to the second virtual address in the remote page table;
  • a sending unit configured to read the first data from the first physical address of the server, send the first data to the remote memory array device, and write the first data to the second physical address;
  • the second query unit is used to query the first physical address corresponding to the first virtual address in the local page table if the data migration direction is from the server to the remote memory array device and the access instruction includes the first virtual address and the second virtual address. address, querying the second physical address corresponding to the second virtual address in the remote page table;
  • the reading unit is configured to send a memory read instruction to the remote memory array device, so as to read the second data from the second physical address in the remote memory array device and write it into the first physical address of the server.
  • the saving module is used to query the destination physical address corresponding to the destination virtual address from the local page table or the remote page table if the calculation result needs to be saved, and the access instruction contains the destination virtual address for saving the calculation result, and write the calculation result into the destination physical address.
  • FIG. 9 is a structural diagram of an electronic device according to an exemplary embodiment, as shown in As shown in Figure 9, the electronic equipment includes:
  • Communication interface 1 which can exchange information with other devices such as network devices;
  • the processor 2 is connected to the communication interface 1 to implement information interaction with other devices, and is used to execute the memory space expansion method provided by one or more of the above technical solutions when running computer-readable instructions. Instead, computer readable instructions are stored on the memory 3 .
  • bus system 4 is used to realize connection and communication between these components.
  • the bus system 4 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as bus system 4 in FIG. 9 .
  • the memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer readable instructions for operating on an electronic device.
  • the memory 3 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories.
  • the non-volatile memory can be read-only memory (ROM, Read Only Memory), programmable read-only memory (PROM, Programmable Read-Only Memory), erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface storage can be disk storage or tape storage.
  • the volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache.
  • RAM random access memory
  • RAM Random Access Memory
  • many forms of RAM are available, such as Static Random Access Memory (SRAM, Static Random Access Memory), Synchronous Static Random Access Memory (SSRAM, Synchronous Static Random Access Memory), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory ).
  • the memory 3 described in the embodiment of the present application is intended to include but not limited to these and any other suitable types of memory.
  • Processor 2 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 2 or instructions in the form of software.
  • the aforementioned processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.
  • the processor 2 may implement or execute various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in the storage medium, and the storage medium is located in the memory 3, and the processor 2 reads the program in the memory 3, and completes the steps of the foregoing method in combination with its hardware.
  • the embodiment of the present application also provides a non-volatile computer-readable storage medium, where computer-readable instructions are stored in the non-volatile computer-readable storage medium, and the computer-readable instructions are stored in When executed by one or more processors, the steps of the method for expanding memory space in any one of the foregoing embodiments may be implemented.
  • Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions.
  • the above-mentioned computer-readable instructions can be stored in a non-volatile computer-readable When being read from the storage medium, the computer-readable instructions may include the processes of the embodiments of the above-mentioned methods when executed.
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • DDRSDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced SDRAM
  • SLDRAM Synchronous Chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请公开了一种内存空间扩展方法、装置及一种电子设备和计算机可读存储介质,应用于服务器,所述服务器包括第一FPGA,所述第一FPGA与远端内存阵列设备中的第二FPGA连接;所述方法包括:接收包含虚拟地址的访问指令,查询本机页表和远端页表中是否存在所述虚拟地址对应的页表项;若所述本机页表和所述远端页表中均不存在所述虚拟地址对应的页表项,则判断所述服务器是否存在未分配的物理地址;若所述服务器不存在未分配的物理地址,则基于所述远端内存阵列设备中的物理地址创建所述虚拟地址对应的远端内存页表项。

Description

一种内存空间扩展方法、装置及电子设备和存储介质
相关申请的交叉引用
本申请要求于2021年11月30日提交中国专利局,申请号为202111438244.4,申请名称为“一种内存空间扩展方法、装置及电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,更具体地说,涉及一种内存空间扩展方法、装置及一种电子设备和一种计算机可读存储介质。
背景技术
虚拟内存管理(Virtual Memory Management)技术将地址空间分成了虚拟地址和物理地址,内存管理单元(MMU,Memory Management Unit)用于实现虚拟地址与物理地址之间的转换。
在MMU工作的过程中,页表的维护/更新成为了系统中关键的一节。每个应用程序(进程)都有自己的页表,由操作系统在程序启动时创建。但这时页表中没有有效的表项(页表建立时就初始化所有的表项既浪费时间也浪费页表自身所占的内存空间),只有在应用程序真正访问某一地址时,相关的表项才会被操作系统中的缺页异常处理程序创建。
发明人意识到,现代CPU一般是64位的,意味着虚拟地址的范围为0-0xFFFFFFFFFFFFFFFF。但物理地址的范围受到具体硬件的限制,单个服务器的物理地址一般在几十GB到几TB之间,远远小于虚拟地址空间,也即,单个服务器的物理地址空间无法满足虚拟地址空间的需要。
因此,如何解决单个服务器的物理地址空间无法满足虚拟地址空间的需要的技术问题,是本领域技术人员需要关注的。
发明内容
本申请提供了一种内存空间扩展方法,应用于服务器,服务器包括第一FPGA,第一FPGA与远端内存阵列设备中的第二FPGA连接;
该方法包括:
接收包含虚拟地址的访问指令;和
在查询本机页表和远端页表中均不存在虚拟地址对应的页表项,且服务器不存在未分配的物理地址时,基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项。
在其中一个实施例中,第一FPGA包括第一RDMA网卡模块,第二FPGA包括第二RDMA网卡模块,第一RDMA网卡模块与第二RDMA网卡模块之间通过网络连接。
在其中一个实施例中,还包括:
在本机页表或远端页表存在虚拟地址对应的本机页表项或远端页表项时,基于本机页表项或远端页表项将虚拟地址转换为物理地址。
在其中一个实施例中,还包括:
在服务器中存在未分配的物理地址时,基于服务器中未分配的物理地址创建虚拟地址对应的本机页表项。
在其中一个实施例中,接收包含虚拟地址的访问指令之后,还包括:
对访问指令进行解析,以确定访问指令的指令类型;
在访问指令为数据搬移类指令时,根据数据搬移方向进行数据搬移;
在访问指令为计算类指令且包含计算数据时,按照指令码对计算数据进行计算;和
在访问指令为计算类指令且包含读取计算数据的源虚拟地址时,从本机页表或远端页表中查询源虚拟地址对应的源物理地址,从源物理地址读取计算数据后,按照指令码对计算数据进行计算。
在其中一个实施例中,根据数据搬移方向进行数据搬移,包括:
在数据搬移方向为服务器向远端内存阵列设备、访问指令包含第一虚拟地址和第二虚拟地址时,在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址;
从服务器的第一物理地址中读取第一数据,并将第一数据发送至远端内存阵列设备,写入第二物理地址;
在数据搬移方向为远端内存阵列设备向服务器、访问指令包含第一虚拟地址和第二虚拟地址时,在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址;和
向远端内存阵列设备发送内存读取指令,以从远端内存阵列设备中的第二物理地址读取第二数据,写入服务器的第一物理地址。
在其中一个实施例中,按照指令码对计算数据进行计算之后,还包括:
在计算结果需要保存、访问指令包含保存计算结果的目的虚拟地址时,从本机页表或远端页表中查询目的虚拟地址对应的目的物理地址,将计算结果写入目的物理地址。
本申请提供了一种内存空间扩展装置,应用于服务器,服务器包括第一FPGA,第一FPGA与远端内存阵列设备中的第二FPGA连接;
该装置包括:
查询模块,用于接收包含虚拟地址的访问指令;
判断模块,用于在查询本机页表和远端页表中均不存在虚拟地址对应的页表项,且服务器不存在未分配的物理地址时,启动第一创建模块的工作流程;和
第一创建模块,用于基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项。
本申请提供了一种电子设备,包括存储器及一个或多个处理器,存储器中储存有计算机可读指令,上述计算机可读指令被上述一个或多个处理器执行时,使得上述一个或多个处理器执行上述任意一项内存空间扩展方法的步骤。
本申请还提供了一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,上述计算机可读指令被一个或多个处理器执行时,使得上述一个或多个处理器执行上述任意一项内存空间扩展方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。附图是用来提供对本公开的进一步理解,并且构成 说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。在附图中:
图1为本申请根据一个或多个实施例提供的一种内存扩展系统的架构图;
图2为根据一个或多个实施例示出的一种内存空间扩展方法的流程图;
图3为根据一个或多个实施例示出的另一种内存空间扩展方法的流程图;
图4为MMU将虚拟地址转换为物理地址的示意图;
图5为根据一个或多个实施例示出的又一种内存空间扩展方法的流程图;
图6为根据一个或多个实施例示出的一种数据搬移类指令的处理流程图;
图7为根据一个或多个实施例示出的一种计算类指令的处理流程图;
图8为根据一个或多个实施例示出的一种内存空间扩展装置的结构图;
图9为根据一个或多个实施例示出的一种电子设备的结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。另外,在本申请实施例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
为了便于理解本申请提供的热点挖掘方法,下面对其使用的系统进行介绍。参见图1,其示出了本申请实施例提供的一种内存扩展系统的架构图,如图1所示,包括服务器和远端内存阵列设备,服务器包括CPU(中央处理器(central processing unit)芯片和第一FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列),远端内存阵列设备包括内存和第二FPGA,第一FPGA与第二FPGA连接。
在具体实施中,第一FPGA插入服务器的PCIE(peripheral component interconnect express,一种高速串行计算机扩展总线标准)插槽中,即将FPGA和外部总线通过PCIE桥连接,CPU可以通过外部地址总线-PCIE桥访问第一FPGA,第一FPGA可以通过PCIE桥-外部地址总线访问本机内存,本地内存包括多个DDR(双倍速率同步动态随机存取存储器,Double Data Rate SDRAM)内存条。远端的内存阵列设备中的内存和第二FPGA之间可以也通过PCIE连接。
优选的,第一FPGA包括处理器指令模块和第一RDMA(远程直接地址访问, Remote Direct Memory Access)网卡模块,第二FPGA包括第二RDMA网卡模块,第一RDMA网卡模块与第二RDMA网卡模块之间通过网络连接。在具体实施中,使用远端内存阵列作为扩展内存空间的物理载体,将远端内存阵列与本地服务器主机通过RDMA网卡相连,处理器指令模块用于基于CPU发出的访问指令进行远端内存的访问。处理器核产生虚拟地址首先通过内部总线传输至MMU,MMU将虚拟地址转换为物理地址,通过物理地址用外部总线访问内存。
在CPU发出地址访问相关的指令后,如果对应物理地址在远端内存阵列设备中,本地MMU必然会发生缺页异常。操作系统中的缺页异常处理程序会检查物理地址在本机还是远端,如果是远端,会查找或新建远端内存页表项,得到远端内存的物理地址。随后将具体的指令码传递给FPGA中的处理器指令处理模块,此模块在解析处理器指令和查找远端内存页表项后,会通过FPGA中的RDMA网卡模块访问远端内存,有必要的话还可以将指令结果保存到本机内存或处理器寄存器中。
目前最大容量的单根内存是128GB,一个CPU可以支持8个内存槽位,也就是最大支持1TB。单个NUMA系统的服务器可以支持多路CPU。如果是双路,则最大支持的内存会乘以2,最高是8路,也就是乘以8。即当前单机服务器最大支持8TB的内存。
本申请可以通过RDMA网络将物理内存扩展到多个远端内存阵列设备,理论上可以达到64位地址上限。但实际中的所谓64位CPU可能只支持48位的虚拟地址,在这里即使以48位计算,可扩展的地址空间也可以达到8T的32倍。
由此可见,在本申请中,工程师不需要改变程序架构就可以使需要超大物理地址空间的应用程序运行在单主机上,降低了应用程序设计的复杂度和开发维护成本。
本申请实施例公开了一种内存空间扩展方法,解决了单个服务器的物理地址空间无法满足虚拟地址空间的需要的技术问题。
参见图2,根据一示例性实施例示出的一种内存空间扩展方法的流程图,如图2所示,以该方法应用于图1中的服务器为例进行说明,包括:
S101:接收包含虚拟地址的访问指令,查询本机页表和远端页表中是否存在虚拟地址对应的页表项;若本机页表或远端页表存在虚拟地址对应的本机页表项或远端页表项,则进入S102;若本机页表和远端页表均不存在虚拟地址对应的本机页表项或远端页表项,则进入S103;
本实施例的执行主体为上述实施例中介绍的服务器,如图3所示,其中的MMU接收到CPU发送的包含虚拟地址的访问指令时,查询本机页表和远端页表中是否存在虚拟 地址对应的页表项,若存在,则进入S102,若否,则进入S103。S102:基于本机页表项或远端页表项将虚拟地址转换为物理地址;
在本步骤中,若本机页表存在虚拟地址对应的本机页表项,则基于该本机页表项将虚拟地址转换为物理地址,若远端页表存在虚拟地址对应的远端页表项,则基于该远端页表项将虚拟地址转换为物理地址,访问指令发往外部总线。
如图4所示,描述了MMU使用一个一级页表进行虚拟地址到物理地址的转换。MMU会把处理器核发出的虚拟地址的前几位(具体是几位取决于CPU厂商或处理器实现标准)做为索引去查找页表,找到的页表项中存储的是相应物理地址页的起始地址,随后这个起始地址会被作为页框码和虚拟地址中的页内偏移量组合,成为物理地址。
S103:判断服务器是否存在未分配的物理地址;若是,则进入S104;若否,则进入S105;
在本步骤中,若本机页表不存在虚拟地址对应的本机页表项,远端页表也不存在虚拟地址对应的远端页表项,则进入缺页异常处理程序。在本实施例中,对现有技术中的操作系统中的缺页异常处理程序进行修改,在创建本机页表项前,判断服务器是否存在未分配的物理地址,也即判断访问指令对应的物理地址是否在服务器的内存中,若是,则进入S104,若否,则进入S105。
S104:基于服务器中未分配的物理地址创建虚拟地址对应的本机页表项;
S105:基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项。
其中,服务器接收到包含虚拟地址的访问指令,查询本机页表和远端页表中是否存在虚拟地址对应的页表项,在查询到本机页表和远端页表中均不存在虚拟地址对应的页表项时,判断服务器是否存在未分配的物理地址,判定服务器不存在未分配的物理地址,基于该判定结果执行基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项。
在具体实施中,若服务器中存在未分配的物理地址,则基于服务器中未分配的物理地址创建虚拟地址对应的本机页表项,即建立虚拟地址与服务器中的物理地址之间的对应关系。若服务器中不存在未分配的物理地址,则基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项,即建立虚拟地址与远端内存阵列设备中的物理地址之间的对应关系,然后将访问指令经过PCIE通道发送至第一FPGA,由其中的处理器指令处理模块接收。
远端内存页表项的创建和查找方式与本机页表项类似,需要特别说明的是,如果服务器使用多个远端内存阵列设备,远端内存页表项中除了包含物理地址的值外,还需要 有添加远端内存阵列设备的ID号进行区分。
在本申请实施例中,服务器包含第一FPGA,远端内存阵列设备包含第二FPGA,第一FPGA与第二FPGA连接以实现服务器访问远端内存阵列设备。在本机不存在未分配的物理地址时,可以将远端内存阵列设备中的物理地址进行分配。由此可见,本申请实施例对单个服务器的物理地址空间进行扩展,解决了单个服务器的物理地址空间无法满足虚拟地址空间的需要的技术问题。
本申请实施例公开了一种内存空间扩展方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:
参见图5,根据一示例性实施例示出的又一种内存空间扩展方法的流程图,如图5所示,包括:
S201:接收访问指令;
S202:对访问指令进行解析,以确定访问指令的指令类型;
在本实施例中,第一FPGA中的处理器指令处理模块接收到处理器核发出的访问指令后,需要对其进行解析,以确定指令类型,再进一步处理,本实施例中指令类型可以包括数据搬移类和计算类。
S203:若访问指令为数据搬移类指令,则根据数据搬移方向进行数据搬移;
在具体实施中,如图6所示,若数据搬移方向为服务器向远端内存阵列设备,那么访问指令包含服务器中的源虚拟地址即第一虚拟地址,和远端内存阵列设备中的目的虚拟地址即第二虚拟地址,在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址,从服务器的第一物理地址中读取第一数据,并将第一数据发送至远端内存阵列设备,写入第二物理地址。若数据搬移方向为远端内存阵列设备向服务器,那么访问指令包含服务器中的目的虚拟地址即第一虚拟地址,和远端内存阵列设备中的源虚拟地址即第二虚拟地址,则在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址,向远端内存阵列设备发送内存读取指令,以从远端内存阵列设备中的第二物理地址读取第二数据,写入服务器的第一物理地址。
S204:若访问指令为计算类指令且包含计算数据时,则按照指令码对计算数据进行计算;
S205:若访问指令为计算类指令且包含读取计算数据的源虚拟地址时,从本机页表或远端页表中查询源虚拟地址对应的源物理地址,从源物理地址读取计算数据后,按照 指令码对计算数据进行计算。
在具有实施中,若访问指令为计算类指令,则如图7所示,需要对其进一步分类,若其类型为先读取再计算即访问指令包含读取计算数据的源虚拟地址,则查询本机页表或远端页表。若源虚拟地址对应的源物理地址在服务器中,则通过PCIE从本地内存读取计算数据,若源虚拟地址对应的源物理地址在远端内存阵列设备中,则通过第一RDMA模块向第二RDMA模块发送RDMA_READ指令,从远端内存阵列设备读取计算数据。读取到计算数据后,按照CPU指令码对计算数据进行计算。若计算类指令的类型为直接计算即访问指令包含计算数据,则直接按照CPU指令码对计算数据进行计算。
作为一种优选实施方式,按照指令码对计算数据进行计算之后,还包括:若计算结果需要保存、访问指令包含保存计算结果的目的虚拟地址,则从本机页表或远端页表中查询目的虚拟地址对应的目的物理地址,将计算结果写入目的物理地址。
在具体实施中,若计算结果需要保存,那么访问指令包含保存计算结果的目的虚拟地址,查询本机页表或远端页表。若目的虚拟地址对应的目的物理地址在服务器中,则通过PCIE将计算结果写入本地内存,若目的虚拟地址对应的目的物理地址在远端内存阵列设备中,则通过第一RDMA模块向第二RDMA模块发送RDMA_WRITE指令,将计算结果写入远端内存阵列设备。
下面就以数据搬移操作为例,对于应用程序部分,直接调用memcpy函数即可,对应用程序透明,这个函数到处理器层面真正执行时,执行的是数据搬移指令,比如“mov指令”。
对于操作系统的缺页处理部分,如果发现源地址或目的地址不在本机内存,就将处理器指令码写入第一FPGA的执行接收寄存器,由第一FPGA中的处理器指令处理模块接收。
处理器指令处理模块查找页表后,如果发现处理器指令中的目的地址在远端内存阵列,源地址在本机内存,会进行如下操作。
1.向FPGA中的RDMA网卡模块发出RDMA_WRITE指令。
2.等待RDMA网卡处理完成。
下面对本申请实施例提供的一种内存空间扩展装置进行介绍,下文描述的一种内存空间扩展装置与上文描述的一种内存空间扩展方法可以相互参照。
参见图8,根据一示例性实施例示出的一种内存空间扩展装置的结构图,如图8所示,包括:
查询模块801,用于接收包含虚拟地址的访问指令,查询本机页表和远端页表中是否存在虚拟地址对应的页表项;若均不存在,则启动判断模块802的工作流程;
判断模块802,用于判断服务器是否存在未分配的物理地址;若不存在,则启动第一创建模块803的工作流程;
第一创建模块803,用于基于远端内存阵列设备中的物理地址创建虚拟地址对应的远端内存页表项。
在本申请实施例中,服务器包含第一FPGA,远端内存阵列设备包含第二FPGA,第一FPGA与第二FPGA连接以实现服务器访问远端内存阵列设备。在本机不存在未分配的物理地址时,可以将远端内存阵列设备中的物理地址进行分配。由此可见,本申请实施例对单个服务器的物理地址空间进行扩展,解决了单个服务器的物理地址空间无法满足虚拟地址空间的需要的技术问题。
在上述实施例的基础上,作为一种优选实施方式,第一FPGA包括第一RDMA网卡模块,第二FPGA包括第二RDMA网卡模块,第一RDMA网卡模块与第二RDMA网卡模块之间通过网络连接。
在上述实施例的基础上,作为一种优选实施方式,还包括:
转换模块,用于若本机页表或远端页表存在虚拟地址对应的本机页表项或远端页表项,则基于本机页表项或远端页表项将虚拟地址转换为物理地址。
在上述实施例的基础上,作为一种优选实施方式,还包括:
第二创建模块,用于若服务器中存在未分配的物理地址,则基于服务器中未分配的物理地址创建虚拟地址对应的本机页表项。
在上述实施例的基础上,作为一种优选实施方式,还包括:
解析模块,用于对访问指令进行解析,以确定访问指令的指令类型;
数据搬移模块,用于若访问指令为数据搬移类指令,则根据数据搬移方向进行数据搬移;
第一计算模块,用于若访问指令为计算类指令且包含计算数据时,则按照指令码对计算数据进行计算;
第二计算模块,用于若访问指令为计算类指令且包含读取计算数据的源虚拟地址时,从本机页表或远端页表中查询源虚拟地址对应的源物理地址,从源物理地址读取计 算数据后,按照指令码对计算数据进行计算。
在上述实施例的基础上,作为一种优选实施方式,数据搬移模块包括:
第一查询单元,用于若数据搬移方向为服务器向远端内存阵列设备、访问指令包含第一虚拟地址和第二虚拟地址,则在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址;
发送单元,用于从服务器的第一物理地址中读取第一数据,并将第一数据发送至远端内存阵列设备,写入第二物理地址;
第二查询单元,用于若数据搬移方向为服务器向远端内存阵列设备、访问指令包含第一虚拟地址和第二虚拟地址,则在本机页表中查询第一虚拟地址对应的第一物理地址,在远端页表中查询第二虚拟地址对应的第二物理地址;
读取单元,用于向远端内存阵列设备发送内存读取指令,以从远端内存阵列设备中的第二物理地址读取第二数据,写入服务器的第一物理地址。
在上述实施例的基础上,作为一种优选实施方式,还包括:
保存模块,用于若计算结果需要保存、访问指令包含保存计算结果的目的虚拟地址,则从本机页表或远端页表中查询目的虚拟地址对应的目的物理地址,将计算结果写入目的物理地址。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
基于上述程序模块的硬件实现,且为了实现本申请实施例的方法,本申请实施例还提供了一种电子设备,图9为根据一示例性实施例示出的一种电子设备的结构图,如图9所示,电子设备包括:
通信接口1,能够与其它设备比如网络设备等进行信息交互;
处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机可读指令时,执行上述一个或多个技术方案提供的内存空间扩展方法。而计算机可读指令存储在存储器3上。
当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图9中将各种总线都标为总线系统4。
本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机可读指令。
可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器3旨在包括但不限于这些和任意其它适合类型的存储器。
上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。
处理器2执行计算机可读指令时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。
在示例性实施例中,本申请实施例还提供了一种非易失性计算机可读存储介质,该非易失性计算机可读存储介质中存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时可实现上述任意一个实施例的内存空间扩展方法的步骤。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,上述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上上述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (9)

  1. 一种内存空间扩展方法,其特征在于,应用于服务器,所述服务器包括第一FPGA,所述第一FPGA与远端内存阵列设备中的第二FPGA连接;
    所述方法包括:
    接收包含虚拟地址的访问指令;和
    在查询本机页表和远端页表中均不存在所述虚拟地址对应的页表项,且所述服务器不存在未分配的物理地址时,基于所述远端内存阵列设备中的物理地址创建所述虚拟地址对应的远端内存页表项。
  2. 根据权利要求1所述内存空间扩展方法,其特征在于,所述第一FPGA包括第一RDMA网卡模块,所述第二FPGA包括第二RDMA网卡模块,所述第一RDMA网卡模块与所述第二RDMA网卡模块之间通过网络连接。
  3. 根据权利要求1所述内存空间扩展方法,其特征在于,还包括:
    在所述本机页表或所述远端页表存在所述虚拟地址对应的本机页表项或远端页表项时,基于所述本机页表项或所述远端页表项将所述虚拟地址转换为物理地址。
  4. 根据权利要求1所述内存空间扩展方法,其特征在于,还包括:
    在所述服务器中存在未分配的物理地址时,基于所述服务器中未分配的物理地址创建所述虚拟地址对应的本机页表项。
  5. 根据权利要求1所述内存空间扩展方法,其特征在于,所述接收包含虚拟地址的访问指令之后,还包括:
    对所述访问指令进行解析,以确定所述访问指令的指令类型;
    在所述访问指令为数据搬移类指令时,根据数据搬移方向进行数据搬移;
    在所述访问指令为计算类指令且包含计算数据时,按照指令码对所述计算数据进行计算;和
    在所述访问指令为计算类指令且包含读取计算数据的源虚拟地址时,从所述本机页表或所述远端页表中查询所述源虚拟地址对应的源物理地址,从所述源物理地址读取计算数据后,按照指令码对所述计算数据进行计算。
  6. 根据权利要求5所述内存空间扩展方法,其特征在于,所述根据数据搬移方向进行数据搬移,包括:
    在所述数据搬移方向为所述服务器向所述远端内存阵列设备、所述访问指令包含第一虚拟地址和第二虚拟地址时,在所述本机页表中查询所述第一虚拟地址对应的第一物 理地址,在所述远端页表中查询所述第二虚拟地址对应的第二物理地址;
    从所述服务器的第一物理地址中读取第一数据,并将所述第一数据发送至所述远端内存阵列设备,写入所述第二物理地址;
    在所述数据搬移方向为所述远端内存阵列设备向所述服务器、所述访问指令包含第一虚拟地址和第二虚拟地址时,在所述本机页表中查询所述第一虚拟地址对应的第一物理地址,在所述远端页表中查询所述第二虚拟地址对应的第二物理地址;和
    向所述远端内存阵列设备发送内存读取指令,以从所述远端内存阵列设备中的第二物理地址读取第二数据,写入所述服务器的第一物理地址。
  7. 根据权利要求5所述内存空间扩展方法,其特征在于,所述按照指令码对所述计算数据进行计算之后,还包括:
    在计算结果需要保存、所述访问指令包含保存计算结果的目的虚拟地址时,从所述本机页表或所述远端页表中查询所述目的虚拟地址对应的目的物理地址,将所述计算结果写入所述目的物理地址。
  8. 一种内存空间扩展装置,其特征在于,应用于服务器,所述服务器包括第一FPGA,所述第一FPGA与远端内存阵列设备中的第二FPGA连接;
    所述装置包括:
    查询模块,用于接收包含虚拟地址的访问指令;
    所述判断模块,用于在查询本机页表和远端页表中均不存在所述虚拟地址对应的页表项,且所述服务器不存在未分配的物理地址时,启动第一创建模块的工作流程;和
    所述第一创建模块,用于基于所述远端内存阵列设备中的物理地址创建所述虚拟地址对应的远端内存页表项。
  9. 一种电子设备,其特征在于,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-7任意一项所述的方法的步骤。10、一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-7任意一项所述的方法的步骤。
PCT/CN2022/099646 2021-11-30 2022-06-19 一种内存空间扩展方法、装置及电子设备和存储介质 WO2023098032A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111438244.4 2021-11-30
CN202111438244.4A CN113868155B (zh) 2021-11-30 2021-11-30 一种内存空间扩展方法、装置及电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2023098032A1 true WO2023098032A1 (zh) 2023-06-08

Family

ID=78985358

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099646 WO2023098032A1 (zh) 2021-11-30 2022-06-19 一种内存空间扩展方法、装置及电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113868155B (zh)
WO (1) WO2023098032A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116563089A (zh) * 2023-07-11 2023-08-08 南京砺算科技有限公司 一种图形处理器的内存管理方法、装置、设备及存储介质
CN118426976A (zh) * 2024-07-04 2024-08-02 浪潮(北京)电子信息产业有限公司 内存扩展系统、访问方法及设备、介质和计算机程序产品

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868155B (zh) * 2021-11-30 2022-03-08 苏州浪潮智能科技有限公司 一种内存空间扩展方法、装置及电子设备和存储介质
CN114781323B (zh) * 2022-04-24 2023-08-18 苏州睿芯集成电路科技有限公司 Cpu芯片仿真加速中针对有mmu环境的内存状态恢复方法
CN115640241B (zh) * 2022-10-08 2023-06-09 中科驭数(北京)科技有限公司 基于地址池的内存转换表表项管理方法、查询方法及装置
CN115756962A (zh) * 2022-11-21 2023-03-07 浪潮(北京)电子信息产业有限公司 内存备份加速方法、装置、设备及计算机可读存储介质
CN117112194B (zh) * 2023-04-23 2024-07-09 荣耀终端有限公司 一种内存扩展方法及相关设备
CN116599892B (zh) * 2023-07-17 2023-10-03 浪潮电子信息产业股份有限公司 一种服务器系统、路由方法、装置及电子设备和存储介质
CN116644006B (zh) * 2023-07-27 2023-11-03 浪潮电子信息产业股份有限公司 一种内存页面管理方法、系统、装置、设备及计算机介质
CN117311817B (zh) * 2023-11-30 2024-03-08 上海芯联芯智能科技有限公司 一种协处理器控制方法、装置、设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1705269A (zh) * 2004-05-25 2005-12-07 中国科学院计算技术研究所 一种用于虚拟共享存储系统的远程取页方法及网络接口卡
US20120185668A1 (en) * 2011-01-17 2012-07-19 Samsung Electronics Co., Ltd. Memory management unit and apparatuses having same
CN105335308A (zh) * 2014-05-30 2016-02-17 华为技术有限公司 对存储设备的访问信息处理方法和装置、系统
CN106487896A (zh) * 2016-10-14 2017-03-08 北京百度网讯科技有限公司 用于处理远程直接内存访问请求的方法和装置
CN107203411A (zh) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 一种基于远程ssd的虚拟机内存扩展方法及系统
CN112948149A (zh) * 2021-03-29 2021-06-11 江苏为是科技有限公司 一种远端内存共享方法、装置、电子设备及存储介质
CN113868155A (zh) * 2021-11-30 2021-12-31 苏州浪潮智能科技有限公司 一种内存空间扩展方法、装置及电子设备和存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419652B (zh) * 2008-08-22 2010-07-21 航天信息股份有限公司 一种软硬件结合的保护程序的方法
CN103019953B (zh) * 2012-12-28 2015-06-03 华为技术有限公司 一种元数据的构建系统及其方法
CN107305506A (zh) * 2016-04-20 2017-10-31 阿里巴巴集团控股有限公司 动态分配内存的方法、装置及系统
TWI636366B (zh) * 2017-11-22 2018-09-21 緯穎科技服務股份有限公司 資料冗餘的處理方法及其相關電腦系統
CN109684257B (zh) * 2018-12-24 2022-08-12 广东浪潮大数据研究有限公司 一种远程内存扩展管理系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1705269A (zh) * 2004-05-25 2005-12-07 中国科学院计算技术研究所 一种用于虚拟共享存储系统的远程取页方法及网络接口卡
US20120185668A1 (en) * 2011-01-17 2012-07-19 Samsung Electronics Co., Ltd. Memory management unit and apparatuses having same
CN105335308A (zh) * 2014-05-30 2016-02-17 华为技术有限公司 对存储设备的访问信息处理方法和装置、系统
CN106487896A (zh) * 2016-10-14 2017-03-08 北京百度网讯科技有限公司 用于处理远程直接内存访问请求的方法和装置
CN107203411A (zh) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 一种基于远程ssd的虚拟机内存扩展方法及系统
CN112948149A (zh) * 2021-03-29 2021-06-11 江苏为是科技有限公司 一种远端内存共享方法、装置、电子设备及存储介质
CN113868155A (zh) * 2021-11-30 2021-12-31 苏州浪潮智能科技有限公司 一种内存空间扩展方法、装置及电子设备和存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116563089A (zh) * 2023-07-11 2023-08-08 南京砺算科技有限公司 一种图形处理器的内存管理方法、装置、设备及存储介质
CN116563089B (zh) * 2023-07-11 2023-10-13 南京砺算科技有限公司 一种图形处理器的内存管理方法、装置、设备及存储介质
CN118426976A (zh) * 2024-07-04 2024-08-02 浪潮(北京)电子信息产业有限公司 内存扩展系统、访问方法及设备、介质和计算机程序产品

Also Published As

Publication number Publication date
CN113868155B (zh) 2022-03-08
CN113868155A (zh) 2021-12-31

Similar Documents

Publication Publication Date Title
WO2023098032A1 (zh) 一种内存空间扩展方法、装置及电子设备和存储介质
US20200150872A1 (en) Method for Accessing Extended Memory, Device, and System
US10067684B2 (en) File access method and apparatus, and storage device
US7447870B2 (en) Device for identifying data characteristics for flash memory
TWI692690B (zh) 存取快閃記憶體模組的方法及相關的快閃記憶體控制器與電子裝置
RU2442211C2 (ru) Гибридное запоминающее устройство с единым интерфейсом
JP2019067417A (ja) 最終レベルキャッシュシステム及び対応する方法
WO2018176911A1 (zh) 一种虚拟磁盘文件格式转换方法和装置
WO2018027839A1 (zh) 一种页表缓存tlb中表项的访问方法,及处理芯片
WO2016082191A1 (zh) 访问文件的方法和装置
TW202042067A (zh) 用來存取至少一非揮發性記憶體元件的處理單元
EP3534265A1 (en) Memory access technique
US20240264768A1 (en) Request Processing Method, Apparatus, and System
CN114063934B (zh) 数据更新装置、方法及电子设备
US11467766B2 (en) Information processing method, apparatus, device, and system
JPH0831060B2 (ja) コンピュータ・システム
CN113297105B (zh) 一种转换地址的缓存处理方法及装置
CN110781107A (zh) 基于dram接口的低延迟融合io控制方法和装置
CN110765060B (zh) Mdio总线到并行总线转换方法及装置、设备、介质
WO2022116067A1 (zh) 闪存的数据处理方法和数据处理装置
CN110362509B (zh) 统一地址转换方法与统一地址空间
CN116745754A (zh) 一种访问远端资源的系统及方法
US12008261B2 (en) Method and device for accessing memory
WO2023241655A1 (zh) 数据处理方法、装置、电子设备以及计算机可读存储介质
TWI814655B (zh) 記憶裝置、快閃記憶體控制器及其控制方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22899852

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE