WO2021047425A1 - 一种持久性内存的虚拟化方法及系统 - Google Patents

一种持久性内存的虚拟化方法及系统 Download PDF

Info

Publication number
WO2021047425A1
WO2021047425A1 PCT/CN2020/112879 CN2020112879W WO2021047425A1 WO 2021047425 A1 WO2021047425 A1 WO 2021047425A1 CN 2020112879 W CN2020112879 W CN 2020112879W WO 2021047425 A1 WO2021047425 A1 WO 2021047425A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual
physical
persistent memory
address
memory
Prior art date
Application number
PCT/CN2020/112879
Other languages
English (en)
French (fr)
Inventor
陈正华
屠要峰
许军宁
郭斌
韩银俊
高洪
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP20862292.8A priority Critical patent/EP3974974A4/en
Publication of WO2021047425A1 publication Critical patent/WO2021047425A1/zh

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Definitions

  • the embodiments of the present application relate to, but are not limited to, the technical field of storage virtualization, and particularly refer to a persistent memory (Persistent Memory, PM) virtualization method and system.
  • PM Persistent Memory
  • Persistent memory has performance close to that of Dynamic Random Access Memory (DRAM), and has added persistence characteristics. It is an ideal device for high-load databases and other application scenarios.
  • DRAM Dynamic Random Access Memory
  • service cloudification is also a general trend.
  • a cloud environment basic hardware is shared among multiple services in the form of virtualization.
  • thin provisioning technology is usually adopted, that is, when data is actually written to a virtual device, storage space is allocated from the physical device, and the physical storage space is reclaimed after the data is deleted. Due to the large physical storage capacity of traditional storage devices such as disks, thin provisioning technology can achieve better dynamic allocation effects, and can achieve over-allocation, that is, the sum of virtual storage capacity of all users is greater than the physical storage capacity.
  • This application provides a persistent memory virtualization method and system, which can realize the virtualization of large-capacity PM.
  • this application provides a method for virtualizing persistent memory, including: allocating storage space for virtual persistent memory of a virtual machine based on physical persistent memory, nonvolatile memory, and volatile memory;
  • the non-volatile memory is used to provide extended storage space for the physical persistent memory
  • the volatile memory is used to provide data cache space for the physical persistent memory and the non-volatile memory.
  • this application provides a persistent memory virtualization system, including: a physical host, a physical persistent memory, a non-volatile memory, and a volatile memory; a virtual machine monitor is running on the physical host, The virtual machine monitor creates and runs a virtual machine on the physical host; wherein, the virtual machine monitor is based on the physical persistent memory, the non-volatile memory, and the volatile memory to provide The virtual persistent memory of the virtual machine allocates storage space; wherein, the non-volatile memory is used to provide extended storage space for the physical persistent memory, and the volatile memory is used to provide the physical persistent memory with The memory and the non-volatile memory provide data cache space.
  • the present application provides a computer-readable storage medium that stores a computer program that, when executed, realizes the steps of the virtualization method described above.
  • FIG. 1 is an example diagram of a persistent memory virtualization system provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of the structure of a metadata mapping table in an embodiment of the application
  • FIG. 3 is an exemplary diagram of a method for virtualizing persistent memory provided by an embodiment of the application
  • FIG. 4 is an example flowchart of a first read and write operation of a virtual persistent memory according to an embodiment of the application
  • FIG. 5 is an example diagram of a write operation flow of a virtual persistent memory according to an embodiment of the application
  • FIG. 6 is an example diagram of a read operation flow of a virtual persistent memory in an embodiment of the application.
  • FIG. 7 is an example diagram of a process of reclaiming physical storage space mapped by a virtual persistent memory according to an embodiment of the application.
  • the embodiments of the present application provide a method and system for virtualizing persistent memory (PM).
  • PM persistent memory
  • NVM non-volatile memory
  • Virtualization makes the storage capacity of virtual PM no longer restricted by the capacity of physical PM, and can maintain a performance index higher than or close to that of physical PM, which better meets the needs of multi-tenant scenarios in the cloud environment.
  • the embodiment of the application provides a persistent memory virtualization system, including: a physical host, a physical PM, a non-volatile memory, and a volatile memory; a virtual machine monitor (VMM) runs on the physical host , The virtual machine monitor creates and runs a virtual machine (Virtual Machine, VM) on the physical host; among them, the virtual machine monitor allocates storage to the virtual PM of the virtual machine based on physical PM, non-volatile memory and volatile memory Space: Among them, non-volatile memory is used to provide extended storage space for the physical PM, and volatile memory is used to provide data cache space for the physical PM and non-volatile memory.
  • VMM virtual machine monitor
  • the volatile memory may include a dynamic random access memory (DRAM), and the non-volatile memory may include a solid state drive (SSD).
  • DRAM dynamic random access memory
  • SSD solid state drive
  • this application is not limited to this. In other implementations, other volatile memory and non-volatile memory can be used; it should be noted that the performance of the selected volatile memory should be higher than that of the physical PM.
  • Fig. 1 is an example diagram of a persistent memory virtualization system provided by an embodiment of the application.
  • DRAM is used as an example for volatile memory
  • SSD is used as an example for non-volatile memory.
  • a virtual machine monitor also called a hypervisor
  • the virtual machine monitor can provide a virtual operating platform for the virtual machine based on the hardware resources of the physical host and manage the operation of the virtual machine. Different virtual machines run independently and share all the hardware resources of the physical host.
  • the virtual machine monitor (Hypervisor) dynamically allocates the corresponding storage space on the physical PM, and then maps the read and write requests to the physical PM.
  • the virtual machine monitor allocates storage space based only on the physical PM, the allocation fails when the storage capacity of the physical PM is exhausted. Based on the current small storage capacity of the physical PM, the above allocation failure is more likely to occur, and it is difficult to meet the multi-tenant public needs of the cloud environment.
  • the virtual machine monitor provides virtualization capabilities, and can map the virtual PM in the virtual machine to the physical PM, SSD, and DRAM.
  • the SSD as a non-volatile memory, can be used as a supplement to the storage capacity of the physical PM and used to provide the physical PM with expanded storage space.
  • the storage capacity of the physical PM is insufficient, the recently unused data stored in the physical PM can be automatically migrated to the SSD, thereby effectively expanding the capacity of the physical PM and maintaining the non-volatile characteristics of the data.
  • the virtual machine monitor when virtual machine 2 needs to allocate storage areas, the virtual machine monitor first maps in the physical PM, and the virtual machine monitor can monitor the available storage capacity of the physical PM and the storage space stored therein.
  • Data access features for example, access features can include access times, time interval, read/write ratio, input and output continuity, etc.
  • move infrequently used data to SSD according to demand so as to expand the storage capacity of physical PM purpose. Since the SSD is a non-volatile memory, the aforementioned data migration operation will not affect the non-volatile characteristics of the virtual PM.
  • DRAM as a volatile memory, can be used as a cache for physical PMs and SSDs to provide data cache space for physical PMs and SSDs, thereby improving performance.
  • the physical PM can include storage media such as PCM (Phase-Change Memory), ReRAM (Resistive Random-Access Memory, Resistive Random-Access Memory, or RRAM for short), etc.
  • PCM Phase-Change Memory
  • ReRAM Resistive Random-Access Memory
  • RRAM Resistive Random-Access Memory
  • the read and write performance of some physical PMs is still the same as There is a big gap in DRAM. Therefore, by buffering data in DRAM, a higher read performance than physical PM can be achieved.
  • hotspot data stored in physical PM can be cached on DRAM, thereby providing higher read performance than physical PM; for data stored in SSD, it can also be cached on demand
  • DRAM in order to make up the performance gap between physical PM and SSD, the combined use of DRAM and SSD can effectively reduce the performance jitter caused by insufficient remaining storage space of physical PM.
  • the identification of hotspot data can be based on the access characteristics of the data. For example, algorithms such as LRU (Least Recently Used), LFU (Least Frequently Used), or a combination thereof are used to analyze access characteristics to identify hot data.
  • DRAM may also be used for caching the metadata mapping table of the virtual PM.
  • the virtual machine monitor In order to realize the dynamic allocation of physical storage area, the virtual machine monitor (Hypervisor) needs to maintain a virtual address to physical address mapping table (ie metadata mapping table), when the virtual machine accesses the virtual PM, the virtual machine monitor can Find the actual physical storage location according to the metadata mapping table, and then perform the corresponding read and write operations.
  • a virtual address to physical address mapping table ie metadata mapping table
  • the metadata mapping table in addition to caching the metadata mapping table in DRAM, the metadata mapping table also needs to be stored in the physical PM for persistence, so that after the virtual machine monitor (Hypervisor) restarts, the virtual PM Restore to the previous state.
  • the metadata mapping table can be completely saved in DRAM, and only when the metadata mapping table is updated, the modification can be synchronized to the copy of the metadata mapping table in the physical PM in real time. In this way, the access delay of the virtual PM can be effectively shortened.
  • the virtual machine monitor can look up the real storage location from the metadata mapping table according to the virtual address (Virtual Address) in the read and write request of the virtual machine, that is, the volatile storage address and the persistent memory address.
  • Non-volatile storage address for example, SSD address.
  • FIG. 2 is a schematic diagram of a structure of a metadata mapping table in an embodiment of the application. As shown in Figure 2, each entry in the metadata mapping table contains four key pieces of information, namely, a virtual address (Virtual Address) and its mapped physical address. Among them, the physical address may include: a volatile storage address, a persistent memory address, and a non-volatile storage address.
  • the above three physical addresses mapped by any virtual address are not always valid.
  • the persistent memory address or the non-volatile memory address mapped by any virtual address is valid, so that the durability of the data can be guaranteed.
  • the volatile storage address mapped by the virtual address for storing the hotspot data may also be valid, thereby supporting accelerated access.
  • the virtual machine monitor always writes data to the physical PM.
  • the persistent memory address mapped by the virtual address is invalid, first allocate storage space from the physical PM to the virtual PM, and then perform the write operation.
  • the volatile storage address or the nonvolatile storage address mapped by the virtual address is valid, the volatile storage address and the nonvolatile storage address mapped by the virtual address are marked as invalid to release the corresponding storage space.
  • the virtual machine monitor can sequentially search the first virtual address mapping in the metadata mapping table in the order of volatile storage address, persistent memory address, and solid state disk address. A valid physical address, after finding the first valid physical address, perform the actual read operation.
  • FIG. 3 is a flowchart of an example of a method for virtualizing a persistent memory provided by an embodiment of the application. As shown in Figure 3, the virtualization method provided in this embodiment includes:
  • non-volatile memory and volatile memory allocate storage space to the virtual PM of the virtual machine; among them, the non-volatile memory is used to provide extended storage space for the physical PM, and the volatile memory is used for Provide data cache space for physical PM and non-volatile memory.
  • the volatile memory may include DRAM, and the non-volatile memory may include SSD.
  • this application is not limited to this. In other implementations, other volatile memories and non-volatile memories can also be used. It should be noted that the performance of the selected volatile memory should be higher than the physical PM.
  • allocating storage space to the virtual PM of the virtual machine may include: allocating storage space of the non-volatile memory to the virtual PM;
  • the method of this embodiment may further include: when the available storage capacity of the physical PM mapped by the virtual PM meets the first condition, moving the data stored in the physical PM and whose access characteristics meet the second condition to the virtual PM in non-volatile The storage space mapped on the storage.
  • the first condition may include: the available storage capacity of the physical PM is less than or equal to the capacity threshold.
  • the second condition may include: the frequency of access within the set time interval is less than or equal to the first threshold.
  • this application is not limited to this. The first condition and the second condition can be adjusted according to actual needs.
  • allocating storage space to the virtual PM of the virtual machine may include: allocating storage space of the volatile memory to the virtual PM;
  • the method of this embodiment may further include: identifying data whose access characteristics meet the third condition from the data stored in the physical PM or non-volatile memory mapped by the virtual PM, and identifying the data whose access characteristics meet the third condition , Cache to the storage space mapped by the virtual PM on the volatile memory.
  • the third condition may include: the frequency of access within the set time interval is greater than or equal to the second threshold.
  • this application is not limited to this.
  • the third condition can be adjusted according to actual needs.
  • the method of this embodiment may further include:
  • the metadata mapping table may be cached in the storage space mapped by the virtual PM on the volatile memory; a copy of the metadata mapping table may be stored in the storage space mapped by the virtual PM on the physical PM.
  • the method of this embodiment further includes at least one of the following:
  • the virtual address accessed by the read request of the virtual machine in the order of volatile storage address, persistent memory address and non-volatile storage address, look up the first valid physical address mapped by the virtual address in the metadata mapping table, from Read data from the first valid physical address mapped by the virtual address found;
  • the metadata mapping table determines whether the persistent memory address mapped by the virtual address is valid; when the persistent memory address mapped by the virtual address in the metadata mapping table is valid, write to Data is written to the effective persistent memory address mapped by the virtual address; when the persistent memory address mapped by the virtual address in the metadata mapping table is invalid, the storage space of the physical PM is allocated and the virtual address mapped in the metadata mapping table is updated A valid persistent memory address, which writes the data to be written into the persistent memory address mapped by the virtual address after the update.
  • the method of this embodiment may further include: reclaiming and reallocating the storage space of the physical storage medium according to the available storage capacity of the physical storage medium mapped by the virtual PM and the access characteristics of the data; wherein,
  • the physical storage medium includes at least one of the following: physical PM, non-volatile memory, and volatile memory.
  • the recovery strategy of the storage space of the physical storage medium can be set according to actual needs. This application is not limited to this. For example, when the storage space of the physical PM is insufficient, the storage space reclamation operation can be performed to move the data that is not commonly used on the physical PM to the non-volatile memory; for example, for the data in the volatile memory (such as DRAM), Algorithms such as LRU can be used for elimination.
  • the data stored in the volatile memory can be directly discarded when the storage space of the volatile memory is reclaimed. For example, it can be periodically Delete the infrequently used data in the DRAM to reclaim the storage space of the DRAM.
  • the metadata mapping table saves the mapping relationship between the virtual address and the physical address.
  • the metadata mapping table needs to be stored persistently in order to restore the virtual machine after the physical host restarts.
  • the metadata mapping table is in the data It will be frequently queried during read and write operations.
  • both DRAM and physical PM are used to store the metadata mapping table, and the following rules are followed: the metadata mapping table is stored in DRAM, and a copy of it is stored in the physical PM at the same time to ensure durability ;
  • the metadata mapping table is directly read from DRAM without accessing the physical PM;
  • the write operation of the metadata mapping table first write to DRAM, and then apply the same modification in the physical PM;
  • the machine monitor Hypervisor
  • FIG. 4 is an example flowchart of a first read and write operation of a virtual PM according to an embodiment of the application. As shown in Figure 4, after receiving the virtual machine's first access request to the data in the virtual PM, the virtual machine monitor can perform the following processing:
  • S403 Perform actual data read and write operations according to the persistent memory address in the mapping entry.
  • the data may be in physical PM, non-volatile memory (for example, SSD), and volatile memory. Copying or migrating between memories (for example, DRAM), and affect the corresponding read and write behavior.
  • FIG. 5 is an example diagram of a write operation flow of a virtual PM according to an embodiment of the application. This exemplary embodiment describes the execution flow of the data writing operation based on the existing mapping entries in the metadata mapping table of the virtual PM. As shown in Figure 5, the execution process of the virtual machine monitor includes:
  • S503 Allocate physical PM storage space to the virtual address, and update the persistent memory address mapped by the virtual address.
  • S504 Write data into the storage space corresponding to the effective persistent memory address mapped by the virtual address.
  • Update the data access characteristics for example, update the total number of accesses corresponding to the data.
  • FIG. 6 is an example diagram of a read operation flow of a virtual PM according to an embodiment of the application. This exemplary embodiment explains the execution flow of the data read operation based on the existing mapping entries in the metadata mapping table of the virtual PM. As shown in Figure 6, the execution process of the virtual machine monitor includes:
  • S602. Determine the validity of the volatile storage address in the mapping entry according to the found mapping entry; if the volatile storage address is valid, execute S603; if the volatile storage address is invalid, jump to S604.
  • S604 Determine the validity of the persistent memory address in the mapping entry; if the persistent memory address is valid, execute S605; if the persistent memory address is invalid, jump to S606.
  • Update the data access characteristics for example, update the total access times and read times corresponding to the data.
  • S608 Determine whether the data is hot data according to the access characteristics; if the read data is hot data and the volatile storage address in the mapping entry is invalid, execute S609; if the read data is not hot data, or the mapping entry If the volatile memory address in is valid, jump to S610.
  • the read operation is always searched in the order of volatile memory (for example, DRAM), physical PM, and non-volatile memory (for example, SSD), and corresponds to the first valid physical address
  • volatile memory for example, DRAM
  • physical PM physical PM
  • non-volatile memory for example, SSD
  • the identification of hotspot data can be determined based on the access characteristics of the data; for example, using LRU, LFU algorithm or a combination thereof, etc., based on the number of accesses, time interval, read/write ratio, input and output (IO) continuity and other characteristics for analysis , To identify hot data.
  • FIG. 7 is an example diagram of a process of reclaiming physical storage space mapped by a virtual PM according to an embodiment of the application.
  • This exemplary embodiment illustrates that when the free storage space of the physical PM or volatile memory (such as DRAM) is insufficient, the reclaiming operation of the storage space is performed, for example, the data on the physical PM or volatile memory is migrated to the non-volatile memory.
  • Lost storage for example, SSD
  • data can be classified into the following three categories according to its access characteristics: non-hotspot data, read-intensive hotspot data, and write-intensive hotspot data.
  • non-hotspot data For different data types, the recovery strategy of physical storage space will be different.
  • the recycling process includes: traversing the mapping entries in the metadata mapping table one by one to determine whether storage space recycling can be performed.
  • the following is an example of reclaiming the storage space of a physical PM.
  • the execution process of the virtual machine monitor includes:
  • mapping entry For a mapping entry, determine the validity of the persistent memory address in the mapping entry; if the persistent memory address is valid, execute S702; if the persistent memory address is invalid, ignore the mapping entry and jump to S707.
  • S702. Determine whether the data in the storage space corresponding to the persistent memory address is non-hot data; if it is non-hot data, skip to S705 to perform the recovery operation; if it is not non-hot data, perform S703.
  • S703. Determine whether the data in the storage space corresponding to the persistent memory address is read-intensive hotspot data; if it is read-intensive hotspot data, skip to S705 to perform the recovery operation; if it is not read-intensive hotspot data, perform S704 .
  • S704 Determine whether the data in the storage space corresponding to the persistent memory address is write-intensive hotspot data; if it is write-intensive hotspot data, ignore the mapping entry and jump to S707.
  • this step it is also possible to select whether to copy data to the volatile memory at the same time according to the idle condition of the volatile memory and the data access characteristics, so as to reduce the probability of subsequent loading of data from the non-volatile memory.
  • this application is not limited to this.
  • the mapping entries in the metadata mapping table may be pre-sorted according to the expected recycling strategy; or, they may be split into multiple sub-tables according to different data access characteristics.
  • this application is not limited to this.
  • the traversal operation can be terminated according to set conditions, for example, sufficient free storage space is recovered, or the execution is terminated after a set duration is exceeded, without the need to complete the entire traversal process.
  • S702 and S703 can be changed to only enable execution of one of the steps, or a combination strategy such as adjusting the execution order and executing at different frequencies to achieve priority recovery of set types of data.
  • volatile memory for example, DRAM
  • non-volatile memory for example, SSD
  • the embodiments of the present application can provide a virtual PM capacity whose storage capacity is the sum of the storage capacity of a physical PM and a non-volatile memory (for example, SSD), instead of the virtualized capacity equivalent to the physical PM, so that a lower The hardware cost meets or exceeds the performance of the physical PM.
  • the embodiment of the present application also provides a computer-readable storage medium storing a computer program, which implements the steps of the above-mentioned method when the computer program is executed, for example, the steps shown in FIG. 3.
  • Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
  • the term computer storage medium includes volatile and non-volatile data implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media.
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Any other medium used to store desired information and that can be accessed by a computer.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .

