WO2017181853A1 - Method, device, and system for dynamically allocating memory - Google Patents

Method, device, and system for dynamically allocating memory Download PDF

Info

Publication number
WO2017181853A1
WO2017181853A1 PCT/CN2017/079715 CN2017079715W WO2017181853A1 WO 2017181853 A1 WO2017181853 A1 WO 2017181853A1 CN 2017079715 W CN2017079715 W CN 2017079715W WO 2017181853 A1 WO2017181853 A1 WO 2017181853A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
server
pcie
space
dram
Prior art date
Application number
PCT/CN2017/079715
Other languages
French (fr)
Chinese (zh)
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 WO2017181853A1 publication Critical patent/WO2017181853A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for dynamically allocating memory.
  • DIMMs Dual-Inline-Memory-Modules
  • DIP Dual Inline Package
  • the early memory particles were soldered directly to the motherboard so that if a piece of memory fails, the entire motherboard is scrapped. Later, a memory grain slot appeared on the motherboard, so that the memory particles could be replaced.
  • the more commonly used memory particles are DRAM (Dynamic Random Access Memory) chips.
  • a DIMM includes one or more DRAM chips on a small integrated circuit board that can be directly connected to a computer motherboard using pins on the board.
  • DIMMs are often used in server systems. Due to the large capacity limitations of DIMMs, from 8G, 16G, 32G, 64G to 128G, the single capacity is small, and the lack of flexibility relative to rapid business changes. The current practice is to insert 16 DIMMs in a single server (single machine), or extend the DIMM through the RAZER card to achieve the purpose of expanding the memory capacity.
  • the DIMM is limited by the DIMM CHANNEL of the CPU, there is a limitation in capacity, which results in a server of different specifications due to the capacity requirement, which brings management inconvenience and overhead.
  • One of the technical problems solved by the present invention is to provide a method, device and system for dynamically allocating memory.
  • a method for dynamically allocating memory includes: receiving a memory allocation request of at least one server; and based on the memory allocation request, based on being driven by a plurality of bus interface standard devices A memory pool composed of memory particles, determining whether the memory pool has a memory sum of one or more free memory particles satisfying the requested memory size; if so, allocating the requested memory to the server.
  • the memory particles comprise DRAM particles
  • the method further comprises: DRAM of DRAM particles
  • the interface is converted to a PCIE interface.
  • converting the DRAM interface of the DRAM particle into a PCIE interface comprises: expanding a capacity of the DRAM interface through a memory buffer; connecting the input of the memory controller to the DRAM particle, and performing a double rate DDR memory process on the memory controller to The conversion logic of the PCIE process makes the output of the memory controller a PCIE interface.
  • driving the DRAM particles by the PCIE device comprises: enabling the SRIOV function of the PCIE device; installing the physical function PF driver and the virtual function VF driver; implementing mapping of the PCIE address, the server address and the memory address, and writing the address mapping into the PF drive and VF drive.
  • the method further includes: deploying the memory pool: controlling, by a management unit, a memory space of the shared memory pool of the plurality of servers; running the PF driver in the management unit, thereby driving the user space and the virtual function driving space
  • the IDs correspond to and match; the virtual function driver is run on each server, so that the server finds its own corresponding address space and operates.
  • the method further comprises: determining whether the server uses the allocated memory space, and if so, releasing the memory space.
  • the method further includes: waiting, and determining whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, the released memory space is allocated. Give the server.
  • an apparatus for dynamically allocating memory includes: a request receiving unit, configured to receive a memory allocation request to a server; and a determining unit, configured to perform, according to the memory allocation request, based on a memory pool composed of a plurality of memory elements driven by a standard device of the bus interface, determining whether the memory pool has a memory sum of one or more free memory particles satisfying the requested memory size; and an allocation unit for using the requested Memory is allocated to the server.
  • the memory particles comprise DRAM particles; the device further comprises: an interface conversion unit for expanding the capacity of the DRAM interface through the memory buffer; and connecting the input of the memory controller to the DRAM particles, and performing DDR on the memory controller
  • the conversion logic of the memory process to the PCIE process causes the output of the memory controller to be a PCIE interface, so that the output of the memory controller is a PCIE interface.
  • the apparatus further includes: a driving unit configured to enable the SRIOV function of the PCIE device; installing the PF driver and the VF driver; and implementing mapping of the PCIE address, the server address, and the memory address, and writing the address mapping to the PF drive and VF drive.
  • a driving unit configured to enable the SRIOV function of the PCIE device
  • installing the PF driver and the VF driver and implementing mapping of the PCIE address, the server address, and the memory address, and writing the address mapping to the PF drive and VF drive.
  • the device further includes: a memory pool deployment unit, configured to set a management unit to control a memory space of the plurality of server shared memory pools; and run the PF driver in the management unit to thereby user space and VF space
  • the IDs correspond to and match; and the VF driver is run on each server, so that the server finds its own corresponding address space and operates.
  • the determining unit is further configured to: determine whether the server uses the allocated memory space; and the device further includes: a releasing unit, configured to release the used memory space.
  • the determining unit is further configured to: if it is determined that the requested memory space is not available, wait, and determine whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, indicate the The allocation unit allocates the freed memory space to the server.
  • a system for dynamically allocating memory comprising: a memory pool composed of a plurality of DRAM particles driven by a PCIE device; one or more servers; and, An apparatus for dynamically allocating memory.
  • a memory that includes a plurality of memory particles, wherein the memory particles are driven by a bus interface standard device.
  • the present invention separates the server and the memory through the PCIE through a memory pool composed of a plurality of DRAM particles driven by the PCIE device, and can realize dynamic allocation and on-demand allocation of memory by different servers through PCIE exchange.
  • the capacity expansion is performed by the memory buffer during the process of converting the interface of the DRAM particles into the PCIE interface.
  • memory granules are expanded by memory buffering, and through dynamic allocation and on-demand allocation of memory pools, there is no need to increase the entire memory stick compared to standard memory, so the cost has a lower advantage.
  • PCIE devices can be hot swapped compared to existing standard memory, and maintainability is enhanced.
  • FIG. 1 is a flow chart of a method of dynamically allocating memory according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of converting a set of DRAM interfaces into PCIE interfaces in a method for dynamically allocating memory according to an embodiment of the invention
  • FIG. 3 is a schematic diagram of a single-particle DRAM interface converted into a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a DRAM pool deployment based on a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an apparatus for dynamically allocating memory according to an embodiment of the present invention.
  • the computer device includes a user device and a network device.
  • the user equipment includes, but is not limited to, a computer, a smart phone, a PDA, etc.
  • the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud computing based computer Or a cloud composed of a network server, wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computers.
  • the computer device can be operated separately to implement the present invention, and can also access the network and implement the present invention by interacting with other computer devices in the network.
  • the network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
  • the user equipment, the network equipment, the network, and the like are merely examples, and other existing or future possible computer equipment or networks, such as those applicable to the present invention, are also included in the scope of the present invention. It is included here by reference.
  • Memory granules Also known as memory chips or memory chips, often referred to as memory cells.
  • DRAM granules DRAM chips are used as memory granules.
  • a PCIE (Peripheral Component Interface Express) device refers to a device that supports the PCIE protocol.
  • the SRIOV feature allows efficient sharing of PCIE devices between devices/virtual machines.
  • VF (Virtual Function) driver is mainly used to discover PCIE devices.
  • the PF (Physical Function) driver is mainly used to manage the correspondence between the address of each user space in the memory and the ID of the VF.
  • FIG. 1 is a flow chart of a method of dynamically allocating memory in accordance with an embodiment of the present invention.
  • the method of this embodiment mainly includes the following steps:
  • S120 Determine, according to a memory allocation request, whether the memory pool has one or more free memory particles to satisfy the requested memory space, based on a memory pool composed of a plurality of memory particles driven by the PCIE device.
  • step S130 is performed; if there is no requested memory space, step S140 is performed.
  • S150 Determine whether there is a newly released memory space, and determine whether the released memory space satisfies the requested memory requirement.
  • the above memory pool is composed of a plurality of memory particles driven by PCIE devices, wherein the memory particles may be DRAM particles. This means that interface conversion and protocol conversion are required for DRAM particles, and the interface-converted DRAM particles need to be driven by PCIE devices, and the DRAM pool based on the PCIE interface needs to be deployed.
  • FIG. 2 is a schematic diagram of converting a set of DRAM interfaces into PCIE interfaces in a method for dynamically allocating memory according to an embodiment of the invention.
  • interface conversion and protocol conversion functions can be implemented by means of the FPGA.
  • the process of transferring a DRAM interface to a PCIE interface includes:
  • Step 1 The DRAM interface is capacity-expanded by MEMORY BUFFER.
  • the memory mentioned in the present invention refers to server memory.
  • server memory is also memory, and it has no obvious substantive difference between the appearance and the structure of the ordinary PC. It mainly introduces some new technologies into the memory.
  • server memory can be divided into Buffer memory with cache and Unbuffer memory without cache.
  • Buffer is a cache, which can also be understood as a cache.
  • the capacity is mostly 64K.
  • ECC Error Checking and Correcting
  • Register is the register or directory register.
  • the role of memory can be understood as the book directory. Through Register, when the memory is connected to the read and write instructions, this directory will be retrieved first, then read and write operations, which will greatly improve the server memory work. effectiveness.
  • Memory with Register (register or directory register) must have a Buffer, and the Register memory that can be seen at present also has ECC function.
  • LRDIMMs Load-Reduced DIMMs
  • the Registered DIMM used by the server boosts the memory support capacity by buffering the signal on the memory stick and relocating the memory granules.
  • the LRDIMM memory changes the Register chip on the current RDIMM memory to an iMB (isolation Memory Buffer).
  • the memory isolation buffer chip reduces the load on the memory bus and further increases the memory support capacity accordingly.
  • the DIMMs of the present invention are not limited in type, i.e., the DIMMs of the present invention cover current or future types of DIMMs. Also, the memory capacity is increased by the DIMM's Memory Buffer function.
  • step (1) by connecting the high-speed IO pin of the FPGA to the DIMM interface and then defining these pins, the internal logic implementation simulates a MEMORY controller internally by the signals of these high-speed pins.
  • DRAM has the advantages of low power consumption, high integration (large single-chip capacity), and low price, but the control of DRAM is relatively complicated and requires timing refresh, so it is necessary to design a DRAM controller.
  • the FPGA Field Programmable Gate Array
  • MEMORY controller DRAM controller
  • the FPGA is a CMOS process, its power consumption is very small, and at the same time, the FPGA can be rewritten to facilitate performance expansion. If necessary, simply change the internal logic of the FPGA to suit different design requirements or environmental requirements.
  • other programmable logic devices can be implemented, such as a CPLD (Complex Programmable Logic Device), a PLD (Programmable Logic Device), and the like.
  • Step 2 The input of the MEMORY controller is connected to the DRAM pellet, so the input of the MEMORY controller is a DDR unit supporting a DDR (double data rate) process.
  • Step 3 The exit of the MEMORY controller is a high-speed SERDES (SERializer/DESerializer) that supports NVME (Non-Volatile Memory Express) and PCIE (Peripheral Component Interface Express).
  • the deserializer matches the PCIE interface of the PCIE device.
  • DDR memory is taken as an example for description, which has the advantage of a fast transmission rate.
  • NVMe is a logical device interface standard like AHCI. It is a specification for SSDs using PCI-E channels. NVMe is designed to take full advantage of the low latency and parallelism of PCI-E SSD, as well as contemporary processing. Parallelism of devices, platforms and applications. The parallelism of SSD can be fully utilized by the hardware and software of the host. Compared with the current AHCI standard, the NVMe standard can bring various performance improvements.
  • PCIE is a high-speed serial point-to-point dual-channel high-bandwidth transmission.
  • the connected devices allocate exclusive channel bandwidth and do not share bus bandwidth. They mainly support active power management, error reporting, end-to-end reliability transmission, hot swap, and quality of service ( QOS) and other functions.
  • QOS quality of service
  • the main advantage of PCIE is the high data transfer rate. For example, the current highest 16X 2.0 version can reach 10GB/s, and there is considerable potential for development.
  • the DDR, PCIE and NVME processes/protocols need to implement a complete set of logic for the logical translation of the hardware language. In this example, it is implemented inside the FPGA.
  • the FPGA In order to convert the DRAM interface to PCIE interface conversion, the FPGA needs to identify DDR, PCIE and NVME and perform logic conversion.
  • the FPGA internally includes a DDR unit, an NVMe unit, and a PCIE unit, wherein the DDR unit serves as an input, supports DDR Process, and is connected to a unified interface of a group of DRAM particles; the NVMe unit supports the NVM protocol, and connects the DDR unit and the PCIE unit.
  • the PCIE unit supports the PCIE protocol, which acts as an FPGA output and provides a PCIE interface to the PCIe device.
  • a set of DRAM interfaces can be converted into a PCIE interface, for example, converted to a PCIE X8 interface.
  • FIG. 3 a schematic diagram of a single-particle DRAM interface converted into a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention.
  • the difference between the mode of Figure 3 and the mode of Figure 2 is that instead of changing the interface of a group of DRAM particles, the interface of a single DRAM particle is changed, both of which can achieve the same purpose.
  • the process of transferring a DRAM interface to a PCIE interface includes:
  • Step 1 The DRAM interface is capacity-expanded by MEMORY BUFFER.
  • Step 2 The input of the MEMORY controller is connected to the DRAM pellet, so the input of the MEMORY controller is a DDR unit supporting the DDR (double data rate) protocol.
  • Step 3 The exit of the MEMORY controller is a PCIE unit supporting PCIE (Peripheral Component Interface Express) to match the PCIE interface of the PCIE device.
  • PCIE Peripheral Component Interface Express
  • the above interface conversion can be implemented by means of a wafer.
  • the conversion of the DRAM interface to the PCIE interface is completed in the DRAM chip package, that is, the interface of the DRAM secondary package is a PCIE interface chip.
  • the DRAM particles based on the PCIE interface have been obtained, and then the DRAM based on the PCIE interface needs to be driven, thereby sharing the memory capacity or the single server for multiple servers. Prepare for sharing the memory capacity of multiple virtual machines.
  • SRIOV technology is a hardware-based virtualization solution that improves performance and scalability.
  • the SRIOV standard allows for efficient sharing of PCIE devices between virtual machines, and it is implemented in hardware to achieve I/O performance comparable to native performance.
  • the SRIOV specification defines a new standard by which new devices are created that allow virtual machines to be directly connected to I/O devices.
  • a single I/O resource can be shared by many virtual machines. Shared devices will provide dedicated resources and also use shared common resources. This way, each virtual machine has access to a unique resource. Therefore, a PCIE device with SRIOV enabled and with appropriate hardware and OS support can be displayed as multiple separate physical devices, each with its own PCIE configuration space.
  • the two main functions in SRIOV are: (1) Physical Function (PF): PCI function to support SRIOV function, as defined in the SRIOV specification.
  • the PF contains the SRIOV functional structure for managing SRIOV functions.
  • PF is a full-featured PCIE feature that can be discovered, managed, and processed just like any other PCIE device.
  • PF has fully configured resources that can be used to configure or control PCIE devices.
  • Virtual Function (VF) A function associated with a physical function.
  • VF is a lightweight PCIE feature that shares one or more physical resources with physical functions and other VFs associated with the same physical function. VF only allows configuration resources for its own behavior.
  • driving the DRAM based on the PCIE interface mainly includes the following processes:
  • This feature enable indicates that this PCIE device supports the SRIOV function and can be discovered at the OS level.
  • This driver is mainly used to manage the correspondence between the address of each user space in the memory and the ID of the VF. That is, the PF can see the address corresponding to the ID of all the space of the PCIE device. Manage.
  • a driver installed in a virtual machine mainly used to discover PCIE devices.
  • a memory pool composed of a plurality of DRAM particles based on the PCIE interface is obtained, and the memory pool needs to be properly deployed and managed to efficiently allocate memory.
  • the deployment of the DRAM pool based on the PCIE interface mainly includes the following processes:
  • the PF driver is running in the management unit, which is to match the user space with the space ID of the VF and perform flexible online matching.
  • the VF runs on each server, and the server finds the address space that it sees and can operate the space.
  • FIG. 4 is a schematic diagram of a DRAM pool deployment based on a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention.
  • FIG. 4 a plurality of servers, a memory pool composed of a plurality of DRAM particles driven by PCI devices, a management unit, and a PCIE switch are shown.
  • the server includes a PCIE module.
  • the VF driver is run on the server, so that the server discovers its own address space and operates on the address space.
  • the management unit is responsible for managing the memory allocation of the server to the memory pool, including three aspects: managing the memory that is already in use; releasing the used memory; and not using the memory allocation. Specifically, the management unit allocates the memory capacity required for the request to the server according to the memory allocation request of the server, and after the usage is completed, releases and re-allocates to the server with the required request.
  • the PCIE switch provides multiple ports to connect multiple memory granules, so you can allocate memory space for multiple memory granules to a specific server at once.
  • each server accesses a fixed amount of memory through a slot, not only expands the memory capacity through the memory buffer, but also realizes memory allocation as needed.
  • a server has 16 slots. If the capacity of each memory module is 16G, even if it is fully populated, it only has 256G capacity. If it is required to have 300G memory, only one server is added according to the existing method, although this can be satisfied. Memory requirements, however new server additions Other resources are wasted.
  • the memory capacity is expanded by the memory buffer, and a certain number of DRAM particles driven by the PCIE device can be set according to requirements.
  • the server makes a memory allocation request, the memory can be dynamically selected according to the requested memory size. The memory granules requesting the amount of memory size, the content of the part of the memory granules is allocated to the server, and after the server is used, the memory space is dynamically released for use by other servers in need.
  • the present invention converts the DRAM interface to the PCIE interface by converting the interface of the DRAM particles into a PCIE interface through a programmable logic chip (FPGA) or a chip, and then designating the allocated PCIE device through the driver of the PCIE device.
  • FPGA programmable logic chip
  • the PCIE address of this part is mapped to the memory address, thereby realizing the purpose of driving the allocated portion of the memory; through the deployment and management of the memory pool, the server can be allocated a certain number of requests. Memory space, and dynamic management of memory allocation and release.
  • the solution of the invention has at least the following advantages:
  • PCIE expansion can be achieved through the conversion of the PCIE interface.
  • the PCIE is connected to the PCIE SLOT of the standard server, so that the server and the memory are separated by PCIE.
  • the capacity can be expanded many times compared to the standard memory.
  • the cost is lower than that of the standard memory.
  • PCIE devices can be hot swapped compared to existing standard memory, and maintainability is enhanced.
  • An embodiment of the present invention provides an apparatus for dynamically allocating memory corresponding to the foregoing method.
  • the device includes:
  • the request receiving unit 501 is configured to receive a memory allocation request of the server
  • the determining unit 502 is configured to determine, according to the memory allocation request, based on a memory pool composed of a plurality of memory particles driven by the PCIE device, whether the memory pool has one or more free memory particles and the memory sum meets the request The size of the memory;
  • the allocating unit 503 is configured to allocate the requested memory to the server.
  • the device further comprises:
  • the interface conversion unit 504 is configured to expand the capacity of the DRAM interface through the memory buffer; and connect the input of the memory controller to the DRAM particles, and perform the conversion logic of the DDR memory process to the PCIE process in the memory controller to make the output of the memory controller For the PCIE interface, the output of the memory controller is the PCIE interface.
  • the device further comprises:
  • the driving unit 505 is configured to enable the SRIOV function of the PCIE device; install the PF driver and the VF driver; and implement mapping of the PCIE address, the server address and the memory address, and write the address mapping to the PF driver and the VF driver.
  • the device further comprises:
  • the memory pool deployment unit 506 is configured to set a management unit to control a memory space of the shared memory pool of the plurality of servers; and run the PF driver in the management unit to match and match the user space with the VF space ID; and The VF driver is run on each server, so that the server finds its own address space and operates.
  • the determining unit 502 is further configured to: determine whether the server uses the allocated memory space;
  • the device further includes a release unit 507 for releasing the used memory space.
  • the determining unit 502 is further configured to: if it is determined that the requested memory space is not available, wait, and determine whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, the indicating allocation unit 503 is released.
  • the memory space is allocated to the server.
  • the present invention also provides a system for dynamically allocating memory, the system comprising: a memory pool composed of a plurality of memory particles driven by PCIE devices; one or more servers; and, as shown in FIG. 5 described above A device that dynamically allocates memory.
  • the present invention also provides a memory including a plurality of memory particles, wherein the memory particles are driven by a PCIE device.
  • the present invention can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
  • the software program of the present invention may be executed by a processor to implement the steps or functions described above.
  • the inventive software program (including related data structures) can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
  • some of the steps or functions of the present invention may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
  • a portion of the invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or solution in accordance with the present invention.
  • the program instructions for invoking the method of the present invention may be stored in a fixed or removable recording medium and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run.
  • an embodiment in accordance with the present invention includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
  • the apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present invention.