Landscapes

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

Abstract

一种持久性内存的虚拟化方法,包括:基于物理持久性内存、非易失性存储器和易失性存储器,给虚拟机的虚拟持久性内存分配存储空间;其中,非易失性存储器用于给物理持久性内存提供扩展存储空间,易失性存储器用于给物理持久性内存和非易失性存储器提供数据缓存空间。

Description

一种持久性内存的虚拟化方法及系统
相关申请的交叉引用
本申请基于申请号为201910852757.6、申请日为2019年9月10日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本申请实施例涉及但不限于存储虚拟化技术领域,尤指一种持久性内存(Persistent Memory,PM)的虚拟化方法及系统。
背景技术
随着非易失存储介质的技术发展,持久性内存日渐成熟,进入实际商用阶段。持久性内存具备与动态随机存储器(Dynamic Random Access Memory,DRAM)接近的性能,并增加了持久化特性,是高负载数据库等应用场景的理想器件。
与此同时,服务云化也是大势所趋,通过将服务部署在云环境上,可以达到更好的灵活性。在云环境中,基础硬件以虚拟化的形式在多个服务间共享。对于存储器件,通常采用精简配置(Thin Provisioning)技术,即在实际写入数据到虚拟设备时,从物理设备中分配存储空间,并在数据删除后,回收物理存储空间。由于磁盘等传统存储设备的物理存储容量较大,采用精简配置技术可以达到较好的动态分配效果,能够实现超额分配,即所有用户的虚拟存储容量之和大于物理存储容量。通过有效地在多个虚拟设备间调度空闲存储资源,在满足用户峰值存储需求的同时,可以避免空间浪费。
然而,目前单一PM器件的容量相对较小,而且价格昂贵,系统内存插槽数量也存在限制,均制约了单机PM数量的扩充,导致在云环境中PM虚拟化效果不佳。上述情况下,由于可动态调配的物理存储资源有限,容易出现性能抖动、物理存储耗尽等问题,而且采用精简配置技术的效果较差。
发明内容
本申请提供了一种持久性内存的虚拟化方法及系统,可以实现大容量PM的虚拟化。
一方面,本申请提供一种持久性内存的虚拟化方法,包括:基于物理持久性内存、非易失性存储器和易失性存储器,给虚拟机的虚拟持久性内存分配存储空间;其中,所述非易失性存储器用于给所述物理持久性内存提供扩展存储空间,所述易失性存储器用于给所述物理持久性内存和所述非易失性存储器提供数据缓存空间。
另一方面,本申请提供一种持久性内存的虚拟化系统,包括:物理主机、物理持久性内存、非易失性存储器以及易失性存储器;所述物理主机上运行有虚拟机监视器,所述虚拟机监视器在所述物理主机上创建和运行虚拟机;其中,所述虚拟机监视器基于所述物理 持久性内存、所述非易失性存储器和所述易失性存储器,给所述虚拟机的虚拟持久性内存分配存储空间;其中,所述非易失性存储器用于给所述物理持久性内存提供扩展存储空间,所述易失性存储器用于给所述物理持久性内存和所述非易失性存储器提供数据缓存空间。
另一方面,本申请提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被执行时实现如上所述的虚拟化方法的步骤。
本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。
附图说明
附图用来提供对本申请技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。
图1为本申请实施例提供的持久性内存的虚拟化系统的一种示例图;
图2为本申请实施例中的元数据映射表的结构示意图;
图3为本申请实施例提供的一种持久性内存的虚拟化方法的示例图;
图4为本申请实施例的虚拟持久性内存的首次读写操作的流程示例图;
图5为本申请实施例的虚拟持久性内存的写操作流程示例图;
图6为本申请实施例的虚拟持久性内存的读操作流程示例图;
图7为本申请实施例的虚拟持久性内存映射的物理存储空间的回收流程示例图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚明白,下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例提供一种持久性内存(PM)的虚拟化方法及系统,通过混合使用物理PM、非易失性存储器(Non-Volatile Memory,NVM)和易失性存储器,完成大容量PM的虚拟化,使得虚拟PM的存储容量不再受到物理PM的容量制约,并可以保持高于或接近物理PM的性能指标,较好地满足云环境下多租户场景的需求。
本申请实施例提供一种持久性内存的虚拟化系统,包括:物理主机、物理PM、非易失性存储器和易失性存储器;物理主机上运行有虚拟机监视器(Virtual Machine Monitor,VMM),虚拟机监视器在物理主机上创建和运行虚拟机(Virtual Machine,VM);其中,虚拟机监视器基于物理PM、非易失性存储器和易失性存储器,给虚拟机的虚拟PM分配存储空间;其中,非易失性存储器用于给物理PM提供扩展存储空间,易失性存储器用于 给物理PM和非易失性存储器提供数据缓存空间。
在一示例性实施方式中,易失性存储器可以包括动态随机存储器(DRAM),非易失性存储器可以包括固态硬盘(Solid State Driver,SSD)。然而,本申请对此并不限定。在其他实现方式中,可以采用其他的易失性存储器和非易失性存储器;需要注意的是,选用的易失性存储器的性能应当高于物理PM。
图1为本申请实施例提供的持久性内存的虚拟化系统的一种示例图。在本示例性实施例中,易失性存储器以DRAM为例,非易失性存储器以SSD为例进行说明。其中,虚拟机监视器(又称为Hypervisor),是运行在物理主机和虚拟机(比如,虚拟机1、虚拟机2等)之间的一个软件层。虚拟机监视器可以基于物理主机的硬件资源给虚拟机提供一个虚拟的操作平台并管理虚拟机的运行,不同的虚拟机独立运行并共享物理主机的所有硬件资源。
如图1所示,当虚拟机1首次访问虚拟PM内某一存储区域时,由虚拟机监视器(Hypervisor)在物理PM上动态分配对应的存储空间,然后将读写请求映射到物理PM。当虚拟机监视器仅基于物理PM分配存储空间,则在物理PM的存储容量耗尽时,分配失败。基于目前物理PM的存储容量较小的情况,上述分配失败的情况较容易发生,难以满足云环境多租户公用的需求。
在本示例性实施例中,如图1所示,虚拟机监视器提供虚拟化能力,可以将虚拟机中的虚拟PM映射到物理PM、SSD以及DRAM。
在本示例性实施例中,SSD作为非易失性存储器,可以用作物理PM的存储容量补充,用于给物理PM提供扩展存储空间。比如,当物理PM的存储容量不足时,可以将物理PM中存储的最近未使用的数据,自动迁移到SSD上,从而有效扩充物理PM的容量,并保持数据的非易失特性。
在一示例中,如图1所示,当虚拟机2需要分配存储区域时,虚拟机监视器首先在物理PM中进行映射,并且虚拟机监视器可以监控物理PM的可用存储容量和其中存储的数据的访问特征(比如,访问特征可以包括访问次数、时间间隔、读写比例、输入输出连续性等),根据需求将不常使用的数据移动到SSD中,以达到扩展物理PM的存储容量的目的。由于SSD为非易失性存储器,上述数据迁移操作不会影响虚拟PM的非易失特性。
在本示例性实施例中,DRAM作为易失性存储器,可以用作物理PM以及SSD的高速缓存,用于给物理PM和SSD提供数据缓存空间,从而提升性能。其中,物理PM可以包括PCM(Phase-Change Memory,相变存储器)、ReRAM(Resistive Random-Access Memory,电阻式随机存储器,亦可简称为RRAM)等存储介质,部分物理PM的读写性能仍与DRAM存在较大差距。因此,通过将数据缓存到DRAM中,可以实现高于物理PM的读取性能。另外,对于读多写少的数据,可以使用DRAM和SSD的形式进行存储,从而降低数据在物理PM和SSD间换入换出的次数,以缓解性能抖动。
在一示例中,通过热点数据识别,可以将存储在物理PM中的热点数据缓存到DRAM上,从而提供高于物理PM的读取性能;对于存储在SSD中的数据,也可以按需缓存到DRAM上,以弥补物理PM和SSD之间的性能差距,通过DRAM和SSD的组合运用,可以有效减少由于物理PM的剩余存储空间不足而产生的性能抖动。其中,热点数据的识别可以基于数据的访问特征进行。比如,采用LRU(Least Recently Used)、LFU(Least Frequently Used)或其组合等算法,对访问特征进行分析,来识别热点数据。
在本示例性实施例中,除了直接将DRAM用于缓存热点数据之外,还可以将DRAM用于缓存虚拟PM的元数据映射表。其中,为了实现物理存储区域的动态分配,虚拟机监视器(Hypervisor)需要维护一个虚拟地址到物理地址的映射表(即元数据映射表),当虚拟机访问虚拟PM时,虚拟机监视器可以根据元数据映射表查找实际的物理存储位置,然后执行相应的读写操作。
在本示例性实施例中,除了在DRAM中缓存元数据映射表之外,元数据映射表还需要保存在物理PM中进行持久化,以便在虚拟机监视器(Hypervisor)重启后,将虚拟PM恢复到之前的状态。出于性能优化的目的,可以在DRAM中完整保存元数据映射表,仅在更新元数据映射表时,实时将修改同步到物理PM中的元数据映射表的副本即可。如此一来,可以有效缩短虚拟PM的访问延迟。
在一示例性实施例中,虚拟机监视器可以根据虚拟机的读写请求中的虚拟地址(Virtual Address),从元数据映射表中查找真实的存储位置,即易失存储地址、持久内存地址、非易失存储地址(比如,固态硬盘地址)。图2为本申请实施例中的元数据映射表的一种结构示意图。如图2所示,元数据映射表的每个条目中包含四个关键信息,即虚拟地址(Virtual Address)以及其映射的物理地址。其中,物理地址可以包括:易失存储地址、持久内存地址以及非易失存储地址。
其中,根据数据的访问特征的不同,任一虚拟地址映射的上述三个物理地址不总是有效的。在任何情况下,任一虚拟地址映射的持久内存地址或非易失存储地址是有效的,从而可以保证数据的持久性。在一些示例中,存储热点数据的虚拟地址映射的易失存储地址也可以是有效的,从而支持加速访问。
在一示例中,对于虚拟机的虚拟PM的写操作,虚拟机监视器总是将数据写入物理PM。其中,当虚拟地址映射的持久内存地址无效,则先从物理PM给虚拟PM分配存储空间,然后执行写操作。此时,若虚拟地址映射的易失存储地址或非易失存储地址有效,则将该虚拟地址映射的易失存储地址和非易失存储地址标记为失效,以释放对应的存储空间。
在一示例中,对于虚拟机的虚拟PM的读操作,虚拟机监视器可以按照易失存储地址、持久内存地址、固态硬盘地址的顺序,在元数据映射表内依次查找虚拟地址映射的第一个有效的物理地址,在查找到第一个有效的物理地址后,执行实际的读取操作。
图3为本申请实施例提供的持久性内存的虚拟化方法的流程示例图。如图3所示,本 实施例提供的虚拟化方法包括:
S301、基于物理PM、非易失性存储器和易失性存储器,给虚拟机的虚拟PM分配存储空间;其中,非易失性存储器用于给物理PM提供扩展存储空间,易失性存储器用于给物理PM和非易失性存储器提供数据缓存空间。
在一示例性实施方式中,易失性存储器可以包括DRAM,非易失性存储器可以包括SSD。然而,本申请对此并不限定。在其他实现方式中,还可以采用其他的易失性存储器和非易失性存储器。需要注意的是,选用的易失性存储器的性能应当高于物理PM。
在一示例性实施方式中,给虚拟机的虚拟PM分配存储空间,可以包括:给虚拟PM分配非易失性存储器的存储空间;
本实施例的方法还可以包括:当虚拟PM映射的物理PM的可用存储容量满足第一条件,则将存储在物理PM且访问特征满足第二条件的数据,移动至虚拟PM在非易失性存储器上映射的存储空间。
在一些示例中,第一条件可以包括:物理PM的可用存储容量小于或等于容量阈值。第二条件可以包括:设定时间间隔内的访问频次小于或等于第一阈值。然而,本申请对此并不限定。关于第一条件和第二条件可以根据实际需求进行调整。
在一示例性实施方式中,给虚拟机的虚拟PM分配存储空间,可以包括:给虚拟PM分配易失性存储器的存储空间;
本实施例的方法还可以包括:从存储在虚拟PM映射的物理PM或非易失性存储器内的数据中,识别出访问特征满足第三条件的数据,并将访问特征满足第三条件的数据,缓存至虚拟PM在易失性存储器上映射的存储空间。
在一些示例中,第三条件可以包括:设定时间间隔内的访问频次大于或等于第二阈值。然而,本申请对此并不限定。关于第三条件可以根据实际需求进行调整。
在一示例性实施方式中,在S301之后,本实施例的方法还可以包括:
S302、在元数据映射表记录或更新虚拟PM的虚拟地址及其映射的物理地址,其中,物理地址包括:易失存储地址、非易失存储地址、持久内存地址。在一示例性实施方式中,元数据映射表可以缓存在虚拟PM在易失性存储器上映射的存储空间;元数据映射表的副本可以存储在虚拟PM在物理PM上映射的存储空间。
在一示例性实施方式中,本实施例的方法还包括以下至少之一:
根据虚拟机的读请求访问的虚拟地址,按照易失存储地址、持久内存地址和非易失存储地址的顺序,在元数据映射表内查找该虚拟地址映射的第一个有效的物理地址,从查找到的该虚拟地址映射的第一个有效的物理地址读取数据;
根据虚拟机的写请求访问的虚拟地址,在元数据映射表内查找该虚拟地址映射的持久内存地址是否有效;当元数据映射表内该虚拟地址映射的持久内存地址有效,则将待写入数据写入该虚拟地址映射的有效的持久内存地址;当元数据映射表内该虚拟地址映射的持 久内存地址无效,则分配物理PM的存储空间,并更新元数据映射表内该虚拟地址映射的有效的持久内存地址,将待写入数据写入更新后该虚拟地址映射的持久内存地址。
在一示例性实施方式中,本实施例的方法还可以包括:根据虚拟PM映射的物理存储介质的可用存储容量以及数据的访问特征,对物理存储介质的存储空间进行回收和再分配;其中,物理存储介质包括以下至少之一:物理PM、非易失性存储器、易失性存储器。其中,物理存储介质的存储空间的回收策略可以根据实际需求进行设定。本申请对此并不限定。比如,当物理PM的存储空间不足时,可以执行存储空间回收操作,将物理PM上不常用的数据移动至非易失性存储器;比如,对于易失性存储器(比如,DRAM)中的数据,可以使用LRU等算法进行淘汰,由于数据总是在物理PM或非易失性存储器中保存副本,因此,在回收易失性存储器的存储空间时可以直接丢弃其中存储的数据,例如,可以周期性对DRAM内不常用的数据进行删除,以回收DRAM的存储空间。
下面以元数据映射表的管理,数据写入、读取以及缓存数据管理等场景为例对本申请实施例的虚拟化方法进行举例说明。
在一示例性实施例中,元数据映射表保存虚拟地址和物理地址之间的映射关系,元数据映射表需要持久保存,以便在物理主机重启后恢复虚拟机,而且,元数据映射表在数据读写操作时会被频繁查询。
基于此,在本示例性实施例中,同时使用DRAM和物理PM存储元数据映射表,并遵循如下规则:元数据映射表存储在DRAM中,同时在物理PM中存储其副本,以保证持久性;针对元数据映射表的读操作,直接从DRAM中读取元数据,无须访问物理PM;针对元数据映射表的写操作,首先写入DRAM,然后在物理PM中应用相同的修改;在虚拟机监视器(Hypervisor)重启时,从物理PM加载全部数据条目到DRAM中,完成启动过程。
需要说明的是,关于元数据映射表在DRAM和物理PM中存储空间的预分配、写操作的一致性等问题,可以采用本领域技术人员常用方式,故于此不再赘述。
在一示例性实施例中,对于虚拟PM中数据的首次访问(读或写)操作,虚拟机监视器首先需要分配物理存储空间,并修改元数据映射表。图4为本申请实施例的虚拟PM的首次读写操作的流程示例图。如图4所示,虚拟机监视器在接收到虚拟机对虚拟PM中数据的首次访问请求后,可以执行以下处理:
S401、从物理PM分配存储空间,并根据虚拟地址(Virtual Address)、持久内存地址创建映射条目;其中,虚拟地址映射的易失存储地址和非易失存储地址设置为无效值,即不分配对应存储空间。
S402、将创建的映射条目加入元数据映射表;
S403、根据映射条目中的持久内存地址执行实际数据读写操作。
需要说明的是,对于新创建的数据条目,总是通过持久内存地址进行读写,后续根据对访问特征的统计,数据可能在物理PM、非易失性存储器(比如,SSD)、易失性存储器 (比如,DRAM)之间拷贝或迁移,并影响相应的读写行为。
图5为本申请实施例的虚拟PM的写操作流程的示例图。本示例性实施例说明基于虚拟PM的元数据映射表中已存在的映射条目进行数据写操作的执行流程。如图5所示,虚拟机监视器的执行流程包括:
S501、访问元数据映射表,获取写操作请求对应的虚拟地址的映射条目。
S502、根据查找到的映射条目,判断该映射条目中的持久内存地址的有效性;若持久内存地址有效,则转入S504;若持久内存地址无效,则执行S503。
S503、给该虚拟地址分配物理PM的存储空间,并更新该虚拟地址映射的持久内存地址。
S504、将数据写入该虚拟地址映射的有效的持久内存地址对应的存储空间。
S505、若该虚拟地址映射的易失存储地址、非易失存储地址有效,则清除该虚拟地址映射的易失存储地址和非易失存储地址,释放对应的存储空间。
S506、更新数据访问特征,比如,更新该数据对应的总访问次数。
需要说明的是,写操作总是在物理PM中执行,以保证性能和数据持久性。
图6为本申请实施例的虚拟PM的读操作流程的示例图。本示例性实施例说明基于虚拟PM的元数据映射表中已存在的映射条目进行数据读操作的执行流程。如图6所示,虚拟机监视器的执行流程包括:
S601、访问元数据映射表,获取读操作请求对应的虚拟地址的映射条目。
S602、根据查找到的映射条目,判断该映射条目中的易失存储地址的有效性;若易失存储地址有效,则执行S603;若易失存储地址无效,则跳转到S604。
S603、从易失存储地址对应的存储空间读取数据,并跳转到S607。
S604、判断该映射条目中的持久内存地址的有效性;若持久内存地址有效,则执行S605;若持久内存地址无效,则跳转到S606。
S605、从持久内存地址对应的存储空间中读取数据,并跳转到S607。
S606、从该映射条目中的非易失存储地址对应的存储空间读取数据。
S607、更新数据访问特征;比如,更新该数据对应的总访问次数和读次数。
S608、根据访问特征判断该数据是否为热点数据;若读取的数据为热点数据且该映射条目中的易失存储地址无效,则执行S609;若读取的数据不是热点数据,或者该映射条目中的易失存储地址有效,则跳转到S610。
S609、给该虚拟地址分配易失存储地址,并将数据拷贝到易失性存储器(比如,DRAM)中,作为后续访问的读缓存。
S610、向虚拟机返回读取到的数据,流程结束。
在本示例性实施例中,读操作总是按易失性存储器(比如,DRAM)、物理PM、非易失性存储器(比如,SSD)的顺序查找,并从第一个有效的物理地址对应的存储空间读取 数据。在数据读取完成后,根据该数据的访问特征确认是否需要将该数据作为热点数据加载到易失性存储器中。
其中,对于热点数据的识别,可以基于数据的访问特征确定;例如,采用LRU、LFU算法或其组合等,基于访问次数、时间间隔、读写比例、输入输出(IO)连续性等特征进行分析,识别热点数据。
图7为本申请实施例的虚拟PM映射的物理存储空间的回收流程示例图。本示例性实施例说明当物理PM或易失性存储器(比如,DRAM)的空闲存储空间不足时,执行存储空间的回收操作,比如,将物理PM或易失性存储器上的数据迁移到非易失性存储器(比如,SSD)中。
在本示例性实施例中,数据根据其访问特征可分为以下三类:非热点数据、读密集型热点数据、写密集型热点数据。针对不同数据类型,物理存储空间的回收策略会有所不同。
在本示例性实施例中,回收过程包括:逐一遍历元数据映射表中的映射条目,确定是否可进行存储空间回收。下面以回收物理PM的存储空间为例进行说明,如图7所示,虚拟机监视器的执行流程包括:
S701、针对一条映射条目,判断该条映射条目中的持久内存地址的有效性;若持久内存地址有效,则执行S702;若持久内存地址无效,则忽略该映射条目,跳转到S707。
S702、判断持久内存地址对应的存储空间内的数据是否为非热点数据;若为非热点数据,则跳转到S705执行回收操作;若不为非热点数据,则执行S703。
S703、判断持久内存地址对应的存储空间内的数据是否为读密集型热点数据;若为读密集型热点数据,则跳转到S705执行回收操作;若不为读密集型热点数据,则执行S704。
S704、判断持久内存地址对应的存储空间内的数据是否为写密集型热点数据;若为写密集型热点数据,则忽略该映射条目,跳转到S707。
在本示例中,由于写操作总是在物理PM中执行,因此,应当避免淘汰写密集型热点数据。需要说明的是,当无法收集到足够的可用空间时,则必须进行强制收集,以避免后续新的写操作失败。强制收集的回收方式可以参照S705和S706的描述。其中,当热点数据识别算法可能未收集到足够的可回收存储空间信息时,在将数据迁移到非易失性存储器的同时,可以考虑将数据复制到易失性存储器中。
S705、给该映射条目的虚拟地址分配非易失存储地址,并将数据拷贝到非易失性存储器中。
在本步骤中,还可以根据易失性存储器的空闲情况和数据访问特征,选择是否将数据同时拷贝到易失性存储器中,以降低后续从非易失性存储器加载数据的几率。然而,本申请对此并不限定。
S706、删除该映射条目中的虚拟地址映射的持久内存地址(比如,将虚拟地址映射的持久内存地址设置为无效值),回收物理PM存储空间。
S707、继续处理下一个映射条目。
在一些示例中,为了提升遍历效率,元数据映射表中的映射条目可以是按预期回收策略预排序的;或者,可以按数据访问特征的不同,拆分为多个子表。然而,本申请对此并不限定。
在一些示例中,遍历操作可以按设定条件终止,例如回收到足够的空闲存储空间,或执行超过设定时长后即终止,而无需完成整个遍历过程。
在一些示例中,对于S702和S703,可根据实际需要,变更为只启用执行其中一个步骤,或者,调整执行顺序、按不同频度执行等组合策略,实现优先回收设定类型的数据。
上述描述的存储空间的回收策略仅为示例,在实际应用中,可以根据实际需求设定具体的回收策略。本申请对此并不限定。
本申请实施例通过增加易失性存储器(比如,DRAM)、非易失性存储器(比如,SSD)作为辅助器件,完成大容量PM的模拟。在保持虚拟PM持久性特点的前提下,可以增加可用存储容量,满足多客户机共享使用的要求。而且,本申请实施例可以提供存储容量为物理PM和非易失性存储器(比如,SSD)的存储容量之和的虚拟PM容量,而不是等同于物理PM的虚拟化容量,从而以较低的硬件成本,达到或超过物理PM的性能。
此外,本申请实施例还提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被执行时实现如上所述的方法的步骤,比如,图3所示的步骤。
在本申请中,通过混合使用物理持久性内存、非易失性存储器和易失性存储器,进行大容量持久性内存的虚拟化,如此一来,虚拟持久性内存的存储容量不再受物理持久性内存的存储容量制约,可以提供大容量的虚拟持久性内存。本申请实现以较低的硬件成本,突破物理持久性内存的容量制约,提供大容量的虚拟持久性内存,并保持高于或接近物理持久性内存的性能指标,从而较好地满足云环境下多租户场景的需要。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算 机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。

Claims (10)

  1. 一种持久性内存的虚拟化方法,包括:
    基于物理持久性内存、非易失性存储器和易失性存储器,给虚拟机的虚拟持久性内存分配存储空间;其中,所述非易失性存储器用于给所述物理持久性内存提供扩展存储空间,所述易失性存储器用于给所述物理持久性内存和所述非易失性存储器提供数据缓存空间。
  2. 根据权利要求1所述的方法,其中,所述给虚拟机的虚拟持久性内存分配存储空间,包括:给所述虚拟持久性内存分配所述非易失性存储器的存储空间;
    所述方法还包括:当所述虚拟持久性内存映射的物理持久性内存的可用存储容量满足第一条件,则将存储在所述物理持久性内存且访问特征满足第二条件的数据,移动至所述虚拟持久性内存在所述非易失性存储器上映射的存储空间。
  3. 根据权利要求1所述的方法,其中,所述给虚拟机的虚拟持久性内存分配存储空间,包括:给所述虚拟持久性内存分配所述易失性存储器的存储空间;
    所述方法还包括:从存储在所述虚拟持久性内存映射的物理持久性内存或非易失性存储器内的数据中,识别出访问特征满足第三条件的数据,并将所述访问特征满足第三条件的数据,缓存至所述虚拟持久性内存在所述易失性存储器上映射的存储空间。
  4. 根据权利要求1至3中任一项所述的方法,其中,所述给虚拟机的虚拟持久性内存分配存储空间之后,所述方法还包括:在元数据映射表记录或更新所述虚拟持久性内存的虚拟地址及其映射的物理地址,所述物理地址包括:易失存储地址、非易失存储地址、持久内存地址。
  5. 根据权利要求4所述的方法,其中,所述元数据映射表缓存在所述虚拟持久性内存在所述易失性存储器上映射的存储空间;所述元数据映射表的副本存储在所述虚拟持久性内存在所述物理持久性内存上映射的存储空间。
  6. 根据权利要求4所述的方法,其中,所述方法还包括以下至少之一:
    根据所述虚拟机的写请求访问的虚拟地址,在所述元数据映射表内查找所述虚拟地址映射的持久内存地址是否有效;当所述元数据映射表内所述虚拟地址映射的持久内存地址有效,则将待写入数据写入所述虚拟地址映射的有效的持久内存地址;当所述元数据映射表内所述虚拟地址映射的持久内存地址无效,则分配所述物理持久性内存的存储空间,并更新所述元数据映射表内所述虚拟地址映射的有效的持久内存地址,将待写入数据写入更新后所述虚拟地址映射的持久内存地址;
    根据所述虚拟机的读请求访问的虚拟地址,按照易失存储地址、持久内存地址和非易失存储地址的顺序,在所述元数据映射表内查找所述虚拟地址映射的第一个有效的物理地址,从查找到的所述虚拟地址映射的第一个有效的物理地址读取数据。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:根据所述虚拟持久性内存映射的物理存储介质的可用存储容量以及数据的访问特征,对所述物理存储介质的存储空 间进行回收和再分配;其中,所述物理存储介质包括以下至少之一:物理持久性内存、非易失性存储器、易失性存储器。
  8. 根据权利要求1或7所述的方法,其中,所述易失性存储器包括动态随机存储器DRAM,所述非易失性存储器包括固态硬盘SSD。
  9. 一种持久性内存的虚拟化系统,包括:物理主机、物理持久性内存、非易失性存储器以及易失性存储器;其中,所述物理主机上运行有虚拟机监视器,所述虚拟机监视器在所述物理主机上创建和运行虚拟机;
    所述虚拟机监视器基于所述物理持久性内存、所述非易失性存储器和所述易失性存储器,给所述虚拟机的虚拟持久性内存分配存储空间;其中,所述非易失性存储器用于给所述物理持久性内存提供扩展存储空间,所述易失性存储器用于给所述物理持久性内存和所述非易失性存储器提供数据缓存空间。
  10. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被执行时实现如权利要求1至8中任一项所述的虚拟化方法的步骤。