Abstract

A method, device, and system for dynamically allocating memory. The method comprises: receiving a memory allocation request from a server (S110); determining, according to the memory allocation request, and on the basis of a memory pool comprising a plurality of memory chips driven by a PCIE apparatus, whether a total available memory size of one or more memory chips satisfies a requested memory size (S120); and if so, allocating to the server the requested memory size (S130). The method, device, and system can realize dynamic memory allocation for a server.

Description

动态分配内存的方法、装置及系统Method, device and system for dynamically allocating memory
本申请要求2016年04月20日递交的申请号为201610249100.7、发明名称为“动态分配内存的方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application Serial No. No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种动态分配内存的方法、装置及系统。The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for dynamically allocating memory.
背景技术Background technique
在计算机系统中,存储器可谓是决定整机性能的关键因素之一。在服务器系统中,常使用DIMM(Dual-Inline-Memory-Modules,双列直插式存储模块)作为内存。在DIMM内存中的颗粒采用了DIP(Dual Inline Package:双列直插封装)封装。早期的内存颗粒是直接焊接在主板上面的,这样如果一片内存出现故障,那么整个主板都要报废了。后来在主板上出现了内存颗粒插槽,这样就可以更换内存颗粒了。较常用的内存颗粒是DRAM(Dynamic Random Access Memory,动态随机存取存储器)芯片。DIMM包括有一个或多个DRAM芯片在一个小的集成电路板上,利用这块电路板上的一些引脚可以直接和计算机主板相连接。In computer systems, memory is one of the key factors determining the performance of the whole machine. In a server system, DIMMs (Dual-Inline-Memory-Modules) are often used as the memory. The granules in the DIMM memory are packaged in a DIP (Dual Inline Package) package. The early memory particles were soldered directly to the motherboard so that if a piece of memory fails, the entire motherboard is scrapped. Later, a memory grain slot appeared on the motherboard, so that the memory particles could be replaced. The more commonly used memory particles are DRAM (Dynamic Random Access Memory) chips. A DIMM includes one or more DRAM chips on a small integrated circuit board that can be directly connected to a computer motherboard using pins on the board.
DIMM常应用在服务器系统中。由于DIMM容量限制较大,从8G、16G、32G、64G到128G,单个容量较小,相对业务快速的变化缺少灵活性。目前的做法是,单台服务器(单机)各插16根DIMM,或者是通过RAZER卡扩展DIMM,以达到扩展内存容量的目的。然而,由于DIMM受限于CPU的DIMM CHANNEL,因此会带来容量的限制,从而因容量需求形成了不同的规格的服务器,带来了管理上的不便与开销。DIMMs are often used in server systems. Due to the large capacity limitations of DIMMs, from 8G, 16G, 32G, 64G to 128G, the single capacity is small, and the lack of flexibility relative to rapid business changes. The current practice is to insert 16 DIMMs in a single server (single machine), or extend the DIMM through the RAZER card to achieve the purpose of expanding the memory capacity. However, since the DIMM is limited by the DIMM CHANNEL of the CPU, there is a limitation in capacity, which results in a server of different specifications due to the capacity requirement, which brings management inconvenience and overhead.
发明内容Summary of the invention
本发明解决的技术问题之一是提供一种动态分配内存的方法、装置及系统。One of the technical problems solved by the present invention is to provide a method, device and system for dynamically allocating memory.
根据本发明一方面的一个实施例,提供了一种动态分配内存的方法,包括:接收至少一台服务器的内存分配请求;根据所述内存分配请求,基于由多个经总线接口标准设备驱动的内存颗粒组成的内存池,判断所述内存池是否具有一个或多个空闲的内存颗粒的内存总和满足所请求的内存大小;若是,将所请求的内存分配给所述服务器。According to an embodiment of an aspect of the present invention, a method for dynamically allocating memory includes: receiving a memory allocation request of at least one server; and based on the memory allocation request, based on being driven by a plurality of bus interface standard devices A memory pool composed of memory particles, determining whether the memory pool has a memory sum of one or more free memory particles satisfying the requested memory size; if so, allocating the requested memory to the server.
优选的,所述内存颗粒包括DRAM颗粒,该方法还包括:将DRAM颗粒的DRAM 接口转换成PCIE接口。Preferably, the memory particles comprise DRAM particles, and the method further comprises: DRAM of DRAM particles The interface is converted to a PCIE interface.
优选的,所述将DRAM颗粒的DRAM接口转换成PCIE接口,包括:将DRAM接口通过内存缓冲进行容量扩展;将内存控制器的输入连接DRAM颗粒,在内存控制器进行双倍速率DDR内存进程到PCIE进程的转换逻辑,使内存控制器的输出为PCIE接口。Preferably, converting the DRAM interface of the DRAM particle into a PCIE interface comprises: expanding a capacity of the DRAM interface through a memory buffer; connecting the input of the memory controller to the DRAM particle, and performing a double rate DDR memory process on the memory controller to The conversion logic of the PCIE process makes the output of the memory controller a PCIE interface.
优选的,通过PCIE设备驱动DRAM颗粒包括:使能PCIE设备的SRIOV功能;安装物理功能PF驱动和虚拟功能VF驱动;实现PCIE地址、服务器地址与内存地址的映射,并将地址映射写入所述PF驱动和VF驱动。Preferably, driving the DRAM particles by the PCIE device comprises: enabling the SRIOV function of the PCIE device; installing the physical function PF driver and the virtual function VF driver; implementing mapping of the PCIE address, the server address and the memory address, and writing the address mapping into the PF drive and VF drive.
优选的,该方法还包括:对内存池进行部署:由一管理单元控制多台服务器共享内存池的内存空间;在所述管理单元中运行所述PF驱动,从而将用户空间与虚拟功能驱动空间ID对应并进行匹配;在各服务器上运行所述虚拟功能驱动,从而使服务器发现自身对应的地址空间并进行操作。Preferably, the method further includes: deploying the memory pool: controlling, by a management unit, a memory space of the shared memory pool of the plurality of servers; running the PF driver in the management unit, thereby driving the user space and the virtual function driving space The IDs correspond to and match; the virtual function driver is run on each server, so that the server finds its own corresponding address space and operates.
优选的,该方法还包括:判断服务器是否使用完成所分配的内存空间,若是,释放所述内存空间。Preferably, the method further comprises: determining whether the server uses the allocated memory space, and if so, releasing the memory space.
优选的,若判断不具有所请求的内存空间,所述方法还包括:等待,并判断是否有新释放的内存空间;若释放的内存空间满足所请求的内存要求,则将释放的内存空间分配给所述服务器。Preferably, if it is determined that the requested memory space is not available, the method further includes: waiting, and determining whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, the released memory space is allocated. Give the server.
根据本发明一方面的一个实施例,提供了一种动态分配内存的装置,包括:请求接收单元,用于接收至服务器的内存分配请求;判断单元,用于根据所述内存分配请求,基于由多个经总线接口标准设备驱动的内存颗粒组成的内存池,判断所述内存池是否具有一个或多个空闲的内存颗粒的内存总和满足所请求的内存大小;分配单元,用于将所请求的内存分配给所述服务器。According to an embodiment of the present invention, an apparatus for dynamically allocating memory includes: a request receiving unit, configured to receive a memory allocation request to a server; and a determining unit, configured to perform, according to the memory allocation request, based on a memory pool composed of a plurality of memory elements driven by a standard device of the bus interface, determining whether the memory pool has a memory sum of one or more free memory particles satisfying the requested memory size; and an allocation unit for using the requested Memory is allocated to the server.
优选的,所述内存颗粒包括DRAM颗粒;该装置还包括:接口转换单元,用于将DRAM接口通过内存缓冲进行容量扩展;以及,将内存控制器的输入连接DRAM颗粒,在内存控制器进行DDR内存进程到PCIE进程的转换逻辑,使内存控制器的输出为PCIE接口,使内存控制器的输出为PCIE接口。Preferably, the memory particles comprise DRAM particles; the device further comprises: an interface conversion unit for expanding the capacity of the DRAM interface through the memory buffer; and connecting the input of the memory controller to the DRAM particles, and performing DDR on the memory controller The conversion logic of the memory process to the PCIE process causes the output of the memory controller to be a PCIE interface, so that the output of the memory controller is a PCIE interface.
优选的,该装置还包括:驱动单元,用于使能PCIE设备的SRIOV功能;安装PF驱动和VF驱动;以及,实现PCIE地址、服务器地址与内存地址的映射,并将地址映射写入所述PF驱动和VF驱动。Preferably, the apparatus further includes: a driving unit configured to enable the SRIOV function of the PCIE device; installing the PF driver and the VF driver; and implementing mapping of the PCIE address, the server address, and the memory address, and writing the address mapping to the PF drive and VF drive.
优选的,该装置还包括:内存池部署单元,用于设置一管理单元控制多台服务器共享内存池的内存空间;在所述管理单元中运行所述PF驱动,从而将用户空间与VF空间 ID对应并进行匹配;以及,在各服务器上运行所述VF驱动,从而使服务器发现自身对应的地址空间并进行操作。Preferably, the device further includes: a memory pool deployment unit, configured to set a management unit to control a memory space of the plurality of server shared memory pools; and run the PF driver in the management unit to thereby user space and VF space The IDs correspond to and match; and the VF driver is run on each server, so that the server finds its own corresponding address space and operates.
优选的,所述判断单元还用于,判断服务器是否使用完成所分配的内存空间;所述装置还包括:释放单元,用于释放使用完成的内存空间。Preferably, the determining unit is further configured to: determine whether the server uses the allocated memory space; and the device further includes: a releasing unit, configured to release the used memory space.
优选的,所述判断单元还用于,若判断不具有所请求的内存空间,则等待,并判断是否有新释放的内存空间;若释放的内存空间满足所请求的内存要求,则指示所述分配单元将释放的内存空间分配给所述服务器。Preferably, the determining unit is further configured to: if it is determined that the requested memory space is not available, wait, and determine whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, indicate the The allocation unit allocates the freed memory space to the server.
根据本发明一方面的一个实施例,提供了一种动态分配内存的系统,该系统包括:由多个经PCIE设备驱动的DRAM颗粒组成的内存池;一个或多个服务器;以及,上述的任一项的所述动态分配内存的装置。According to an embodiment of an aspect of the present invention, a system for dynamically allocating memory is provided, the system comprising: a memory pool composed of a plurality of DRAM particles driven by a PCIE device; one or more servers; and, An apparatus for dynamically allocating memory.
根据本发明另一方面的一个实施例,提供一种内存,该内存包括多个内存颗粒,其中,所述内存颗粒经总线接口标准设备驱动。In accordance with an embodiment of another aspect of the present invention, a memory is provided that includes a plurality of memory particles, wherein the memory particles are driven by a bus interface standard device.
可见,本发明通过由多个经PCIE设备驱动的DRAM颗粒组成的内存池,将服务器与内存通过PCIE来分离,可以通过PCIE交换实现不同服务器对内存的动态分配和按需分配。优选的,在将DRAM颗粒的接口转换成PCIE接口过程中,通过内存缓冲进行容量扩展。另外,由于通过内存缓冲扩展了内存颗粒,且通过对内存池的动态分配和按需分配,因此与标准内存相比,不需要增加整个内存条,因此成本有较低的优势。而且,相比于现有标准的内存必须停机维护,PCIE设备可以进行热插拔,因此可维护性增强。It can be seen that the present invention separates the server and the memory through the PCIE through a memory pool composed of a plurality of DRAM particles driven by the PCIE device, and can realize dynamic allocation and on-demand allocation of memory by different servers through PCIE exchange. Preferably, the capacity expansion is performed by the memory buffer during the process of converting the interface of the DRAM particles into the PCIE interface. In addition, because memory granules are expanded by memory buffering, and through dynamic allocation and on-demand allocation of memory pools, there is no need to increase the entire memory stick compared to standard memory, so the cost has a lower advantage. Moreover, PCIE devices can be hot swapped compared to existing standard memory, and maintainability is enhanced.
本领域普通技术人员将了解,虽然下面的详细说明将参考图示实施例、附图进行,但本发明并不仅限于这些实施例。而是,本发明的范围是广泛的,且意在仅通过后附的权利要求限定本发明的范围。Those skilled in the art will appreciate that although the following detailed description is made with reference to the illustrated embodiments and drawings, the invention is not limited to these embodiments. Rather, the scope of the invention is intended to be limited the scope of the invention
附图说明DRAWINGS
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other features, objects, and advantages of the present invention will become more apparent from the Detailed Description of Description
图1是根据本发明实施例的动态分配内存的方法的流程图;1 is a flow chart of a method of dynamically allocating memory according to an embodiment of the present invention;
图2是根据本发明实施例的动态分配内存的方法中一组DRAM接口转换成PCIE接口的示意图;2 is a schematic diagram of converting a set of DRAM interfaces into PCIE interfaces in a method for dynamically allocating memory according to an embodiment of the invention;
图3是根据本发明实施例的动态分配内存的方法中单颗粒DRAM接口转换成PCIE接口的示意图; 3 is a schematic diagram of a single-particle DRAM interface converted into a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention;
图4是根据本发明实施例的动态分配内存的方法中基于PCIE接口的DRAM池部署示意图;4 is a schematic diagram of a DRAM pool deployment based on a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention;
图5是根据本发明实施例的动态分配内存的装置的结构示意图。FIG. 5 is a schematic structural diagram of an apparatus for dynamically allocating memory according to an embodiment of the present invention.
本领域普通技术人员将了解,虽然下面的详细说明将参考图示实施例、附图进行,但本发明并不仅限于这些实施例。而是,本发明的范围是广泛的,且意在仅通过后附的权利要求限定本发明的范围。Those skilled in the art will appreciate that although the following detailed description is made with reference to the illustrated embodiments and drawings, the invention is not limited to these embodiments. Rather, the scope of the invention is intended to be limited the scope of the invention
具体实施方式detailed description
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as a process or method depicted as a flowchart. Although the flowcharts describe various operations as a sequential process, many of the operations can be implemented in parallel, concurrently or concurrently. In addition, the order of operations can be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
所述计算机设备包括用户设备与网络设备。其中,所述用户设备包括但不限于电脑、智能手机、PDA等;所述网络设备包括但不限于单个网络服务器、多个网络服务器组成的服务器组或基于云计算(Cloud Computing)的由大量计算机或网络服务器构成的云,其中,云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。其中,所述计算机设备可单独运行来实现本发明,也可接入网络并通过与网络中的其他计算机设备的交互操作来实现本发明。其中,所述计算机设备所处的网络包括但不限于互联网、广域网、城域网、局域网、VPN网络等。The computer device includes a user device and a network device. The user equipment includes, but is not limited to, a computer, a smart phone, a PDA, etc.; the network device includes but is not limited to a single network server, a server group composed of multiple network servers, or a cloud computing based computer Or a cloud composed of a network server, wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computers. Wherein, the computer device can be operated separately to implement the present invention, and can also access the network and implement the present invention by interacting with other computer devices in the network. The network in which the computer device is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
需要说明的是,所述用户设备、网络设备和网络等仅为举例,其他现有的或今后可能出现的计算机设备或网络如可适用于本发明,也应包含在本发明保护范围以内,并以引用方式包含于此。It should be noted that the user equipment, the network equipment, the network, and the like are merely examples, and other existing or future possible computer equipment or networks, such as those applicable to the present invention, are also included in the scope of the present invention. It is included here by reference.
后面所讨论的方法(其中一些通过流程图示出)可以通过硬件、软件、固件、中间件、微代码、硬件描述语言或者其任意组合来实施。当用软件、固件、中间件或微代码来实施时,用以实施必要任务的程序代码或代码段可以被存储在机器或计算机可读介质(比如存储介质)中。(一个或多个)处理器可以实施必要的任务。The methods discussed below, some of which are illustrated by flowcharts, can be implemented in hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. When implemented in software, firmware, middleware or microcode, the program code or code segments to carry out the necessary tasks can be stored in a machine or computer readable medium, such as a storage medium. The processor(s) can perform the necessary tasks.
这里所公开的具体结构和功能细节仅仅是代表性的,并且是用于描述本发明的示例性实施例的目的。但是本发明可以通过许多替换形式来具体实现,并且不应当被解释成仅仅受限于这里所阐述的实施例。 The specific structural and functional details disclosed are merely representative and are for the purpose of describing exemplary embodiments of the invention. The present invention may, however, be embodied in many alternative forms and should not be construed as being limited only to the embodiments set forth herein.
应当理解的是,虽然在这里可能使用了术语“第一”、“第二”等等来描述各个单元,但是这些单元不应当受这些术语限制。使用这些术语仅仅是为了将一个单元与另一个单元进行区分。举例来说,在不背离示例性实施例的范围的情况下,第一单元可以被称为第二单元,并且类似地第二单元可以被称为第一单元。这里所使用的术语“和/或”包括其中一个或更多所列出的相关联项目的任意和所有组合。It should be understood that although the terms "first," "second," etc. may be used herein to describe the various elements, these elements should not be limited by these terms. These terms are used only to distinguish one unit from another. For example, a first unit could be termed a second unit, and similarly a second unit could be termed a first unit, without departing from the scope of the exemplary embodiments. The term "and/or" used herein includes any and all combinations of one or more of the associated listed items.
应当理解的是,当一个单元被称为“连接”或“耦合”到另一单元时,其可以直接连接或耦合到所述另一单元,或者可以存在中间单元。与此相对,当一个单元被称为“直接连接”或“直接耦合”到另一单元时,则不存在中间单元。应当按照类似的方式来解释被用于描述单元之间的关系的其他词语(例如“处于...之间”相比于“直接处于...之间”,“与...邻近”相比于“与...直接邻近”等等)。It will be understood that when a unit is referred to as "connected" or "coupled" to another unit, it can be directly connected or coupled to the other unit, or an intermediate unit can be present. In contrast, when a unit is referred to as being "directly connected" or "directly coupled" to another unit, there is no intermediate unit. Other words used to describe the relationship between the units should be interpreted in a similar manner (eg "between" and "directly between" and "adjacent to" Than "directly adjacent to", etc.).
这里所使用的术语仅仅是为了描述具体实施例而不意图限制示例性实施例。除非上下文明确地另有所指,否则这里所使用的单数形式“一个”、“一项”还意图包括复数。还应当理解的是,这里所使用的术语“包括”和/或“包含”规定所陈述的特征、整数、步骤、操作、单元和/或组件的存在,而不排除存在或添加一个或更多其他特征、整数、步骤、操作、单元、组件和/或其组合。The terminology used herein is for the purpose of describing the particular embodiments, The singular forms "a", "an", It is also to be understood that the terms "comprising" and """ Other features, integers, steps, operations, units, components, and/or combinations thereof.
还应当提到的是,在一些替换实现方式中,所提到的功能/动作可以按照不同于附图中标示的顺序发生。举例来说,取决于所涉及的功能/动作,相继示出的两幅图实际上可以基本上同时执行或者有时可以按照相反的顺序来执行。It should also be noted that, in some alternative implementations, the functions/acts noted may occur in a different order than that illustrated in the drawings. For example, two figures shown in succession may in fact be executed substantially concurrently or sometimes in the reverse order, depending on the function/acts involved.
首先对本发明实施例中的专业术语说明如下。The technical terms in the embodiments of the present invention are first explained as follows.
内存颗粒:也称内存芯片或内存晶片,常指内存条的内存单元。Memory granules: Also known as memory chips or memory chips, often referred to as memory cells.
DRAM颗粒:由DRAM芯片作为内存颗粒。DRAM granules: DRAM chips are used as memory granules.
PCIE(Peripheral Component Interface Express,总线接口标准)设备是指支持PCIE协议的设备。A PCIE (Peripheral Component Interface Express) device refers to a device that supports the PCIE protocol.
SRIOV功能,允许在设备/虚拟机之间高效共享PCIE设备。The SRIOV feature allows efficient sharing of PCIE devices between devices/virtual machines.
VF(Virtual Function,虚拟功能)驱动,主要用于发现PCIE设备。VF (Virtual Function) driver is mainly used to discover PCIE devices.
PF(Physical Function,物理功能)驱动,主要用于管理内存的各用户空间的地址与VF的ID的对应关系。The PF (Physical Function) driver is mainly used to manage the correspondence between the address of each user space in the memory and the ID of the VF.
下面结合附图对本发明的技术方案作进一步详细描述。The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings.
图1是根据本发明实施例的动态分配内存的方法的流程图。本实施例的方法主要包括如下步骤: 1 is a flow chart of a method of dynamically allocating memory in accordance with an embodiment of the present invention. The method of this embodiment mainly includes the following steps:
S110、接收服务器的内存分配请求;S110. Receive a memory allocation request of the server.
S120、根据内存分配请求,基于由多个经PCIE设备驱动的内存颗粒组成的内存池,判断内存池是否具有一个或多个空闲的内存颗粒满足所请求的内存空间;S120. Determine, according to a memory allocation request, whether the memory pool has one or more free memory particles to satisfy the requested memory space, based on a memory pool composed of a plurality of memory particles driven by the PCIE device.
若有所请求的内存空间,执行步骤S130;若没有所请求的内存空间,执行步骤S140。If there is a requested memory space, step S130 is performed; if there is no requested memory space, step S140 is performed.
S130、将所请求的内存空间分配给服务器;S130. Allocate the requested memory space to the server.
S140、等待;S140, waiting;
S150、判断是否有新释放的内存空间,并判断释放的内存空间是否满足所请求的内存要求;S150. Determine whether there is a newly released memory space, and determine whether the released memory space satisfies the requested memory requirement.
若释放的内存空间满足所请求的内存要求,执行S160;若不满足,返回S140,继续等待。If the released memory space satisfies the requested memory requirement, execute S160; if not, return to S140 and continue to wait.
S160、将释放的内存空间分配给服务器。S160. Allocate the released memory space to the server.
上述内存池是由多个经PCIE设备驱动的内存颗粒组成,其中,内存颗粒可以是DRAM颗粒。这意味着,需要对DRAM颗粒进行接口转换和协议转换,并且,需要利用PCIE设备对接口转换后的DRAM颗粒进行驱动,以及,需要对基于PCIE接口的DRAM池进行部署。The above memory pool is composed of a plurality of memory particles driven by PCIE devices, wherein the memory particles may be DRAM particles. This means that interface conversion and protocol conversion are required for DRAM particles, and the interface-converted DRAM particles need to be driven by PCIE devices, and the DRAM pool based on the PCIE interface needs to be deployed.
为进一步理解本发明,下面对方案从上述几个方面做进一步详细介绍。In order to further understand the present invention, the following aspects are further described in detail from the above aspects.
首先,介绍将DRAM接口转PCIE接口的实现。First, the implementation of the DRAM interface to the PCIE interface is introduced.
参见图2,是根据本发明实施例的动态分配内存的方法中一组DRAM接口转换成PCIE接口的示意图。2 is a schematic diagram of converting a set of DRAM interfaces into PCIE interfaces in a method for dynamically allocating memory according to an embodiment of the invention.
在具体实现上,可借助FPGA实现接口转换及协议转换功能。In the specific implementation, the interface conversion and protocol conversion functions can be implemented by means of the FPGA.
将DRAM接口转PCIE接口的过程包括:The process of transferring a DRAM interface to a PCIE interface includes:
(步骤1)DRAM接口通过MEMORY BUFFER进行容量扩展。(Step 1) The DRAM interface is capacity-expanded by MEMORY BUFFER.
本发明提到的内存是指服务器内存。本领域技术人员理解,服务器内存也是内存,它与普通PC机内存在外观和结构上没有什么明显实质性的区别,它主要是在内存上引入了一些新的技术。The memory mentioned in the present invention refers to server memory. Those skilled in the art understand that the server memory is also memory, and it has no obvious substantive difference between the appearance and the structure of the ordinary PC. It mainly introduces some new technologies into the memory.
例如,服务器内存可分为具有缓存的Buffer内存和不具备缓存的Unbuffer内存。Buffer即缓存器,也可理解成高速缓存,在服务器及图形工作站内存有较多应用,容量多为64K,但随着内存容量的不断增大,其容量也不断增加,具有Buffer的内存将对内存的读写速度有较大提高。有Buffer的内存几乎都带有ECC(Error Checking and Correcting,错误检查和纠正)功能。 For example, server memory can be divided into Buffer memory with cache and Unbuffer memory without cache. Buffer is a cache, which can also be understood as a cache. There are many applications in the server and graphics workstation memory, and the capacity is mostly 64K. However, as the memory capacity increases, its capacity also increases, and the memory with Buffer will be The read and write speed of the memory is greatly improved. Almost all memory with Buffer comes with ECC (Error Checking and Correcting).
Register即寄存器或目录寄存器,在内存上的作用可理解成书的目录,通过Register,当内存接到读写指令时,会先检索此目录,然后再进行读写操作,这将大大提高服务器内存工作效率。带有Register(寄存器或目录寄存器)的内存一定带Buffer,并且目前能见到的Register内存也都具有ECC功能。Register is the register or directory register. The role of memory can be understood as the book directory. Through Register, when the memory is connected to the read and write instructions, this directory will be retrieved first, then read and write operations, which will greatly improve the server memory work. effectiveness. Memory with Register (register or directory register) must have a Buffer, and the Register memory that can be seen at present also has ECC function.
LRDIMM(Load-Reduced DIMM,低负载DIMM)通过使用新的技术和较低的工作电压,达到降低服务器内存总线负载和功耗的目的,并让服务器内存总线可以达到更高的工作频率并大幅提升内存支持容量。LRDIMMs (Load-Reduced DIMMs) reduce the server's memory bus load and power consumption by using new technologies and lower operating voltages, and allow the server memory bus to achieve higher operating frequencies and significantly increase Memory support capacity.
对于通常的Unbuffered DIMM,服务器使用的Registered DIMM通过在内存条上缓冲信号并重动内存颗粒来提升内存支持容量,而LRDIMM内存通过将当前RDIMM内存上的Register芯片改为一种iMB(isolation Memory Buffer)内存隔离缓冲芯片来降低内存总线的负载,并相应地进一步提升内存支持容量。For a typical Unbuffered DIMM, the Registered DIMM used by the server boosts the memory support capacity by buffering the signal on the memory stick and relocating the memory granules. The LRDIMM memory changes the Register chip on the current RDIMM memory to an iMB (isolation Memory Buffer). The memory isolation buffer chip reduces the load on the memory bus and further increases the memory support capacity accordingly.
本发明中的DIMM不做类型限制,即,本发明DIMM涵盖目前或未来的各类型的DIMM。并且,通过DIMM的Memory Buffer(内存缓冲)功能实现内存容量提升。The DIMMs of the present invention are not limited in type, i.e., the DIMMs of the present invention cover current or future types of DIMMs. Also, the memory capacity is increased by the DIMM's Memory Buffer function.
在上述步骤(1)之后,通过将FPGA的高速IO脚与DIMM的接口进行连接,然后定义这些引脚,内部逻辑实现是将这些高速的引脚的信号在内部模拟出一个MEMORY控制器。After the above step (1), by connecting the high-speed IO pin of the FPGA to the DIMM interface and then defining these pins, the internal logic implementation simulates a MEMORY controller internally by the signals of these high-speed pins.
DRAM具有功耗低、集成度高(单片容量大)、价格便宜等优点,但是对DRAM进行控制相对复杂,且需要定时刷新,因此需要设计DRAM控制器。FPGA(Field Programmable Gate Array)提供大容量可编程逻辑,可设计出符合特定要求的DRAM控制器(MEMORY控制器)。由于FPGA是CMOS工艺,其功耗非常小,同时,FPGA可重复编写,从而方便进行性能扩展。如必要,只需改变FPGA内部逻辑,即能适合不同设计需求或环境要求。除了采用FPGA实现内存控制器,还可以采用其他可编程逻辑器件实现,例如CPLD(Complex Programmable Logic Device,复杂可编程逻辑器件)、PLD(Programmable Logic Device,复杂可编程逻辑器件)等。DRAM has the advantages of low power consumption, high integration (large single-chip capacity), and low price, but the control of DRAM is relatively complicated and requires timing refresh, so it is necessary to design a DRAM controller. The FPGA (Field Programmable Gate Array) provides large-capacity programmable logic to design a DRAM controller (MEMORY controller) that meets specific requirements. Since the FPGA is a CMOS process, its power consumption is very small, and at the same time, the FPGA can be rewritten to facilitate performance expansion. If necessary, simply change the internal logic of the FPGA to suit different design requirements or environmental requirements. In addition to using the FPGA to implement the memory controller, other programmable logic devices can be implemented, such as a CPLD (Complex Programmable Logic Device), a PLD (Programmable Logic Device), and the like.
(步骤2)MEMORY控制器的输入连接DRAM颗粒,因此MEMORY控制器的输入为支持DDR(double data rate,双倍速率)进程的DDR单元。(Step 2) The input of the MEMORY controller is connected to the DRAM pellet, so the input of the MEMORY controller is a DDR unit supporting a DDR (double data rate) process.
(步骤3)MEMORY控制器的出口为支持NVME(Non-Volatile Memory Express,非易失性存储器标准)与PCIE(Peripheral Component Interface Express,总线接口标准)的高速SERDES(SERializer/DESerializer,串行器/解串器),从而与PCIE设备的PCIE接口匹配。 (Step 3) The exit of the MEMORY controller is a high-speed SERDES (SERializer/DESerializer) that supports NVME (Non-Volatile Memory Express) and PCIE (Peripheral Component Interface Express). The deserializer) matches the PCIE interface of the PCIE device.
本例子中,以DDR内存为例进行说明,其具有传输速率快的优点。In this example, DDR memory is taken as an example for description, which has the advantage of a fast transmission rate.
NVMe是与AHCI一样都是逻辑设备接口标准,是使用PCI-E通道的SSD一种规范,NVMe的设计之初就有充分利用到PCI-E SSD的低延时以及并行性,还有当代处理器、平台与应用的并行性。SSD的并行性可以充分被主机的硬件与软件充分利用,相比与现在的AHCI标准,NVMe标准可以带来多方面的性能提升。NVMe is a logical device interface standard like AHCI. It is a specification for SSDs using PCI-E channels. NVMe is designed to take full advantage of the low latency and parallelism of PCI-E SSD, as well as contemporary processing. Parallelism of devices, platforms and applications. The parallelism of SSD can be fully utilized by the hardware and software of the host. Compared with the current AHCI standard, the NVMe standard can bring various performance improvements.
PCIE属于高速串行点对点双通道高带宽传输,所连接的设备分配独享通道带宽,不共享总线带宽,主要支持主动电源管理、错误报告、端对端的可靠性传输、热插拔以及服务质量(QOS)等功能。PCIE的主要优势就是数据传输速率高,例如,目前最高的16X 2.0版本可达到10GB/s,而且还有相当大的发展潜力。PCIE is a high-speed serial point-to-point dual-channel high-bandwidth transmission. The connected devices allocate exclusive channel bandwidth and do not share bus bandwidth. They mainly support active power management, error reporting, end-to-end reliability transmission, hot swap, and quality of service ( QOS) and other functions. The main advantage of PCIE is the high data transfer rate. For example, the current highest 16X 2.0 version can reach 10GB/s, and there is considerable potential for development.
这里需要将DDR、PCIE与NVME的进程/协议进行硬件语言的逻辑翻译实现一整套逻辑,本例子中,在FPGA内部实现。为了实现将DRAM接口转换为PCIE接口转换,FPGA内部需要识别DDR、PCIE与NVME,并进行逻辑转换。参见图2,FPGA内部包括DDR单元、NVMe单元和PCIE单元,其中,DDR单元作为输入,支持DDR Process,与一组DRAM颗粒的统一接口连接;NVMe单元,支持NVM协议,连接DDR单元和PCIE单元;PCIE单元,支持PCIE协议,其作为FPGA输出,提供与PCIe设备连接的PCIE接口。Here, the DDR, PCIE and NVME processes/protocols need to implement a complete set of logic for the logical translation of the hardware language. In this example, it is implemented inside the FPGA. In order to convert the DRAM interface to PCIE interface conversion, the FPGA needs to identify DDR, PCIE and NVME and perform logic conversion. Referring to FIG. 2, the FPGA internally includes a DDR unit, an NVMe unit, and a PCIE unit, wherein the DDR unit serves as an input, supports DDR Process, and is connected to a unified interface of a group of DRAM particles; the NVMe unit supports the NVM protocol, and connects the DDR unit and the PCIE unit. The PCIE unit supports the PCIE protocol, which acts as an FPGA output and provides a PCIE interface to the PCIe device.
通过上述方式,即可将一组DRAM接口转换成PCIE接口,例如转换为PCIE X8接口。In this way, a set of DRAM interfaces can be converted into a PCIE interface, for example, converted to a PCIE X8 interface.
参见图3,是根据本发明实施例的动态分配内存的方法中单颗粒DRAM接口转换成PCIE接口的示意图。图3方式与图2方式相比,区别在于,并不是更改一组DRAM颗粒的接口,而是更改单个DRAM颗粒的接口,这两种方式都可以达到相同的目的。Referring to FIG. 3, a schematic diagram of a single-particle DRAM interface converted into a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention. The difference between the mode of Figure 3 and the mode of Figure 2 is that instead of changing the interface of a group of DRAM particles, the interface of a single DRAM particle is changed, both of which can achieve the same purpose.
将DRAM接口转PCIE接口的过程包括:The process of transferring a DRAM interface to a PCIE interface includes:
(步骤1)DRAM接口通过MEMORY BUFFER进行容量扩展。(Step 1) The DRAM interface is capacity-expanded by MEMORY BUFFER.
(步骤2)MEMORY控制器的输入连接DRAM颗粒,因此MEMORY控制器的输入为支持DDR(double data rate)协议的DDR单元。(Step 2) The input of the MEMORY controller is connected to the DRAM pellet, so the input of the MEMORY controller is a DDR unit supporting the DDR (double data rate) protocol.
(步骤3)MEMORY控制器的出口为支持PCIE(Peripheral Component Interface Express,总线接口标准)的PCIE单元,从而与PCIE设备的PCIE接口匹配。(Step 3) The exit of the MEMORY controller is a PCIE unit supporting PCIE (Peripheral Component Interface Express) to match the PCIE interface of the PCIE device.
在具体实现上,可以借助晶片实现上述接口转换。将DRAM接口到PCIE接口转换在DRAM芯片封装时完成,即DRAM二次封装后接口为PCIE的接口芯片。In a specific implementation, the above interface conversion can be implemented by means of a wafer. The conversion of the DRAM interface to the PCIE interface is completed in the DRAM chip package, that is, the interface of the DRAM secondary package is a PCIE interface chip.
下面,介绍利用PCIE设备对转换后的DRAM颗粒进行驱动的实现细节。 Below, the implementation details of driving the converted DRAM particles using a PCIE device are described.
在经过上述图2或图3所示的接口转换后,已经得到基于PCIE接口的DRAM颗粒,接下来,需要对基于PCIE接口的DRAM进行驱动,由此为多服务器共享内存容量或是单台服务器内多个虚拟机共享内存容量做准备。After the interface conversion shown in FIG. 2 or FIG. 3 above, the DRAM particles based on the PCIE interface have been obtained, and then the DRAM based on the PCIE interface needs to be driven, thereby sharing the memory capacity or the single server for multiple servers. Prepare for sharing the memory capacity of multiple virtual machines.
本领域技术人员了解,SRIOV技术是一种基于硬件的虚拟化解决方案,可提高性能和可伸缩性。SRIOV标准允许在虚拟机之间高效共享PCIE设备,并且它是在硬件中实现的,可以获得能够与本机性能相当的I/O性能。SRIOV规范定义了新的标准,根据该标准,创建的新设备可允许将虚拟机直接连接到I/O设备。单个I/O资源可由许多虚拟机共享。共享的设备将提供专用的资源,并且还使用共享的通用资源。这样,每个虚拟机都可访问唯一的资源。因此,启用了SRIOV并且具有适当的硬件和OS支持的PCIE设备可以显示为多个单独的物理设备,每个都具有自己的PCIE配置空间。Those skilled in the art understand that SRIOV technology is a hardware-based virtualization solution that improves performance and scalability. The SRIOV standard allows for efficient sharing of PCIE devices between virtual machines, and it is implemented in hardware to achieve I/O performance comparable to native performance. The SRIOV specification defines a new standard by which new devices are created that allow virtual machines to be directly connected to I/O devices. A single I/O resource can be shared by many virtual machines. Shared devices will provide dedicated resources and also use shared common resources. This way, each virtual machine has access to a unique resource. Therefore, a PCIE device with SRIOV enabled and with appropriate hardware and OS support can be displayed as multiple separate physical devices, each with its own PCIE configuration space.
SRIOV中主要的两种功能是:(1)物理功能(Physical Function,PF):用于支持SRIOV功能的PCI功能,如SRIOV规范中定义。PF包含SRIOV功能结构,用于管理SRIOV功能。PF是全功能的PCIE功能,可以像其他任何PCIE设备一样进行发现、管理和处理。PF拥有完全配置资源,可以用于配置或控制PCIE设备。(2)虚拟功能(Virtual Function,VF):与物理功能关联的一种功能。VF是一种轻量级PCIE功能,可以与物理功能以及与同一物理功能关联的其他VF共享一个或多个物理资源。VF仅允许拥有用于其自身行为的配置资源。The two main functions in SRIOV are: (1) Physical Function (PF): PCI function to support SRIOV function, as defined in the SRIOV specification. The PF contains the SRIOV functional structure for managing SRIOV functions. PF is a full-featured PCIE feature that can be discovered, managed, and processed just like any other PCIE device. PF has fully configured resources that can be used to configure or control PCIE devices. (2) Virtual Function (VF): A function associated with a physical function. VF is a lightweight PCIE feature that shares one or more physical resources with physical functions and other VFs associated with the same physical function. VF only allows configuration resources for its own behavior.
本发明中,对基于PCIE接口的DRAM进行驱动,主要包括以下流程:In the present invention, driving the DRAM based on the PCIE interface mainly includes the following processes:
(1)首先是使能PCIE硬件的SRIOV功能(1) First, enable the SRIOV function of the PCIE hardware.
这个功能使能是说明这个PCIE设备支持SRIOV功能,可以在OS层面发现这个功能设备。This feature enable indicates that this PCIE device supports the SRIOV function and can be discovered at the OS level.
(2)PF驱动(2) PF drive
安装在服务器或者是管理机器中的一个驱动,这个驱动主要是为了管理内存的各用户空间的地址与VF的ID的对应关系,即PF可以看到PCIE设备的全部空间的ID对应的地址,可以进行管理。Installed on the server or a driver in the management machine. This driver is mainly used to manage the correspondence between the address of each user space in the memory and the ID of the VF. That is, the PF can see the address corresponding to the ID of all the space of the PCIE device. Manage.
(3)VF驱动(3) VF drive
安装在虚拟机中的一个驱动,主要是用于发现PCIE设备。A driver installed in a virtual machine, mainly used to discover PCIE devices.
(4)地址映射(4) Address mapping
主要是实现PCIE的地址、服务器(虚拟机)地址与内存地址的映射。Mainly to achieve the mapping of PCIE address, server (virtual machine) address and memory address.
(5)加载驱动时完成内存地址映射 (5) Complete memory address mapping when loading the driver
驱动加载时完成以上这些地址映射,以便在内存中看到这块PCIE空间。These address maps are completed when the driver is loaded to see this PCIE space in memory.
最后,介绍对基于PCIE接口的DRAM池进行部署的实现细节。Finally, the implementation details of the deployment of the DRAM pool based on the PCIE interface are introduced.
在完成上述接口转换、基于PCIE接口的DRAM驱动之后,即得到由多个基于PCIE接口的DRAM颗粒组成的内存池,下面就需要对内存池进行合理部署和管理,从而高效进行内存分配,达到多台服务器共享同一内存池的目的。After completing the above interface conversion and PCIE interface-based DRAM driver, a memory pool composed of a plurality of DRAM particles based on the PCIE interface is obtained, and the memory pool needs to be properly deployed and managed to efficiently allocate memory. The purpose of the server sharing the same memory pool.
对基于PCIE接口的DRAM池进行部署主要包括以下流程:The deployment of the DRAM pool based on the PCIE interface mainly includes the following processes:
(1)多台物理机分享内存池的内存空间(1) Multiple physical machines share the memory space of the memory pool
多台主机共享这个内存池中的存储空间。Multiple hosts share the storage space in this memory pool.
(2)管理单元管理PF驱动运行(2) Management unit management PF driver operation
管理单元中运行的是PF的驱动,作用是将用户空间与VF的空间ID对应并进行灵活的在线匹配。The PF driver is running in the management unit, which is to match the user space with the space ID of the VF and perform flexible online matching.
(3)在SERVER上运行VF驱动(3) Run VF driver on SERVER
上述准备完成后,VF会在各服务器上运行,服务器发现自己所看到地址空间,可以对空间进行操作。After the above preparation is completed, the VF runs on each server, and the server finds the address space that it sees and can operate the space.
(4)每个SERVER上的内存空间分配由管理单元来统一管理,灵活在线分配。(4) The memory space allocation on each SERVER is managed by the management unit and is flexibly distributed online.
参见图4,是根据本发明实施例的动态分配内存的方法中基于PCIE接口的DRAM池部署示意图。4 is a schematic diagram of a DRAM pool deployment based on a PCIE interface in a method for dynamically allocating memory according to an embodiment of the present invention.
图4中,示出了多台服务器、由多个经PCI设备驱动的DRAM颗粒组成的内存池、管理单元、PCIE开关。其中,服务器包括PCIE模块,如前描述的,在服务器上运行VF驱动,从而使服务器发现自身地址空间,并对地址空间进行操作。In FIG. 4, a plurality of servers, a memory pool composed of a plurality of DRAM particles driven by PCI devices, a management unit, and a PCIE switch are shown. The server includes a PCIE module. As described above, the VF driver is run on the server, so that the server discovers its own address space and operates on the address space.
其中,管理单元负责管理服务器针对内存池的内存分配,包括三个方面:管理已经在使用的内存;释放使用完成的内存;未使用内存分配。具体的,管理单元根据服务器的内存分配请求,向服务器分配请求所需要的内存容量,在使用完成后,再进行释放并再分配到有需要的请求的服务器上。The management unit is responsible for managing the memory allocation of the server to the memory pool, including three aspects: managing the memory that is already in use; releasing the used memory; and not using the memory allocation. Specifically, the management unit allocates the memory capacity required for the request to the server according to the memory allocation request of the server, and after the usage is completed, releases and re-allocates to the server with the required request.
PCIE开关可提供多个端口,从而连接多个内存颗粒,因此可一次性将多个内存颗粒的内存空间分配给特定服务器。The PCIE switch provides multiple ports to connect multiple memory granules, so you can allocate memory space for multiple memory granules to a specific server at once.
相较于现有技术中每台服务器通过插槽接入固定数量的内存的方式,不但通过内存buffer扩展了内存容量,而且,可按需实现内存分配。例如,一台服务器具有16根插槽,若每个内存条的容量是16G,即使全部插满也只有256G容量;假设现需要300G内存,按照现有方式只有增加一台服务器,虽然这样可以满足内存需求,然而新增加服务器的 其他资源则是浪费。而通过本发明的方式,通过内存buffer扩展了内存容量,并且可根据需求设置一定数量的经PCIE设备驱动的DRAM颗粒,在服务器提出内存分配请求时,可根据请求的内存大小,动态选取满足所请求内存大小的数量的内存颗粒,将这部分内存颗粒的内容分配给服务器,在服务器使用完成后,再动态释放掉这部分内存空间,供其他有需要的服务器使用。Compared with the prior art, each server accesses a fixed amount of memory through a slot, not only expands the memory capacity through the memory buffer, but also realizes memory allocation as needed. For example, a server has 16 slots. If the capacity of each memory module is 16G, even if it is fully populated, it only has 256G capacity. If it is required to have 300G memory, only one server is added according to the existing method, although this can be satisfied. Memory requirements, however new server additions Other resources are wasted. In the manner of the present invention, the memory capacity is expanded by the memory buffer, and a certain number of DRAM particles driven by the PCIE device can be set according to requirements. When the server makes a memory allocation request, the memory can be dynamically selected according to the requested memory size. The memory granules requesting the amount of memory size, the content of the part of the memory granules is allocated to the server, and after the server is used, the memory space is dynamically released for use by other servers in need.
可见,本发明通过将DRAM颗粒的接口通过可编程逻辑芯片(FPGA)或晶片来转换成PCIE接口,从而实现DRAM接口到PCIE接口的转换,然后通过PCIE设备的驱动,将分配后的PCIE设备指定到特定的计算节点后,将这个部分的PCIE地址映射到内存地址中,从而实现驱动所分配的那个部分的内存的目的;通过内存池的部署和管理,可为服务器分配所请求的一定数量的内存空间,并对内存进行分配、释放的动态管理。It can be seen that the present invention converts the DRAM interface to the PCIE interface by converting the interface of the DRAM particles into a PCIE interface through a programmable logic chip (FPGA) or a chip, and then designating the allocated PCIE device through the driver of the PCIE device. After a specific compute node, the PCIE address of this part is mapped to the memory address, thereby realizing the purpose of driving the allocated portion of the memory; through the deployment and management of the memory pool, the server can be allocated a certain number of requests. Memory space, and dynamic management of memory allocation and release.
本发明方案与现有技术相比,至少具有以下优点:Compared with the prior art, the solution of the invention has at least the following advantages:
(1)按需求分配内存(1) Allocate memory on demand
通过PCIE设备驱动的DRAM颗粒组成的内存池,可以通过PCIE交换实现不同服务器对内存的动态分配和按需分配。Through the memory pool composed of DRAM particles driven by PCIE devices, the dynamic allocation and on-demand allocation of memory by different servers can be realized through PCIE exchange.
(2)内存与服务器的分离(2) Separation of memory and server
通过PCIE接口的转换,可以实现PCIE的扩展,PCIE与标准服务器的PCIE SLOT连接,这样将服务器与内存通过PCIE来分离。PCIE expansion can be achieved through the conversion of the PCIE interface. The PCIE is connected to the PCIE SLOT of the standard server, so that the server and the memory are separated by PCIE.
(3)实现大容量内存(3) achieve large memory
通过内存BUFFER的扩展,相比标准内存,容量可以扩大很多倍。With the expansion of the memory BUFFER, the capacity can be expanded many times compared to the standard memory.
(4)节约成本(4) Cost savings
由于通过内存buffer扩展了内存颗粒,且通过对内存池的动态分配和按需分配,因此与标准内存相比,成本有较低的优势。Since the memory granules are expanded by the memory buffer and the dynamic allocation and on-demand allocation of the memory pool, the cost is lower than that of the standard memory.
(5)可维护性增强(5) Maintainability enhancement
相比于现有标准的内存必须停机维护,PCIE设备可以进行热插拔,因此可维护性增强。PCIE devices can be hot swapped compared to existing standard memory, and maintainability is enhanced.
本发明实施例提供一种与上述方法相对应的一种动态分配内存的装置。参见图5,该装置包括:An embodiment of the present invention provides an apparatus for dynamically allocating memory corresponding to the foregoing method. Referring to Figure 5, the device includes:
请求接收单元501,用于接收服务器的内存分配请求;The request receiving unit 501 is configured to receive a memory allocation request of the server;
判断单元502,用于根据所述内存分配请求,基于由多个经PCIE设备驱动的内存颗粒组成的内存池,判断内存池是否具有一个或多个空闲的内存颗粒的内存总和满足所请 求的内存大小;The determining unit 502 is configured to determine, according to the memory allocation request, based on a memory pool composed of a plurality of memory particles driven by the PCIE device, whether the memory pool has one or more free memory particles and the memory sum meets the request The size of the memory;
分配单元503,用于将所请求的内存分配给所述服务器。The allocating unit 503 is configured to allocate the requested memory to the server.
优选的,该装置还包括:Preferably, the device further comprises:
接口转换单元504,用于将DRAM接口通过内存缓冲进行容量扩展;以及,将内存控制器的输入连接DRAM颗粒,在内存控制器进行DDR内存进程到PCIE进程的转换逻辑,使内存控制器的输出为PCIE接口,使内存控制器的输出为PCIE接口。The interface conversion unit 504 is configured to expand the capacity of the DRAM interface through the memory buffer; and connect the input of the memory controller to the DRAM particles, and perform the conversion logic of the DDR memory process to the PCIE process in the memory controller to make the output of the memory controller For the PCIE interface, the output of the memory controller is the PCIE interface.
优选的,该装置还包括:Preferably, the device further comprises:
驱动单元505,用于使能PCIE设备的SRIOV功能;安装PF驱动和VF驱动;以及,实现PCIE地址、服务器地址与内存地址的映射,并将地址映射写入所述PF驱动和VF驱动。The driving unit 505 is configured to enable the SRIOV function of the PCIE device; install the PF driver and the VF driver; and implement mapping of the PCIE address, the server address and the memory address, and write the address mapping to the PF driver and the VF driver.
优选的,该装置还包括:Preferably, the device further comprises:
内存池部署单元506,用于设置一管理单元控制多台服务器共享内存池的内存空间;在所述管理单元中运行所述PF驱动,从而将用户空间与VF空间ID对应并进行匹配;以及,在各服务器上运行所述VF驱动,从而使服务器发现自身对应的地址空间并进行操作。The memory pool deployment unit 506 is configured to set a management unit to control a memory space of the shared memory pool of the plurality of servers; and run the PF driver in the management unit to match and match the user space with the VF space ID; and The VF driver is run on each server, so that the server finds its own address space and operates.
优选的,Preferably,
判断单元502还用于,判断服务器是否使用完成所分配的内存空间;The determining unit 502 is further configured to: determine whether the server uses the allocated memory space;
装置还包括:释放单元507,用于释放使用完成的内存空间。The device further includes a release unit 507 for releasing the used memory space.
优选的,Preferably,
判断单元502还用于,若判断不具有所请求的内存空间,则等待,并判断是否有新释放的内存空间;若释放的内存空间满足所请求的内存要求,则指示分配单元503将释放的内存空间分配给所述服务器。The determining unit 502 is further configured to: if it is determined that the requested memory space is not available, wait, and determine whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, the indicating allocation unit 503 is released. The memory space is allocated to the server.
此外,本发明还提供一种动态分配内存的系统,该系统包括:由多个经PCIE设备驱动的内存颗粒组成的内存池;一个或多个服务器;以及,如前描述的图5所示的动态分配内存的装置。In addition, the present invention also provides a system for dynamically allocating memory, the system comprising: a memory pool composed of a plurality of memory particles driven by PCIE devices; one or more servers; and, as shown in FIG. 5 described above A device that dynamically allocates memory.
另外,本发明还提供一种内存,该内存包括多个内存颗粒,其中,所述内存颗粒经PCIE设备驱动。In addition, the present invention also provides a memory including a plurality of memory particles, wherein the memory particles are driven by a PCIE device.
需要注意的是,本发明可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本发明的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本 发明的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本发明的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。It should be noted that the present invention can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device. In one embodiment, the software program of the present invention may be executed by a processor to implement the steps or functions described above. Similarly, this The inventive software program (including related data structures) can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like. Additionally, some of the steps or functions of the present invention may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
另外,本发明的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本发明的方法和/或技术方案。而调用本发明的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本发明的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本发明的多个实施例的方法和/或技术方案。Additionally, a portion of the invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or solution in accordance with the present invention. The program instructions for invoking the method of the present invention may be stored in a fixed or removable recording medium and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run. Herein, an embodiment in accordance with the present invention includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering The apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present invention.
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。 It is apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, and the present invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the invention is defined by the appended claims instead All changes in the meaning and scope of equivalent elements are included in the present invention. Any reference signs in the claims should not be construed as limiting the claim. In addition, it is to be understood that the word "comprising" does not exclude other elements or steps. A plurality of units or devices recited in the system claims can also be implemented by a unit or device by software or hardware. The first, second, etc. words are used to denote names and do not denote any particular order.

Claims (15)

  1. 一种动态分配内存的方法,其特征在于,包括:A method for dynamically allocating memory, comprising:
    接收服务器的内存分配请求;Receiving a memory allocation request from the server;
    根据所述内存分配请求,基于由多个经总线接口标准设备驱动的存储颗粒组成的内存池,判断所述内存池是否具有一个或多个空闲的存储颗粒的内存总和满足所请求的内存大小;Determining, according to the memory allocation request, based on a memory pool composed of a plurality of storage particles driven by the bus interface standard device, determining whether the memory pool has a memory sum of one or more free storage particles satisfying the requested memory size;
    若是,将所请求的内存分配给所述服务器。If so, the requested memory is allocated to the server.
  2. 如权利要求1所述的方法,其特征在于,所述存储颗粒包括DRAM颗粒,所述方法还包括:将DRAM颗粒的DRAM接口转换成PCIE接口。The method of claim 1 wherein said storage particles comprise DRAM particles, said method further comprising: converting the DRAM interface of the DRAM particles into a PCIE interface.
  3. 如权利要求2所述的方法,其特征在于,所述将DRAM颗粒的DRAM接口转换成PCIE接口,包括:The method of claim 2 wherein said converting the DRAM interface of the DRAM particles to a PCIE interface comprises:
    将DRAM接口通过内存缓冲进行容量扩展;Capacity expansion of the DRAM interface through memory buffering;
    将内存控制器的输入连接DRAM颗粒,在内存控制器进行双倍速率DDR内存进程到PCIE进程的转换逻辑,使内存控制器的输出为PCIE接口。The input of the memory controller is connected to the DRAM particles, and the memory controller performs a conversion logic of the double-rate DDR memory process to the PCIE process, so that the output of the memory controller is a PCIE interface.
  4. 如权利要求1所述的方法,其特征在于,通过PCIE设备驱动DRAM颗粒包括:The method of claim 1 wherein driving the DRAM particles by the PCIE device comprises:
    使能PCIE设备的SRIOV功能;Enable the SRIOV function of the PCIE device.
    安装物理功能PF驱动和虚拟功能VF驱动;Install physical function PF driver and virtual function VF driver;
    实现PCIE地址、服务器地址与内存地址的映射,并将地址映射写入所述PF驱动和VF驱动。A mapping of the PCIE address, the server address, and the memory address is implemented, and the address mapping is written to the PF driver and the VF driver.
  5. 如权利要求4所述的方法,其特征在于,还包括:对内存池进行部署:The method of claim 4, further comprising: deploying the memory pool:
    由一管理单元控制多台服务器共享内存池的内存空间;Controlling the memory space of the shared memory pool of multiple servers by a management unit;
    在所述管理单元中运行所述PF驱动,从而将用户空间与虚拟功能驱动空间ID对应并进行匹配;Running the PF driver in the management unit, thereby correspondingly matching and matching the user space with the virtual function driving space ID;
    在各服务器上运行所述虚拟功能驱动,从而使服务器发现自身对应的地址空间并进行操作。The virtual function driver is run on each server, so that the server finds its own corresponding address space and operates.
  6. 如权利要求1至5任一项所述的方法,其特征在于,还包括:The method of any of claims 1 to 5, further comprising:
    判断服务器是否使用完成所分配的内存空间,若是,释放所述内存空间。Determine whether the server uses the allocated memory space, and if so, release the memory space.
  7. 如权利要求6所述的方法,其特征在于,若判断不具有所请求的内存空间,所述方法还包括:The method of claim 6, wherein if it is determined that the requested memory space is not available, the method further comprises:
    等待,并判断是否有新释放的内存空间; Wait and determine if there is a newly released memory space;
    若释放的内存空间满足所请求的内存要求,则将释放的内存空间分配给所述服务器。If the freed memory space meets the requested memory requirement, the freed memory space is allocated to the server.
  8. 一种动态分配内存的装置,其特征在于,包括:A device for dynamically allocating memory, comprising:
    请求接收单元,用于接收服务器的内存分配请求;a request receiving unit, configured to receive a memory allocation request of the server;
    判断单元,用于根据所述内存分配请求,基于由多个经总线接口标准设备驱动的内存颗粒组成的内存池,判断所述内存池是否具有一个或多个空闲的内存颗粒的内存总和满足所请求的内存大小;a determining unit, configured to determine, according to the memory allocation request, whether the memory pool has a memory sum of one or more free memory particles based on a memory pool composed of a plurality of memory particles driven by a bus interface standard device The requested memory size;
    分配单元,用于将所请求的内存分配给所述服务器。An allocation unit for allocating the requested memory to the server.
  9. 如权利要求8所述的装置,其特征在于,所述内存颗粒包括DRAM颗粒;所述装置还包括:The device of claim 8 wherein said memory particles comprise DRAM particles; said apparatus further comprising:
    接口转换单元,用于将DRAM接口通过内存缓冲进行容量扩展;以及,将内存控制器的输入连接DRAM颗粒,在内存控制器进行DDR内存进程到PCIE进程的转换逻辑,使内存控制器的输出为PCIE接口,使内存控制器的输出为PCIE接口。The interface conversion unit is configured to expand the capacity of the DRAM interface through the memory buffer; and, the input of the memory controller is connected to the DRAM particle, and the conversion logic of the DDR memory process to the PCIE process is performed in the memory controller, so that the output of the memory controller is The PCIE interface makes the output of the memory controller a PCIE interface.
  10. 如权利要求8所述的装置,其特征在于,还包括:The device of claim 8 further comprising:
    驱动单元,用于使能PCIE设备的SRIOV功能;安装PF驱动和VF驱动;以及,实现PCIE地址、服务器地址与内存地址的映射,并将地址映射写入所述PF驱动和VF驱动。The driving unit is configured to enable the SRIOV function of the PCIE device; install the PF driver and the VF driver; and implement mapping of the PCIE address, the server address and the memory address, and write the address mapping to the PF driver and the VF driver.
  11. 如权利要求10所述的装置,其特征在于,还包括:The device of claim 10, further comprising:
    内存池部署单元,用于设置一管理单元控制多台服务器共享内存池的内存空间;在所述管理单元中运行所述PF驱动,从而将用户空间与VF空间ID对应并进行匹配;以及,在各服务器上运行所述VF驱动,从而使服务器发现自身对应的地址空间并进行操作。a memory pool deployment unit, configured to set a management unit to control a memory space of the shared memory pool of the plurality of servers; and run the PF driver in the management unit to match and match the user space with the VF space ID; and The VF driver is run on each server, so that the server finds its own corresponding address space and operates.
  12. 如权利要求8至10任一项所述的装置,其特征在于,A device according to any one of claims 8 to 10, characterized in that
    所述判断单元还用于,判断服务器是否使用完成所分配的内存空间;The determining unit is further configured to: determine whether the server uses the allocated memory space;
    所述装置还包括:释放单元,用于释放使用完成的内存空间。The device further includes a release unit for releasing the used memory space.
  13. 如权利要求12所述的装置,其特征在于,The device of claim 12 wherein:
    所述判断单元还用于,若判断不具有所请求的内存空间,则等待,并判断是否有新释放的内存空间;若释放的内存空间满足所请求的内存要求,则指示所述分配单元将释放的内存空间分配给所述服务器。The determining unit is further configured to: if it is determined that the requested memory space is not available, wait, and determine whether there is a newly released memory space; if the released memory space satisfies the requested memory requirement, indicate that the allocating unit The freed memory space is allocated to the server.
  14. 一种动态分配内存的系统,其特征在于,包括:由多个经总线接口标准设备驱动 的内存颗粒组成的内存池;一个或多个服务器;以及,权利要求8-13所述的任一项的所述动态分配内存的装置。A system for dynamically allocating memory, comprising: driving by a plurality of standard devices via a bus interface A memory pool of memory particles; one or more servers; and the apparatus for dynamically allocating memory according to any one of claims 8-13.
  15. 一种内存,其特征在于,所述内存包括多个内存颗粒,其中,所述内存颗粒经总线接口标准设备驱动。 A memory, characterized in that the memory comprises a plurality of memory particles, wherein the memory particles are driven by a bus interface standard device.
PCT/CN2017/079715 2016-04-20 2017-04-07 Method, device, and system for dynamically allocating memory WO2017181853A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610249100.7 2016-04-20
CN201610249100.7A CN107305506A (en) 2016-04-20 2016-04-20 The method of dynamic assigning memory, apparatus and system

Publications (1)

Publication Number Publication Date
WO2017181853A1 true WO2017181853A1 (en) 2017-10-26

Family

ID=60115560

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079715 WO2017181853A1 (en) 2016-04-20 2017-04-07 Method, device, and system for dynamically allocating memory

Country Status (3)

Country Link
CN (1) CN107305506A (en)
TW (1) TWI795354B (en)
WO (1) WO2017181853A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858038A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and medium for reading memory data of FPGA (field programmable Gate array) board card
CN113051066A (en) * 2019-12-27 2021-06-29 阿里巴巴集团控股有限公司 Memory management method, device, equipment and storage medium
CN113194161A (en) * 2021-04-26 2021-07-30 山东英信计算机技术有限公司 Method and device for setting MMIO base address of server system
CN113868155A (en) * 2021-11-30 2021-12-31 苏州浪潮智能科技有限公司 Memory space expansion method and device, electronic equipment and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102545228B1 (en) * 2018-04-18 2023-06-20 에스케이하이닉스 주식회사 Computing system and data processing system including the same
CN109542346A (en) * 2018-11-19 2019-03-29 深圳忆联信息系统有限公司 Dynamic data cache allocation method, device, computer equipment and storage medium
CN110704084A (en) * 2019-09-27 2020-01-17 深圳忆联信息系统有限公司 Method and device for dynamically allocating memory in firmware upgrade, computer equipment and storage medium
CN111212150A (en) * 2020-04-21 2020-05-29 成都甄识科技有限公司 Optical fiber reflection shared memory device
CN113672376A (en) * 2020-05-15 2021-11-19 浙江宇视科技有限公司 Server memory resource allocation method and device, server and storage medium
CN112817766B (en) * 2021-02-22 2024-01-30 北京青云科技股份有限公司 Memory management method, electronic equipment and medium
CN115480908A (en) * 2021-06-15 2022-12-16 华为技术有限公司 Memory pooling method and related device
CN117453385A (en) * 2022-07-19 2024-01-26 华为技术有限公司 Memory allocation method, device and computer

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249017A1 (en) * 2008-03-31 2009-10-01 Tim Prebble Systems and Methods for Memory Management for Rasterization
CN103593243A (en) * 2013-11-01 2014-02-19 浪潮电子信息产业股份有限公司 Dynamic extensible method for increasing virtual machine resources
CN103870333A (en) * 2012-12-17 2014-06-18 华为技术有限公司 Global memory sharing method, global memory sharing device and communication system
CN104793999A (en) * 2014-01-21 2015-07-22 航天信息股份有限公司 Servo server framework system
CN105094985A (en) * 2015-07-15 2015-11-25 上海新储集成电路有限公司 Low-power-consumption data center for sharing memory pool and working method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9311122B2 (en) * 2012-03-26 2016-04-12 Oracle International Corporation System and method for providing a scalable signaling mechanism for virtual machine migration in a middleware machine environment
JP2017512350A (en) * 2014-03-08 2017-05-18 ディアマンティ インコーポレイテッド Method and system for centralized networking and storage

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249017A1 (en) * 2008-03-31 2009-10-01 Tim Prebble Systems and Methods for Memory Management for Rasterization
CN103870333A (en) * 2012-12-17 2014-06-18 华为技术有限公司 Global memory sharing method, global memory sharing device and communication system
CN103593243A (en) * 2013-11-01 2014-02-19 浪潮电子信息产业股份有限公司 Dynamic extensible method for increasing virtual machine resources
CN104793999A (en) * 2014-01-21 2015-07-22 航天信息股份有限公司 Servo server framework system
CN105094985A (en) * 2015-07-15 2015-11-25 上海新储集成电路有限公司 Low-power-consumption data center for sharing memory pool and working method thereof

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051066A (en) * 2019-12-27 2021-06-29 阿里巴巴集团控股有限公司 Memory management method, device, equipment and storage medium
CN111858038A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and medium for reading memory data of FPGA (field programmable Gate array) board card
US11687242B1 (en) 2020-06-30 2023-06-27 Inspur Electronic Information Industry Co., Ltd. FPGA board memory data reading method and apparatus, and medium
CN113194161A (en) * 2021-04-26 2021-07-30 山东英信计算机技术有限公司 Method and device for setting MMIO base address of server system
CN113194161B (en) * 2021-04-26 2022-07-08 山东英信计算机技术有限公司 Method and device for setting MMIO base address of server system
US11847086B2 (en) 2021-04-26 2023-12-19 Shandong Yingxin Computer Technologies Co., Ltd. Method and apparatus for configuring MMIOH base address of server system
CN113868155A (en) * 2021-11-30 2021-12-31 苏州浪潮智能科技有限公司 Memory space expansion method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
TWI795354B (en) 2023-03-11
CN107305506A (en) 2017-10-31
TW201738754A (en) 2017-11-01

Similar Documents

Publication Publication Date Title
WO2017181853A1 (en) Method, device, and system for dynamically allocating memory
US9760497B2 (en) Hierarchy memory management
EP3060993B1 (en) Final level cache system and corresponding method
US8996781B2 (en) Integrated storage/processing devices, systems and methods for performing big data analytics
US20220334975A1 (en) Systems and methods for streaming storage device content
US8918568B2 (en) PCI express SR-IOV/MR-IOV virtual function clusters
US10346342B1 (en) Uniform memory access architecture
US20190286559A1 (en) Providing Multiple Memory Modes For A Processor Including Internal Memory
CN110275840B (en) Distributed process execution and file system on memory interface
US9026698B2 (en) Apparatus, system and method for providing access to a device function
US11029847B2 (en) Method and system for shared direct access storage
EP4123649A1 (en) Memory module, system including the same, and operation method of memory module
CN113678104A (en) Symbol data moving system in equipment
US20230350795A1 (en) Dual-port memory module design for composable computing
US20230144038A1 (en) Memory pooling bandwidth multiplier using final level cache system
CN115729849A (en) Memory management method and computing equipment
WO2022109770A1 (en) Multi-port memory link expander to share data among hosts
KR20180023543A (en) Apparatus and method for providing memory via serial communication
US10936219B2 (en) Controller-based inter-device notational data movement system
US20160077959A1 (en) System and Method for Sharing a Solid-State Non-Volatile Memory Resource
US20190303316A1 (en) Hardware based virtual memory management
US20200341925A1 (en) Switch-based inter-device notational data movement system
TW202340931A (en) Direct swap caching with noisy neighbor mitigation and dynamic address range assignment
JP2023527770A (en) Inference in memory

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 17785338

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17785338

Country of ref document: EP

Kind code of ref document: A1