PCT/CN2020/112879 2019-09-10 2020-09-01 一种持久性内存的虚拟化方法及系统 WO2021047425A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP20862292.8A EP3974974A4 (en) 2019-09-10 2020-09-01 VIRTUALIZATION METHOD AND SYSTEM FOR PERSISTENT MEMORY

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910852757.6 2019-09-10
CN201910852757.6A CN110955488A (zh) 2019-09-10 2019-09-10 一种持久性内存的虚拟化方法及系统

Publications (1)

Publication Number Publication Date
WO2021047425A1 true WO2021047425A1 (zh) 2021-03-18

Family

ID=69976263

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/112879 WO2021047425A1 (zh) 2019-09-10 2020-09-01 一种持久性内存的虚拟化方法及系统

Country Status (3)

Country Link
EP (1) EP3974974A4 (zh)
CN (1) CN110955488A (zh)
WO (1) WO2021047425A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955488A (zh) * 2019-09-10 2020-04-03 中兴通讯股份有限公司 一种持久性内存的虚拟化方法及系统
CN112764925A (zh) * 2021-01-18 2021-05-07 苏州浪潮智能科技有限公司 基于虚拟内存的数据存储方法、装置、设备及存储介质
CN113687779B (zh) * 2021-07-29 2024-02-23 济南浪潮数据技术有限公司 数据迁移方法、装置、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110202728A1 (en) * 2010-02-17 2011-08-18 Lsi Corporation Methods and apparatus for managing cache persistence in a storage system using multiple virtual machines
CN107203411A (zh) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 一种基于远程ssd的虚拟机内存扩展方法及系统
US20170371695A1 (en) * 2016-06-27 2017-12-28 Intel Corporation Techniques for Persistent Memory Virtualization
CN110955488A (zh) * 2019-09-10 2020-04-03 中兴通讯股份有限公司 一种持久性内存的虚拟化方法及系统

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130079706A (ko) * 2012-01-03 2013-07-11 삼성전자주식회사 휘발성 메모리를 포함하는 저장 장치의 구동 방법
CN104216837A (zh) * 2013-05-31 2014-12-17 华为技术有限公司 一种内存系统、内存访问请求的处理方法和计算机系统
CN104571955A (zh) * 2014-12-27 2015-04-29 华为技术有限公司 提高存储容量的方法和装置
US20170206033A1 (en) * 2016-01-19 2017-07-20 SK Hynix Inc. Mechanism enabling the use of slow memory to achieve byte addressability and near-dram performance with page remapping scheme
CN107239319B (zh) * 2016-03-29 2021-05-28 阿里巴巴集团控股有限公司 一种虚拟机的数据存储方法和装置
CN106354431A (zh) * 2016-08-26 2017-01-25 浪潮(北京)电子信息产业有限公司 一种数据存储方法及装置
KR20180044635A (ko) * 2016-10-24 2018-05-03 삼성전자주식회사 저장 시스템 및 그것의 동작 방법
CN107193629A (zh) * 2017-04-07 2017-09-22 上海交通大学 基于非易失性内存与Java虚拟机的新型数据管理方法
CN109344090B (zh) * 2018-10-30 2021-01-29 深圳润迅数据通信有限公司 数据中心中kvm虚拟机的虚拟硬盘系统及数据中心

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110202728A1 (en) * 2010-02-17 2011-08-18 Lsi Corporation Methods and apparatus for managing cache persistence in a storage system using multiple virtual machines
US20170371695A1 (en) * 2016-06-27 2017-12-28 Intel Corporation Techniques for Persistent Memory Virtualization
CN107203411A (zh) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 一种基于远程ssd的虚拟机内存扩展方法及系统
CN110955488A (zh) * 2019-09-10 2020-04-03 中兴通讯股份有限公司 一种持久性内存的虚拟化方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3974974A4 *

Also Published As

Publication number Publication date
EP3974974A1 (en) 2022-03-30
CN110955488A (zh) 2020-04-03
EP3974974A4 (en) 2022-07-27

Similar Documents

Publication Publication Date Title
TWI661301B (zh) 記憶體系統及控制非揮發性記憶體之控制方法
US11347655B2 (en) Memory system and method for controlling nonvolatile memory
US10782903B2 (en) Memory system and method for controlling nonvolatile memory
WO2021047425A1 (zh) 一种持久性内存的虚拟化方法及系统
US10339056B2 (en) Systems, methods and apparatus for cache transfers
EP3301584A1 (en) Storage system, storage management device, storage device, hybrid storage device, and storage management method
US11797436B2 (en) Memory system and method for controlling nonvolatile memory
US9852054B2 (en) Elastic caching for Java virtual machines
US11861204B2 (en) Storage system, memory management method, and management node
US10909102B2 (en) Systems and methods for performing scalable Log-Structured Merge (LSM) tree compaction using sharding
US20170344298A1 (en) Application aware memory resource management
WO2024078429A1 (zh) 内存管理方法、装置、计算机设备及存储介质
CN115794669A (zh) 一种扩展内存的方法、装置及相关设备
EP4307129A1 (en) Method for writing data into solid-state hard disk
US10168911B1 (en) Defragmentation of persistent main memory
KR20090131142A (ko) 메모리 관리 장치 및 방법
US20090327640A1 (en) Method for expanding logical volume storage space
KR102149468B1 (ko) 통합 캐시를 하나 또는 복수의 논리 유닛에 동적 할당하는 시스템 및 방법
US11841797B2 (en) Optimizing instant clones through content based read cache
JP2022121655A (ja) メモリシステムおよび制御方法
BR112017027429B1 (pt) Sistema de armazenamento, aparelho de gerenciamento de armazenamento, armazenamento, aparelho de armazenamento híbrido, e método de gerenciamento de armazenamento

Legal Events

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

Ref document number: 20862292

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020862292

Country of ref document: EP

Effective date: 20211222

NENP Non-entry into the national phase

Ref country code: DE