WO2022095685A1 - Persistent memory key value system and operation method therefor - Google Patents

Persistent memory key value system and operation method therefor Download PDF

Info

Publication number
WO2022095685A1
WO2022095685A1 PCT/CN2021/124463 CN2021124463W WO2022095685A1 WO 2022095685 A1 WO2022095685 A1 WO 2022095685A1 CN 2021124463 W CN2021124463 W CN 2021124463W WO 2022095685 A1 WO2022095685 A1 WO 2022095685A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
value pair
metadata
persistent memory
value
Prior art date
Application number
PCT/CN2021/124463
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 WO2022095685A1 publication Critical patent/WO2022095685A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • G06F12/0261Garbage collection, i.e. reclamation of unreferenced memory using reference counting

Definitions

  • Embodiments of the present invention relate to the technical field of persistent memory storage, and in particular, to a persistent memory key-value system and an operation method thereof.
  • Persistent memory has similar performance to dynamic random access memory (DRAM) and supports byte granularity addressing; at the same time, persistent memory, like disk, can store data persistently.
  • DRAM dynamic random access memory
  • existing persistent memory products with sub-microsecond latencies and single-slot capacities of up to 512GB present many opportunities for new memory storage systems.
  • Existing persistent memory supports two modes: application direct mode and memory mode.
  • the application direct access mode abstracts persistent memory into a special storage device that can be directly read and written through load and store instructions.
  • DRAM acts as a cache for persistent memory, providing applications with an abstraction of bulk memory, but without storage capabilities.
  • Modern servers are mostly multi-core architectures, that is, a processor contains dozens or even hundreds of CPU cores to improve the concurrent performance of the entire system.
  • multi-core architecture brings the problem of concurrency control, that is, how efficiently and correctly threads on different CPU cores can concurrently access data.
  • Embodiments of the present invention provide a persistent memory key-value system and an operation method thereof, so as to at least solve the problem in the related art that the existing persistent memory key-value system is not designed for a multi-core architecture, resulting in low operation performance.
  • a method for operating a persistent memory key-value system includes: searching an index of the persistent memory key-value system to locate the metadata of the key-value pair to be inserted; obtaining a dynamic random memory Get the write lock resource corresponding to the key-value pair metadata in the storage; allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata; in the persistent memory key-value system
  • the key-value pair metadata is inserted atomically, wherein the submission process of the key-value pair metadata insertion includes two stages. In the first stage, the persistent flag bit in the key-value pair metadata is cleared. , and call the CPU persistence instruction to flush it from the CPU cache to the persistent memory; in the second stage, set the persistence flag, and notify the read operation that the key-value pair metadata has been successfully persisted.
  • the method before acquiring the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory, the method further includes: extracting the write lock resource from the index of the persistent memory key-value system Detach and maintain the write lock resource in the dynamic random access memory.
  • the write lock resource is maintained in the dynamic random access memory in a table structure, wherein the input of the table structure is the node address of the index, and the output of the table structure is the corresponding of the write lock resource.
  • prior to atomically inserting the key-value pair metadata in the persistent memory key-value system further comprising: storing the key-value pair metadata in an atomically modifiable format.
  • the atomically modifiable format means that the key-value pair metadata is packed into a contiguous persistent memory space and supports atomic modification by the CPU.
  • the first insert operation when a conflicting first insert operation and a second insert operation occur at the same time, the first insert operation is not allocated and written to persistent memory, and the first insert operation is returned .
  • the key-value pair metadata includes at least one of the following: a key-value pair fingerprint, a key-value pair address, and a persistent flag; wherein the key-value pair fingerprint is a hash value of a key Several of the bits of the key-value pair address point to the key-value pair in the persistent memory, and the persistence flag bit indicates the persistent state of the metadata of the key-value pair.
  • the lock-free query of the key-value pair metadata includes: checking a persistence flag bit in the key-value pair metadata, and if the persistence flag bit is in a clear state, calling the CPU
  • the persistence instruction persists the metadata of the target key-value pair; the atomic instruction is called to set the persistence flag, and the key-value pair pointed to by the metadata is read.
  • the method further includes: periodically reclaiming persistent memory garbage through a background thread in a time-period-based memory reclamation manner.
  • a persistent memory key-value system comprising: a search module configured to search for an index of the persistent memory key-value system to locate the key-value pair metadata to be inserted; obtain A module, configured to obtain the write lock resource corresponding to the metadata of the key-value pair in the dynamic random access memory; an allocation module, configured to allocate persistent memory for the metadata of the key-value pair, and to persist the key-value pair pair metadata; an inserting module, configured to atomically insert the key-value pair metadata in the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages.
  • the persistent flag bit in the metadata of the key-value pair is cleared, and the CPU persistence instruction is called to flush it from the CPU cache to the persistent memory; in the second stage, the persistent flag bit is set , and notify the read operation that the key-value pair metadata has been successfully persisted.
  • system further includes a maintenance module configured to separate the write lock resource from the index of the persistent memory key-value system and maintain the write lock in the dynamic random access memory Lock resources.
  • system further includes a storage module configured to store the key-value pair metadata in an atomically modifiable format.
  • system further includes a query module configured to query the key-value pair metadata in the persistent memory key-value system lock-free.
  • the system further includes: a recycling module, configured as a memory recycling mode based on a time period, and periodically recycling persistent memory garbage through a background thread.
  • a recycling module configured as a memory recycling mode based on a time period, and periodically recycling persistent memory garbage through a background thread.
  • a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above methods when running steps in the examples.
  • an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor is configured to run the computer program to execute any of the above Steps in Method Examples.
  • FIG. 1 is a flowchart of an operation method of a persistent memory key-value system according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of a persistent memory key-value system according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a persistent memory key-value system according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of key-value pair metadata according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of an insertion operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a query operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of eliminating two concurrent conflict insertion operations according to an embodiment of the present invention.
  • FIG. 1 is a flowchart according to an embodiment of the present invention. As shown in FIG. 1 , the flowchart includes the following steps:
  • Step S102 look up the index of the persistent memory key-value system to locate the key-value pair metadata to be inserted;
  • Step S104 obtaining the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory
  • Step S106 Allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata
  • Step S108 Atomically insert the key-value pair metadata into the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages.
  • the persistent flag in the metadata of the key-value pair is cleared, and the CPU persistent instruction is called to flush it from the CPU cache to the persistent memory; in the second stage, the persistent flag is set, and the read operation is notified.
  • the key-value pair metadata has been successfully persisted.
  • the operation of the write lock resource does not introduce any writing to the persistent memory, and no log operation is required, which improves the performance of the insert operation and improves the multi-core Extensibility under architecture.
  • the method may further include: separating the write lock resource from the index of the persistent memory key-value system, and maintaining the write lock resource in the dynamic random access memory.
  • the write lock resource can be maintained in the dynamic random access memory in a table structure, wherein the input of the table structure is the node address of the index, and the output of the table structure is the corresponding the write lock resource.
  • the method may further include: storing the key-value pair metadata in an atomically modifiable format.
  • the atomically modifiable format means that the key-value pair metadata is packaged into a continuous persistent memory space and supports atomic modification by the CPU.
  • the first insert operation when a conflicting first insert operation and a second insert operation occur simultaneously, the first insert operation is not allocated and written to persistent memory, and the first insert operation is returned.
  • the key-value pair metadata includes at least one of the following: a key-value pair fingerprint, a key-value pair address, and a persistent flag; wherein, the key-value pair fingerprint is one of the hash values of the key. Several bits, the address of the key-value pair points to the key-value pair in the persistent memory, and the persistence flag bit indicates the persistent state of the metadata of the key-value pair.
  • the method may further include: querying the key-value pair metadata in the persistent memory key-value system without lock.
  • the lock-free query of the key-value pair metadata may include: checking the persistence flag bit in the key-value pair metadata, and if the persistence flag bit is in a clear state, invoking the CPU persistence
  • the atomization instruction persists the metadata of the target key-value pair; the atomic instruction is called to set the persistence flag, and the key-value pair pointed to by the metadata is read.
  • the method may further include: a time period-based memory recycling manner, periodically recycling persistent memory garbage through a background thread.
  • a persistent memory key-value system is also provided, and the system is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated.
  • the term "module” may be a combination of software and/or hardware that implements a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
  • FIG. 2 is a structural block diagram of a persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 2 , the system includes a search module 10 , an acquisition module 20 , an allocation module 30 and an insertion module 40 .
  • the search module 10 is configured to search the index of the persistent memory key-value system to locate the metadata of the key-value pair to be inserted.
  • the acquiring module 20 is configured to acquire the write lock resource corresponding to the metadata of the key-value pair in the dynamic random access memory.
  • the allocation module 30 is configured to allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata.
  • the insertion module 40 is configured to atomically insert the key-value pair metadata in the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages, in the first stage , clear the persistent flag bit in the metadata of the key-value pair, and call the CPU persistent instruction to flush it from the CPU cache to persistent memory; in the second stage, set the persistent flag bit, and notify The read operation of the key-value pair metadata has been successfully persisted.
  • FIG. 3 is a structural block diagram of a persistent memory key-value system according to another embodiment of the present invention. As shown in FIG. 3 , in addition to all the modules shown in FIG. 2 , the system also includes a maintenance module 50 , a storage module 60 , a Query module 70 and recycling module 80 .
  • the maintenance module 50 is configured to separate the write lock resource from the index of the persistent memory key-value system, and maintain the write lock resource in the dynamic random access memory.
  • the storage module 60 is configured to store the key-value pair metadata in an atomically modifiable format.
  • the query module 70 is configured to query the key-value pair metadata in the persistent memory key-value system without lock.
  • the recycling module 80 is set to a memory recycling method based on a time period, and periodically recycling persistent memory garbage through a background thread.
  • the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
  • FIG. 4 is a schematic diagram of a multi-core architecture friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 4 , based on the multi-core architecture-friendly persistent memory key-value system of this embodiment, the following insertion and query operations can be performed:
  • the write lock resource is used to control multiple concurrent insert operations.
  • the write lock resource in the dynamic random access memory is maintained in a table structure
  • the input of the table structure is the node address of the index
  • the output is the corresponding lock resource
  • the table structure of the write lock resource is an array of 4096 64-bit lock fields; since the lock table occupies only 32KB of space, it can be cached in the high-speed CPU second-level cache and hardly introduces TLB misses. It is worth noting that this table structure will introduce pseudo-conflicts, that is, different inodes compete for the same lock field. However, since the real load is mostly query-intensive, and the query operation is lock-free, the probability of false conflict is extremely low.
  • the traditional persistent memory key-value system embeds write locks into persistent indexes, which leads to various problems: first, the lock operation will bring additional persistent memory writes, which consumes limited persistent memory Second, when the key-value system crashes and restarts, the entire index needs to be scanned to clear the contents of the lock field. On the other hand, the present invention maintains the lock resource in the DRAM, reduces the bandwidth consumption of the persistent memory and improves the recovery performance.
  • the metadata of the key-value pair includes a key-value pair fingerprint, a key-value pair address, and a persistent flag bit, wherein the key-value pair fingerprint is several bits of the hash value of the key, The key-value pair address points to the key-value pair in the persistent memory, and the persistence flag indicates the persistent state of the metadata of the key-value pair.
  • key-value pair fingerprints are used to accelerate the location of key-value pairs.
  • the query operation can directly skip the corresponding key-value pair metadata, avoiding an extra read of the key-value pair in the persistent memory.
  • the persistence flag is 0, it means that the metadata of the key-value pair has not been persisted; otherwise, it means that it has been successfully persisted.
  • Key-value metadata is generally stored in indexes, including hash tables, B+ trees, dictionary trees, and so on.
  • the atomically modifiable format means that the key-value pair metadata is packed into a contiguous persistent memory space and supports atomic modification by the CPU.
  • FIG. 5 is a schematic structural diagram of key-value pair metadata according to an embodiment of the present invention.
  • the key-value pair metadata is 64 bits, of which the highest 16 bits store the key-value pair fingerprint, the middle 47 bits store the key-value pair address, and the lowest 1 bit stores the persistence flag bit.
  • the reasons why the highest 16 bits and the lowest bits can store extra information are: first, the virtual address space of Intel processors is only the lower 48 bits, and second, the persistent memory address allocated by the key-value system is 8-byte aligned (that is, the lowest 3 bits of the address are 0).
  • the CPU can atomically manipulate 64-bit key-value metadata.
  • the consistency state means that the metadata of the key-value system and the inserted key-value pair can be in one-to-one correspondence and are permanently stored in the persistent memory.
  • the submission process of the insert operation includes two stages, wherein the first stage clears the persistence flag bit in the metadata of the key-value pair, and calls the CPU persistence instruction to change it from the key-value pair.
  • the CPU cache is flushed to the persistent memory; in the second stage, the persistence flag is set to notify the read operation that the metadata of the key-value pair has been successfully persisted.
  • FIG. 6 is a flowchart of an insertion operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 6 , the insertion operation may include the following steps:
  • Step S601 look up the index, locate the key-value pair metadata
  • Step S602 obtaining the corresponding lock resource in the DRAM
  • Step S603 allocating persistent memory, and persisting key-value pairs
  • Step S604 the submission process of the key-value pair metadata insertion includes two stages, wherein the first stage clears the persistence flag bit in the key-value pair metadata, and calls the CPU persistence instruction to cache it from the CPU. flush to persistent memory;
  • Step S605 in the second stage of committing the insert operation, set the persistence flag, and notify the read operation that the metadata of the key-value pair has been successfully persisted.
  • the insert operation before the commit process, successfully acquires the corresponding lock resource in DRAM, allocates persistent memory, and persists the inserted key-value pair.
  • persistent instructions include CLFLUSH, CLWB, and CLFLUSHOPT. Assignments to key-value metadata are atomic in both phases of commit; in the first phase, the entire new key-value metadata value is written and persisted. Relying on the atomic write provided by the CPU, the insert operation does not require a mechanism such as a log to protect the consistency.
  • the persistence flag bit in the metadata of the target key-value pair is checked, and if the persistence flag bit is in a clear state, the CPU persistence is called.
  • the instruction persists the key-value pair metadata and then calls the atomic instruction to set the persistence flag.
  • FIG. 7 is a flowchart of a query operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 7 , the query operation may include the following steps:
  • Step S701 look up the index, locate the target key-value pair metadata
  • Step S702 judging whether the persistence flag of the target key-value pair metadata is in a clear state, if so, execute step S703, if not, execute step S705;
  • Step S703 calling the CPU persistence instruction to persist the target key-value pair metadata
  • Step S704 calling the atomic instruction CAS (compare-and-swap) to set the persistence flag;
  • Step S705 read the target key-value pair pointed to by the metadata.
  • FIG. 8 is a schematic diagram of eliminating two concurrent conflict insertion operations according to an embodiment of the present invention. As shown in FIG. 8 , in this embodiment, when two concurrent conflicting insert operations occur, one of the operations returns directly without any allocation and modification of persistent memory. This mechanism for eliminating operations does not violate correct concurrency semantics, because in the definition of linearizability, the result of executing two operations that overlap in time is equivalent to executing in a certain serial order. result.
  • a memory recycling method based on Epoch is used, and background threads are used to periodically recycle memory garbage.
  • the key-value system maintains a global counter, while each thread maintains a local counter. At the beginning of each key-value operation, update the local counter to the global counter.
  • ⁇ local counter value, released memory address> will be recorded in the recycle linked list.
  • a background thread periodically increments the global counter by 1, collects the local counter values of all threads, and calculates the minimum value, which is recorded as Safe-Epoch; at this time, all memory less than Safe-Epoch in the linked list can be recovered. was released safely.
  • the operation of the write lock resource does not introduce any writing to the persistent memory, and no log operation is required, thereby improving the performance of the insertion operation. Additionally, persistent memory allocations and writes are further reduced when multiple concurrent conflicting insert operations occur. For query operations, its lock-free process greatly improves the concurrent query performance of the key-value system under the multi-core architecture while ensuring correct semantics.
  • Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include, but is not limited to, a USB flash drive, a read-only memory (Read-Only Memory, referred to as ROM for short), and a random access memory (Random Access Memory, referred to as RAM for short) , mobile hard disk, magnetic disk or CD-ROM and other media that can store computer programs.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • An embodiment of the present invention also provides an electronic device, comprising a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
  • the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices
  • they can be implemented in program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, can be performed in a different order than shown here.
  • the described steps, or they are respectively made into individual integrated circuit modules, or a plurality of modules or steps in them are made into a single integrated circuit module to realize.
  • the present invention is not limited to any particular combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are a persistent memory key value system and an operation method therefor. The operation method comprises: searching for an index of a persistent memory key value system, so as to position key value pair metadata to be inserted; acquiring a write lock resource, corresponding to the key value pair metadata, in a dynamic random access memory; allocating a persistent memory to the key value pair metadata, and making the key value pair metadata persist; and atomically inserting the key value pair metadata into the persistent memory key value system. By means of the present invention, during an insertion operation process of a key value pair, no writing of a persistent memory is introduced into the operation of a write lock resource, and no log operation is needed, such that the insertion operation performance is improved, and the expansibility under a multi-core architecture is improved.

Description

持久性内存键值系统及其操作方法Persistent memory key-value system and method of operation
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于2020年11月04日提交的发明名称为“持久性内存键值系统及其操作方法”的中国专利申请CN202011218384.6,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本申请。This application is based on the Chinese patent application CN202011218384.6 filed on November 04, 2020 with the title of "Persistent Memory Key-Value System and Its Operation Method", and claims the priority of the patent application, and the disclosure of the invention is hereby incorporated by reference. The contents are fully incorporated into this application.
技术领域technical field
本发明实施例涉及持久性内存存储技术领域,具体而言,涉及一种持久性内存键值系统及其操作方法。Embodiments of the present invention relate to the technical field of persistent memory storage, and in particular, to a persistent memory key-value system and an operation method thereof.
背景技术Background technique
持久性内存(Persistent Memory)具有与动态随机存取存储器(DRAM)相近的性能,并且支持字节粒度寻址;同时,持久性内存和磁盘一样,能够持久化存储数据。例如,现有的持久性内存产品具有亚微秒的延迟以及单条最高512GB的容量,其为新型内存存储系统带来了诸多机遇。现有的持久性内存支持两种模式:应用直访模式和内存模式。应用直访模式将持久性内存抽象为特殊的、可通过load、store指令直接读写的存储设备。在内存模式下,DRAM作为持久性内存的缓存,向应用程序提供了一个大容量内存的抽象,但没有存储能力。Persistent memory has similar performance to dynamic random access memory (DRAM) and supports byte granularity addressing; at the same time, persistent memory, like disk, can store data persistently. For example, existing persistent memory products with sub-microsecond latencies and single-slot capacities of up to 512GB present many opportunities for new memory storage systems. Existing persistent memory supports two modes: application direct mode and memory mode. The application direct access mode abstracts persistent memory into a special storage device that can be directly read and written through load and store instructions. In memory mode, DRAM acts as a cache for persistent memory, providing applications with an abstraction of bulk memory, but without storage capabilities.
现代服务器多为多核架构,即一块处理器中包含几十甚至上百个CPU核心,用于提高整个系统的并发性能。然而,多核架构带来了并发控制的问题,即不同CPU核心上的线程如何高效且正确地并发访问数据。Modern servers are mostly multi-core architectures, that is, a processor contains dozens or even hundreds of CPU cores to improve the concurrent performance of the entire system. However, multi-core architecture brings the problem of concurrency control, that is, how efficiently and correctly threads on different CPU cores can concurrently access data.
现有持久性内存键值系统未针对多核架构进行设计,导致了诸多问题。首先,保证多线程正确执行的并发原语(如读写锁)导致数据在不同CPU核心的缓存之间来回抖动,频繁触发低效的缓存一致性协议,严重影响CPU的性能。其次,持久性内存的写带宽很低,单条写带宽仅有2.3GB/s左右,约为DRAM的1/6,而键值系统为保证崩溃一致性而采用的各种一致性机制(如日志)会消耗额外的持久性内存写带宽;同时,读写锁通常被嵌入到数据结构内部,其带来的缓存抖动也会导致大量持久性内存的写回。最后,由于持久性内存较高的读延迟和持久化延迟,临界区的时间被拉长,导致不同线程间相互冲突的操作被严重阻塞。Existing persistent memory key-value systems are not designed for multi-core architectures, resulting in many problems. First, concurrency primitives (such as read-write locks) that ensure the correct execution of multiple threads cause data to jitter back and forth between caches of different CPU cores, frequently triggering inefficient cache coherency protocols, and seriously affecting CPU performance. Secondly, the write bandwidth of persistent memory is very low, and the single write bandwidth is only about 2.3GB/s, which is about 1/6 of DRAM, and the key-value system uses various consistency mechanisms (such as log files) to ensure crash consistency. ) will consume additional persistent memory write bandwidth; at the same time, read-write locks are usually embedded in data structures, and the cache jitter caused by them will also lead to a large number of persistent memory writebacks. Finally, due to the high read latency and persistence latency of persistent memory, the time of the critical section is stretched, causing conflicting operations between different threads to be severely blocked.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种持久性内存键值系统及其操作方法,以至少解决相关技术中现有持久性内存键值系统未针对多核架构进行设计,导致操作性能较低的问题。Embodiments of the present invention provide a persistent memory key-value system and an operation method thereof, so as to at least solve the problem in the related art that the existing persistent memory key-value system is not designed for a multi-core architecture, resulting in low operation performance.
根据本发明的一个实施例,提供了一种持久性内存键值系统的操作方法,该方法包括:查找持久性内存键值系统的索引以定位待插入的键值对元数据;获取动态随机存取存储器中与所述键值对元数据对应的写锁资源;为所述键值对元数据分配持久性内存,并持久化所述键值对元数据;在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键 值对元数据插入的提交过程包括两个阶段,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。According to an embodiment of the present invention, a method for operating a persistent memory key-value system is provided. The method includes: searching an index of the persistent memory key-value system to locate the metadata of the key-value pair to be inserted; obtaining a dynamic random memory Get the write lock resource corresponding to the key-value pair metadata in the storage; allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata; in the persistent memory key-value system The key-value pair metadata is inserted atomically, wherein the submission process of the key-value pair metadata insertion includes two stages. In the first stage, the persistent flag bit in the key-value pair metadata is cleared. , and call the CPU persistence instruction to flush it from the CPU cache to the persistent memory; in the second stage, set the persistence flag, and notify the read operation that the key-value pair metadata has been successfully persisted.
在一个示例性实施例中,在获取动态随机存取存储器中与所述键值对元数据对应的写锁资源之前,还包括;将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动态随机存取存储器中维护所述写锁资源。In an exemplary embodiment, before acquiring the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory, the method further includes: extracting the write lock resource from the index of the persistent memory key-value system Detach and maintain the write lock resource in the dynamic random access memory.
在一个示例性实施例中,所述写锁资源在所述动态随机存取存储器中以表结构被维护,其中,所述表结构的输入为索引的节点地址,所述表结构的输出为对应的所述写锁资源。In an exemplary embodiment, the write lock resource is maintained in the dynamic random access memory in a table structure, wherein the input of the table structure is the node address of the index, and the output of the table structure is the corresponding of the write lock resource.
在一个示例性实施例中,在所述持久性内存键值系统中原子地插入所述键值对元数据之前,还包括:将所述键值对元数据存储为可原子修改的格式。In an exemplary embodiment, prior to atomically inserting the key-value pair metadata in the persistent memory key-value system, further comprising: storing the key-value pair metadata in an atomically modifiable format.
在一个示例性实施例中,所述可原子修改的格式指所述键值对元数据被包装到连续的持久性内存空间,并支持被CPU原子地修改。In one exemplary embodiment, the atomically modifiable format means that the key-value pair metadata is packed into a contiguous persistent memory space and supports atomic modification by the CPU.
在一个示例性实施例中,当相冲突的第一插入操作和第二插入操作同时发生时,不对所述第一插入操作进行持久性内存的分配和写入,将所述第一插入操作返回。In an exemplary embodiment, when a conflicting first insert operation and a second insert operation occur at the same time, the first insert operation is not allocated and written to persistent memory, and the first insert operation is returned .
在一个示例性实施例中,所述键值对元数据至少包括以下之一:键值对指纹、键值对地址以及持久化标志位;其中,所述键值对指纹为键的哈希值的其中若干位,所述键值对地址指向持久性内存中的键值对,所述持久性标志位指示所述键值对元数据的持久化状态。In an exemplary embodiment, the key-value pair metadata includes at least one of the following: a key-value pair fingerprint, a key-value pair address, and a persistent flag; wherein the key-value pair fingerprint is a hash value of a key Several of the bits of the key-value pair address point to the key-value pair in the persistent memory, and the persistence flag bit indicates the persistent state of the metadata of the key-value pair.
在一个示例性实施例中,在将所述键值对元数据原子地插入所述持久性内存键值系统之后,还包括:在所述持久性内存键值系统中无锁地查询所述键值对元数据。In an exemplary embodiment, after atomically inserting the key-value pair metadata into the persistent memory key-value system, further comprising: querying the key-value system lock-free in the persistent memory key-value system Value pair metadata.
在一个示例性实施例中,无锁地查询所述键值对元数据包括:检查所述键值对元数据中的持久性标志位,若所述持久性标志位为清空状态,则调用CPU持久化指令持久化所述目标键值对元数据;调用原子指令设置所述持久性标志位,并读取元数据指向的键值对。In an exemplary embodiment, the lock-free query of the key-value pair metadata includes: checking a persistence flag bit in the key-value pair metadata, and if the persistence flag bit is in a clear state, calling the CPU The persistence instruction persists the metadata of the target key-value pair; the atomic instruction is called to set the persistence flag, and the key-value pair pointed to by the metadata is read.
在一个示例性实施例中,该方法还包括:基于时间周期的内存回收方式,通过后台线程周期性回收持久性内存垃圾。In an exemplary embodiment, the method further includes: periodically reclaiming persistent memory garbage through a background thread in a time-period-based memory reclamation manner.
根据本发明的另一个实施例,提供了一种持久性内存键值系统,该系统包括:查找模块,设置为查找持久性内存键值系统的索引以定位待插入的键值对元数据;获取模块,设置为获取动态随机存取存储器中与所述键值对元数据对应的写锁资源;分配模块,设置为为所述键值对元数据分配持久性内存,并持久化所述键值对元数据;插入模块,设置为在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键值对元数据插入的提交过程包括两个阶段,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。According to another embodiment of the present invention, a persistent memory key-value system is provided, the system comprising: a search module configured to search for an index of the persistent memory key-value system to locate the key-value pair metadata to be inserted; obtain A module, configured to obtain the write lock resource corresponding to the metadata of the key-value pair in the dynamic random access memory; an allocation module, configured to allocate persistent memory for the metadata of the key-value pair, and to persist the key-value pair pair metadata; an inserting module, configured to atomically insert the key-value pair metadata in the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages. In the first stage, the persistent flag bit in the metadata of the key-value pair is cleared, and the CPU persistence instruction is called to flush it from the CPU cache to the persistent memory; in the second stage, the persistent flag bit is set , and notify the read operation that the key-value pair metadata has been successfully persisted.
在一个示例性实施例中,该系统还包括:维护模块,设置为将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动态随机存取存储器中维护所述写锁资源。In an exemplary embodiment, the system further includes a maintenance module configured to separate the write lock resource from the index of the persistent memory key-value system and maintain the write lock in the dynamic random access memory Lock resources.
在一个示例性实施例中,该系统还包括:存储模块,设置为将所述键值对元数据存储为可原子修改的格式。In an exemplary embodiment, the system further includes a storage module configured to store the key-value pair metadata in an atomically modifiable format.
在一个示例性实施例中,该系统还包括:查询模块,设置为在所述持久性内存键值系统中无锁地查询所述键值对元数据。In an exemplary embodiment, the system further includes a query module configured to query the key-value pair metadata in the persistent memory key-value system lock-free.
在一个示例性实施例中,该系统还包括:回收模块,设置为基于时间周期的内存回收方 式,通过后台线程周期性回收持久性内存垃圾。In an exemplary embodiment, the system further includes: a recycling module, configured as a memory recycling mode based on a time period, and periodically recycling persistent memory garbage through a background thread.
根据本发明的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, and a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above methods when running steps in the examples.
根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is also provided an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor is configured to run the computer program to execute any of the above Steps in Method Examples.
附图说明Description of drawings
图1是根据本发明实施例的持久性内存键值系统的操作方法的流程图;1 is a flowchart of an operation method of a persistent memory key-value system according to an embodiment of the present invention;
图2是根据本发明实施例的持久性内存键值系统的结构框图;2 is a structural block diagram of a persistent memory key-value system according to an embodiment of the present invention;
图3是根据本发明另一实施例的持久性内存键值系统的结构框图;3 is a structural block diagram of a persistent memory key-value system according to another embodiment of the present invention;
图4是根据本发明一个实施例的多核架构友好的持久性内存键值系统的示意图;4 is a schematic diagram of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention;
图5是根据本发明实施例的键值对元数据的结构示意图;5 is a schematic structural diagram of key-value pair metadata according to an embodiment of the present invention;
图6是根据本发明实施例的多核架构友好的持久性内存键值系统的插入操作流程图;6 is a flowchart of an insertion operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention;
图7是根据本发明实施例的多核架构友好的持久性内存键值系统的查询操作流程图;7 is a flowchart of a query operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention;
图8是根据本发明实施例的两个并发冲突插入操作的消除示意图。FIG. 8 is a schematic diagram of eliminating two concurrent conflict insertion operations according to an embodiment of the present invention.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本发明的实施例。Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence.
实施例1Example 1
在本实施例中提供了一种持久性内存键值系统的操作方法,图1是根据本发明实施例的的流程图,如图1所示,该流程包括如下步骤:This embodiment provides a method for operating a persistent memory key-value system. FIG. 1 is a flowchart according to an embodiment of the present invention. As shown in FIG. 1 , the flowchart includes the following steps:
步骤S102,查找持久性内存键值系统的索引以定位待插入的键值对元数据;Step S102, look up the index of the persistent memory key-value system to locate the key-value pair metadata to be inserted;
步骤S104,获取动态随机存取存储器中与所述键值对元数据对应的写锁资源;Step S104, obtaining the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory;
步骤S106,为所述键值对元数据分配持久性内存,并持久化所述键值对元数据;Step S106: Allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata;
步骤S108,在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键值对元数据插入的提交过程包括两个阶段,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。Step S108: Atomically insert the key-value pair metadata into the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages. The persistent flag in the metadata of the key-value pair is cleared, and the CPU persistent instruction is called to flush it from the CPU cache to the persistent memory; in the second stage, the persistent flag is set, and the read operation is notified. The key-value pair metadata has been successfully persisted.
通过本发明的上述实施例,在键值对的插入操作过程中,对写锁资源的操作不会引入任何对持久性内存的写,并且无需任何日志操作,提高了插入操作性能,并提高多核架构下的扩展性。Through the above-mentioned embodiments of the present invention, in the process of inserting a key-value pair, the operation of the write lock resource does not introduce any writing to the persistent memory, and no log operation is required, which improves the performance of the insert operation and improves the multi-core Extensibility under architecture.
在本实施例的步骤S104之前,还可包括;将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动态随机存取存储器中维护所述写锁资源。Before step S104 in this embodiment, the method may further include: separating the write lock resource from the index of the persistent memory key-value system, and maintaining the write lock resource in the dynamic random access memory.
在本实施例中,所述写锁资源可在所述动态随机存取存储器中以表结构被维护,其中,所述表结构的输入为索引的节点地址,所述表结构的输出为对应的所述写锁资源。In this embodiment, the write lock resource can be maintained in the dynamic random access memory in a table structure, wherein the input of the table structure is the node address of the index, and the output of the table structure is the corresponding the write lock resource.
在本实施例的步骤S108之前,还可包括:将所述键值对元数据存储为可原子修改的格式。Before step S108 in this embodiment, the method may further include: storing the key-value pair metadata in an atomically modifiable format.
在本实施例中,所述可原子修改的格式指所述键值对元数据被包装到连续的持久性内存空间,并支持被CPU原子地修改。In this embodiment, the atomically modifiable format means that the key-value pair metadata is packaged into a continuous persistent memory space and supports atomic modification by the CPU.
在本实施例中,当相冲突的第一插入操作和第二插入操作同时发生时,不对所述第一插入操作进行持久性内存的分配和写入,将所述第一插入操作返回。In this embodiment, when a conflicting first insert operation and a second insert operation occur simultaneously, the first insert operation is not allocated and written to persistent memory, and the first insert operation is returned.
在本实施例中,所述键值对元数据至少包括以下之一:键值对指纹、键值对地址以及持久化标志位;其中,所述键值对指纹为键的哈希值的其中若干位,所述键值对地址指向持久性内存中的键值对,所述持久性标志位指示所述键值对元数据的持久化状态。In this embodiment, the key-value pair metadata includes at least one of the following: a key-value pair fingerprint, a key-value pair address, and a persistent flag; wherein, the key-value pair fingerprint is one of the hash values of the key. Several bits, the address of the key-value pair points to the key-value pair in the persistent memory, and the persistence flag bit indicates the persistent state of the metadata of the key-value pair.
在本实施例的步骤S108之后,还可包括:在所述持久性内存键值系统中无锁地查询所述键值对元数据。After step S108 of this embodiment, the method may further include: querying the key-value pair metadata in the persistent memory key-value system without lock.
在本实施例中,无锁地查询所述键值对元数据可包括:检查所述键值对元数据中的持久性标志位,若所述持久性标志位为清空状态,则调用CPU持久化指令持久化所述目标键值对元数据;调用原子指令设置所述持久性标志位,并读取元数据指向的键值对。In this embodiment, the lock-free query of the key-value pair metadata may include: checking the persistence flag bit in the key-value pair metadata, and if the persistence flag bit is in a clear state, invoking the CPU persistence The atomization instruction persists the metadata of the target key-value pair; the atomic instruction is called to set the persistence flag, and the key-value pair pointed to by the metadata is read.
在本实施例中,该方法还可包括:基于时间周期的内存回收方式,通过后台线程周期性回收持久性内存垃圾。In this embodiment, the method may further include: a time period-based memory recycling manner, periodically recycling persistent memory garbage through a background thread.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
实施例2Example 2
在本实施例中还提供了一种持久性内存键值系统,该系统用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a persistent memory key-value system is also provided, and the system is used to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
图2是根据本发明实施例的持久性内存键值系统的结构框图,如图2所示,该系统包括查找模块10、获取模块20、分配模块30和插入模块40。FIG. 2 is a structural block diagram of a persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 2 , the system includes a search module 10 , an acquisition module 20 , an allocation module 30 and an insertion module 40 .
查找模块10,设置为查找持久性内存键值系统的索引以定位待插入的键值对元数据。The search module 10 is configured to search the index of the persistent memory key-value system to locate the metadata of the key-value pair to be inserted.
获取模块20,设置为获取动态随机存取存储器中与所述键值对元数据对应的写锁资源。The acquiring module 20 is configured to acquire the write lock resource corresponding to the metadata of the key-value pair in the dynamic random access memory.
分配模块30,设置为为所述键值对元数据分配持久性内存,并持久化所述键值对元数据。The allocation module 30 is configured to allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata.
插入模块40,设置为在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键值对元数据插入的提交过程包括两个阶段,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。The insertion module 40 is configured to atomically insert the key-value pair metadata in the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages, in the first stage , clear the persistent flag bit in the metadata of the key-value pair, and call the CPU persistent instruction to flush it from the CPU cache to persistent memory; in the second stage, set the persistent flag bit, and notify The read operation of the key-value pair metadata has been successfully persisted.
图3是根据本发明另一实施例的持久性内存键值系统的结构框图,如图3所示,该系统除包括图2所示的所有模块外,还包括维护模块50、存储模块60、查询模块70和回收模块80。FIG. 3 is a structural block diagram of a persistent memory key-value system according to another embodiment of the present invention. As shown in FIG. 3 , in addition to all the modules shown in FIG. 2 , the system also includes a maintenance module 50 , a storage module 60 , a Query module 70 and recycling module 80 .
维护模块50,设置为将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动 态随机存取存储器中维护所述写锁资源。The maintenance module 50 is configured to separate the write lock resource from the index of the persistent memory key-value system, and maintain the write lock resource in the dynamic random access memory.
存储模块60,设置为将所述键值对元数据存储为可原子修改的格式。The storage module 60 is configured to store the key-value pair metadata in an atomically modifiable format.
查询模块70,设置为在所述持久性内存键值系统中无锁地查询所述键值对元数据。The query module 70 is configured to query the key-value pair metadata in the persistent memory key-value system without lock.
回收模块80,设置为基于时间周期的内存回收方式,通过后台线程周期性回收持久性内存垃圾。The recycling module 80 is set to a memory recycling method based on a time period, and periodically recycling persistent memory garbage through a background thread.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
为了便于对本发明所提供的技术方案的理解,下面将结合具体场景的实施例进行详细描述。In order to facilitate the understanding of the technical solutions provided by the present invention, the following will describe in detail with reference to embodiments of specific scenarios.
实施例3Example 3
图4是根据本发明实施例的多核架构友好的持久性内存键值系统的示意图。如图4所示,基于本实施例的多核架构友好的持久性内存键值系统,可执行如下插入和查询操作:FIG. 4 is a schematic diagram of a multi-core architecture friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 4 , based on the multi-core architecture-friendly persistent memory key-value system of this embodiment, the following insertion and query operations can be performed:
S1,将写锁资源从持久性内存键值系统的索引中分离,在动态随机存取存储器中单独维护;S1, separate the write lock resource from the index of the persistent memory key-value system and maintain it separately in the dynamic random access memory;
S2,将键值对元数据存储为可原子修改的格式,当发生插入操作时利用CPU的原子指令将系统从一个一致性状态原子地切换到另一个一致性状态(两阶段原子插入);S2, store the key-value pair metadata in an atomically modifiable format, and use the atomic instructions of the CPU to atomically switch the system from one consistency state to another when an insertion operation occurs (two-stage atomic insertion);
S3,当两个冲突的插入操作同时发生时,让其中一个操作直接返回,不做任何持久性内存的分配与写入(消除并发插入);S3, when two conflicting insert operations occur at the same time, let one of the operations return directly without any allocation and writing of persistent memory (eliminate concurrent inserts);
S4,当发生查询操作时,无锁地进行键值数据的读取。S4, when a query operation occurs, the key-value data is read without lock.
在本实施例中,写锁资源用于控制多个并发的插入操作。In this embodiment, the write lock resource is used to control multiple concurrent insert operations.
进一步地,在本发明的一个实施例中,在动态随机存取存储器中写锁资源以表结构被维护,表结构输入是索引的节点地址,输出是对应的锁资源。Further, in an embodiment of the present invention, the write lock resource in the dynamic random access memory is maintained in a table structure, the input of the table structure is the node address of the index, and the output is the corresponding lock resource.
具体地,例如,写锁资源的表结构为4096个64位锁字段的数组;由于锁表只占有32KB的空间,它能够缓存在高速的CPU第二级缓存中,且几乎不引入TLB缺失。值得注意的是,该表结构会引入伪冲突,即不同的索引节点竞争同一个锁字段。但由于真实负载多是查询密集的,且查询操作是无锁的,所以伪冲突的概率极低。Specifically, for example, the table structure of the write lock resource is an array of 4096 64-bit lock fields; since the lock table occupies only 32KB of space, it can be cached in the high-speed CPU second-level cache and hardly introduces TLB misses. It is worth noting that this table structure will introduce pseudo-conflicts, that is, different inodes compete for the same lock field. However, since the real load is mostly query-intensive, and the query operation is lock-free, the probability of false conflict is extremely low.
需要说明的是,传统的持久性内存键值系统将写锁嵌入至持久性索引中,这会导致多种问题:首先,锁操作会带来额外的持久性内存的写,消耗持久性内存有限的带宽;其次,当键值系统崩溃重启时,需要扫描整个索引,清空锁字段的内容。而本发明将锁资源维护在DRAM中,减少持久性内存带宽消耗的同时提高了恢复性能。It should be noted that the traditional persistent memory key-value system embeds write locks into persistent indexes, which leads to various problems: first, the lock operation will bring additional persistent memory writes, which consumes limited persistent memory Second, when the key-value system crashes and restarts, the entire index needs to be scanned to clear the contents of the lock field. On the other hand, the present invention maintains the lock resource in the DRAM, reduces the bandwidth consumption of the persistent memory and improves the recovery performance.
进一步地,在本发明的一个实施例中,键值对的元数据包括键值对指纹、键值对地址以及持久化标志位,其中键值对指纹为键的哈希值的其中若干位,键值对地址指向持久性内存中的键值对,持久性标志位指示所述键值对元数据的持久化状态。Further, in an embodiment of the present invention, the metadata of the key-value pair includes a key-value pair fingerprint, a key-value pair address, and a persistent flag bit, wherein the key-value pair fingerprint is several bits of the hash value of the key, The key-value pair address points to the key-value pair in the persistent memory, and the persistence flag indicates the persistent state of the metadata of the key-value pair.
具体地,键值对指纹用于加速对键值对的定位。当指纹不匹配时,查询操作可直接跳过对应的键值对元数据,避免了额外一次对持久性内存中的键值对的读取。持久性标志位为0时,代表该键值对元数据未被持久化;否则,代表其被成功持久化。键值元数据一般被存储在索引中,索引包括哈希表、B+树、字典树等。Specifically, key-value pair fingerprints are used to accelerate the location of key-value pairs. When the fingerprints do not match, the query operation can directly skip the corresponding key-value pair metadata, avoiding an extra read of the key-value pair in the persistent memory. When the persistence flag is 0, it means that the metadata of the key-value pair has not been persisted; otherwise, it means that it has been successfully persisted. Key-value metadata is generally stored in indexes, including hash tables, B+ trees, dictionary trees, and so on.
进一步地,在本发明的一个实施例中,可原子修改的格式指所述键值对元数据被包装到 连续的持久性内存空间,并支持被CPU原子地修改。Further, in one embodiment of the present invention, the atomically modifiable format means that the key-value pair metadata is packed into a contiguous persistent memory space and supports atomic modification by the CPU.
具体地,图5为根据本发明一个实施例的键值对元数据的结构示意图。如图5所示,键值对元数据为64位,其中最高16位存储键值对指纹,中间47位存储键值对地址,最低1位存储持久化标志位。最高16位和最低位能够存储额外信息的原因在于:首先,英特尔处理器的虚拟地址空间只有低48位,其次,键值系统分配的持久性内存地址8字节对齐(即地址最低3位为0)。CPU可以原子地操作64位的键值对元数据。Specifically, FIG. 5 is a schematic structural diagram of key-value pair metadata according to an embodiment of the present invention. As shown in Figure 5, the key-value pair metadata is 64 bits, of which the highest 16 bits store the key-value pair fingerprint, the middle 47 bits store the key-value pair address, and the lowest 1 bit stores the persistence flag bit. The reasons why the highest 16 bits and the lowest bits can store extra information are: first, the virtual address space of Intel processors is only the lower 48 bits, and second, the persistent memory address allocated by the key-value system is 8-byte aligned (that is, the lowest 3 bits of the address are 0). The CPU can atomically manipulate 64-bit key-value metadata.
进一步地,在本发明的一个实施例中,一致性状态指键值系统的元数据和插入的键值对可以一一对应,并永久地存储在持久性内存中。Further, in an embodiment of the present invention, the consistency state means that the metadata of the key-value system and the inserted key-value pair can be in one-to-one correspondence and are permanently stored in the persistent memory.
进一步地,在本发明的一个实施例中,插入操作的提交过程包括两个阶段,其中第一阶段将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置持久性标志位,用于通知读操作所述键值对元数据已经被成功持久化。Further, in an embodiment of the present invention, the submission process of the insert operation includes two stages, wherein the first stage clears the persistence flag bit in the metadata of the key-value pair, and calls the CPU persistence instruction to change it from the key-value pair. The CPU cache is flushed to the persistent memory; in the second stage, the persistence flag is set to notify the read operation that the metadata of the key-value pair has been successfully persisted.
图6为根据本发明实施例的多核架构友好的持久性内存键值系统的插入操作流程图,如图6所述,该插入操作可包括如下步骤:FIG. 6 is a flowchart of an insertion operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 6 , the insertion operation may include the following steps:
步骤S601,查找索引,定位键值对元数据;Step S601, look up the index, locate the key-value pair metadata;
步骤S602,获取DRAM中的对应锁资源;Step S602, obtaining the corresponding lock resource in the DRAM;
步骤S603,分配持久性内存,并持久化键值对;Step S603, allocating persistent memory, and persisting key-value pairs;
步骤S604,所述键值对元数据插入的提交过程包括两个阶段,其中,第一阶段将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;Step S604, the submission process of the key-value pair metadata insertion includes two stages, wherein the first stage clears the persistence flag bit in the key-value pair metadata, and calls the CPU persistence instruction to cache it from the CPU. flush to persistent memory;
步骤S605,在插入操作的提交的第二阶段,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。Step S605, in the second stage of committing the insert operation, set the persistence flag, and notify the read operation that the metadata of the key-value pair has been successfully persisted.
如图6所示,在提交过程之前,插入操作成功获取DRAM中对应的锁资源,并分配了持久性内存,且持久化了插入的键值对。例如,在英特尔CPU上,持久化指令包括CLFLUSH、CLWB和CLFLUSHOPT。提交的两个阶段中对键值对元数据的赋值都是原子的;第一个阶段中,整个新的键值对元数据的值被写入并持久化。依赖于CPU提供的原子写,插入操作无需日志等机制保护一致性。As shown in Figure 6, before the commit process, the insert operation successfully acquires the corresponding lock resource in DRAM, allocates persistent memory, and persists the inserted key-value pair. For example, on Intel CPUs, persistent instructions include CLFLUSH, CLWB, and CLFLUSHOPT. Assignments to key-value metadata are atomic in both phases of commit; in the first phase, the entire new key-value metadata value is written and persisted. Relying on the atomic write provided by the CPU, the insert operation does not require a mechanism such as a log to protect the consistency.
进一步地,在本发明的一个实施例中,在查询操作的无锁查询过程中,检查目标键值对元数据中的持久性标志位,若持久性标志位为清空状态,则调用CPU持久化指令持久化键值对元数据,然后调用原子指令设置持久性标志位。Further, in an embodiment of the present invention, in the lock-free query process of the query operation, the persistence flag bit in the metadata of the target key-value pair is checked, and if the persistence flag bit is in a clear state, the CPU persistence is called. The instruction persists the key-value pair metadata and then calls the atomic instruction to set the persistence flag.
图7为根据本发明实施例的多核架构友好的持久性内存键值系统的查询操作流程图,如图7所示,该查询操作可包括如下步骤:FIG. 7 is a flowchart of a query operation of a multi-core architecture-friendly persistent memory key-value system according to an embodiment of the present invention. As shown in FIG. 7 , the query operation may include the following steps:
步骤S701,查找索引,定位目标键值对元数据;Step S701, look up the index, locate the target key-value pair metadata;
步骤S702,判断目标键值对元数据的持久性标志位是否为清空状态,如果是,则执行步骤S703,如果否,则执行步骤S705;Step S702, judging whether the persistence flag of the target key-value pair metadata is in a clear state, if so, execute step S703, if not, execute step S705;
步骤S703,调用CPU持久化指令持久化目标键值对元数据;Step S703, calling the CPU persistence instruction to persist the target key-value pair metadata;
步骤S704,调用原子指令CAS(compare-and-swap)去设置持久性标志位;Step S704, calling the atomic instruction CAS (compare-and-swap) to set the persistence flag;
步骤S705,读取元数据指向的目标键值对。Step S705, read the target key-value pair pointed to by the metadata.
如图7所示,在查询操作的过程中,当目标键值对元数据的持久性标志位为清空状态时,代表该元数据还未被成功持久化,为了保证查询操作不会读到未提交的数据,查询操作主动 持久化元数据,并调用原子指令去设置持久性标志位。这种主动持久化的机制保证了系统崩溃重启后无需遍历所有的键值对元数据以设置持久性标志。As shown in Figure 7, during the query operation, when the persistence flag of the metadata of the target key-value pair is cleared, it means that the metadata has not been successfully persisted. Submitted data, the query operation actively persists the metadata, and calls the atomic instruction to set the persistence flag. This active persistence mechanism ensures that there is no need to traverse all the key-value pair metadata to set the persistence flag after the system crashes and restarts.
图8为根据本发明实施例的两个并发冲突插入操作的消除示意图。如图8所示,在本实施例中,当出现两个并发冲突的插入操作时,其中一个操作直接返回,不做任何持久性内存的分配与修改。这种消除操作的机制并未违背正确的并发语义,这是因为在线性化(linearizability)的定义中,两个在时间上重叠的操作的执行结果,等价于某一种串行顺序的执行结果。FIG. 8 is a schematic diagram of eliminating two concurrent conflict insertion operations according to an embodiment of the present invention. As shown in FIG. 8 , in this embodiment, when two concurrent conflicting insert operations occur, one of the operations returns directly without any allocation and modification of persistent memory. This mechanism for eliminating operations does not violate correct concurrency semantics, because in the definition of linearizability, the result of executing two operations that overlap in time is equivalent to executing in a certain serial order. result.
进一步地,在本发明的一个实施例中,针对查询操作的无锁读取问题,使用基于Epoch(时间周期)的内存回收方法,利用后台线程周期性回收内存垃圾。Further, in an embodiment of the present invention, for the problem of lock-free reading in query operations, a memory recycling method based on Epoch (time period) is used, and background threads are used to periodically recycle memory garbage.
具体地,键值系统维护一个全局的计数器,同时每个线程维护一个本地计数器。每个键值操作开始时,将本地计数器更新为全局计数器。当需要释放持久性内存空间时,将<本地计数器的值,释放的内存地址>记录到回收链表中。同时,一个后台线程周期性地将全局计数器加1,并收集所有线程的本地计数器值,并计算出其中最小值,记做Safe-Epoch;此时,回收链表中所有小于Safe-Epoch的内存可以被安全地释放。Specifically, the key-value system maintains a global counter, while each thread maintains a local counter. At the beginning of each key-value operation, update the local counter to the global counter. When the persistent memory space needs to be released, <local counter value, released memory address> will be recorded in the recycle linked list. At the same time, a background thread periodically increments the global counter by 1, collects the local counter values of all threads, and calculates the minimum value, which is recorded as Safe-Epoch; at this time, all memory less than Safe-Epoch in the linked list can be recovered. was released safely.
在本发明的上述实施例的插入操作过程中,对写锁资源的操作不会引入任何对持久性内存的写,并且无需任何日志操作,提高了插入操作性能。另外,当多个并发冲突的插入操作发生时,进一步地减少了持久性内存的分配和写入。针对查询操作,其无锁的过程在保证正确语义的同时极大地提升了键值系统的在多核架构下的并发查询性能。During the insertion operation of the above-mentioned embodiment of the present invention, the operation of the write lock resource does not introduce any writing to the persistent memory, and no log operation is required, thereby improving the performance of the insertion operation. Additionally, persistent memory allocations and writes are further reduced when multiple concurrent conflicting insert operations occur. For query operations, its lock-free process greatly improves the concurrent query performance of the key-value system under the multi-core architecture while ensuring correct semantics.
本发明的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to, a USB flash drive, a read-only memory (Read-Only Memory, referred to as ROM for short), and a random access memory (Random Access Memory, referred to as RAM for short) , mobile hard disk, magnetic disk or CD-ROM and other media that can store computer programs.
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides an electronic device, comprising a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and exemplary implementation manners, and details are not described herein again in this embodiment.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices On the other hand, they can be implemented in program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, can be performed in a different order than shown here. Or the described steps, or they are respectively made into individual integrated circuit modules, or a plurality of modules or steps in them are made into a single integrated circuit module to realize. As such, the present invention is not limited to any particular combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included within the protection scope of the present invention.

Claims (17)

  1. 一种持久性内存键值系统的操作方法,包括:A method of operation of a persistent memory key-value system, comprising:
    查找持久性内存键值系统的索引以定位待插入的键值对元数据;Look up the index of the persistent memory key-value system to locate the key-value pair metadata to be inserted;
    获取动态随机存取存储器中与所述键值对元数据对应的写锁资源;obtaining the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory;
    为所述键值对元数据分配持久性内存,并持久化所述键值对元数据;Allocating persistent memory for the key-value pair metadata, and persisting the key-value pair metadata;
    在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键值对元数据插入的提交过程包括两个阶段,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。The key-value pair metadata is atomically inserted into the persistent memory key-value system, wherein the commit process of the key-value pair metadata insertion includes two stages. Clear the persistent flag bit in the metadata, and call the CPU persistent instruction to flush it from the CPU cache to persistent memory; in the second stage, set the persistent flag bit and notify the read operation of the key value The metadata has been successfully persisted.
  2. 根据权利要求1所述的方法,其中,在获取动态随机存取存储器中与所述键值对元数据对应的写锁资源之前,还包括;The method according to claim 1, wherein before acquiring the write lock resource corresponding to the key-value pair metadata in the dynamic random access memory, the method further comprises:
    将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动态随机存取存储器中维护所述写锁资源。The write lock resource is decoupled from the index of the persistent memory key-value system, and the write lock resource is maintained in the dynamic random access memory.
  3. 根据权利要求2所述的方法,其中,所述写锁资源在所述动态随机存取存储器中以表结构被维护,其中,所述表结构的输入为索引的节点地址,所述表结构的输出为对应的所述写锁资源。The method of claim 2, wherein the write lock resource is maintained in the dynamic random access memory in a table structure, wherein the input of the table structure is the node address of the index, the The output is the corresponding write lock resource.
  4. 根据权利要求1所述的方法,其中,在所述持久性内存键值系统中原子地插入所述键值对元数据之前,还包括:The method of claim 1, wherein prior to atomically inserting the key-value pair metadata in the persistent memory key-value system, further comprising:
    将所述键值对元数据存储为可原子修改的格式。The key-value pair metadata is stored in an atomically modifiable format.
  5. 根据权利要求4所述的方法,其中,所述可原子修改的格式指所述键值对元数据被包装到连续的持久性内存空间,并支持被CPU原子地修改。5. The method of claim 4, wherein the atomically modifiable format means that the key-value pair metadata is packed into a contiguous persistent memory space and supports atomic modification by the CPU.
  6. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    当相冲突的第一插入操作和第二插入操作同时发生时,不对所述第一插入操作进行持久性内存的分配和写入,将所述第一插入操作返回。When the conflicting first insert operation and the second insert operation occur at the same time, the persistent memory allocation and writing are not performed for the first insert operation, and the first insert operation is returned.
  7. 根据权利要求1所述的方法,其中,所述键值对元数据至少包括以下之一:键值对指纹、键值对地址以及持久化标志位;其中,所述键值对指纹为键的哈希值的其中若干位,所述键值对地址指向持久性内存中的键值对,所述持久性标志位指示所述键值对元数据的持久化状态。The method according to claim 1, wherein the key-value pair metadata includes at least one of the following: a key-value pair fingerprint, a key-value pair address, and a persistent flag; wherein the key-value pair fingerprint is a key-value pair fingerprint. Among several bits of the hash value, the address of the key-value pair points to the key-value pair in the persistent memory, and the persistence flag indicates the persistent state of the metadata of the key-value pair.
  8. 根据权利要求1所述的方法,其中,在将所述键值对元数据原子地插入所述持久性内存键值系统之后,还包括:The method of claim 1, wherein after atomically inserting the key-value pair metadata into the persistent memory key-value system, further comprising:
    在所述持久性内存键值系统中无锁地查询所述键值对元数据。The key-value pair metadata is queried lock-free in the persistent memory key-value system.
  9. 根据权利要求8所述的方法,其中,无锁地查询所述键值对元数据包括:The method of claim 8, wherein querying the key-value pair metadata lock-free comprises:
    检查所述键值对元数据中的持久性标志位,若所述持久性标志位为清空状态,则调用CPU持久化指令持久化所述目标键值对元数据;Check the persistence flag bit in the key-value pair metadata, if the persistence flag bit is in a clear state, call the CPU persistence instruction to persist the target key-value pair metadata;
    调用原子指令设置所述持久性标志位,并读取元数据指向的键值对。Call the atomic instruction to set the persistent flag, and read the key-value pair pointed to by the metadata.
  10. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    基于时间周期的内存回收方式,通过后台线程周期性回收持久性内存垃圾。A time-cycle-based memory recycling method that periodically recycles persistent memory garbage through background threads.
  11. 一种持久性内存键值系统,包括:A persistent memory key-value system that includes:
    查找模块,设置为查找持久性内存键值系统的索引以定位待插入的键值对元数据;A lookup module, set to look up the index of the persistent memory key-value system to locate the key-value pair metadata to be inserted;
    获取模块,设置为获取动态随机存取存储器中与所述键值对元数据对应的写锁资源;an acquisition module, configured to acquire the write lock resource corresponding to the metadata of the key-value pair in the dynamic random access memory;
    分配模块,设置为为所述键值对元数据分配持久性内存,并持久化所述键值对元数据;an allocation module, configured to allocate persistent memory for the key-value pair metadata, and persist the key-value pair metadata;
    插入模块,设置为在所述持久性内存键值系统中原子地插入所述键值对元数据,其中,所述键值对元数据插入的提交过程包括两个阶段,其中,在第一阶段中,将所述键值对元数据中持久性标志位清空,并调用CPU持久化指令将其从CPU缓存刷写至持久性内存;在第二阶段中,设置所述持久性标志位,并通知读操作所述键值对元数据已经被成功持久化。an insertion module, configured to atomically insert the key-value pair metadata in the persistent memory key-value system, wherein the submission process of the key-value pair metadata insertion includes two stages, wherein in the first stage , clear the persistent flag bit in the metadata of the key-value pair, and call the CPU persistent instruction to flush it from the CPU cache to persistent memory; in the second stage, set the persistent flag bit, and Notifies read operations that the key-value pair metadata has been successfully persisted.
  12. 根据权利要求11所述的系统,还包括;The system of claim 11, further comprising;
    维护模块,设置为将所述写锁资源从持久性内存键值系统的索引中分离,并在所述动态随机存取存储器中维护所述写锁资源。A maintenance module, configured to separate the write lock resource from the index of the persistent memory key-value system, and maintain the write lock resource in the dynamic random access memory.
  13. 根据权利要求11所述的系统,还包括:The system of claim 11, further comprising:
    存储模块,设置为将所述键值对元数据存储为可原子修改的格式。A storage module, configured to store the key-value pair metadata in an atomically modifiable format.
  14. 根据权利要求11所述的系统,还包括:The system of claim 11, further comprising:
    查询模块,设置为在所述持久性内存键值系统中无锁地查询所述键值对元数据。A query module, configured to query the key-value pair metadata in the persistent memory key-value system without lock.
  15. 根据权利要求11所述的系统,还包括:The system of claim 11, further comprising:
    回收模块,设置为基于时间周期的内存回收方式,通过后台线程周期性回收持久性内存垃圾。The recycling module is set to the memory recycling method based on the time period, and the persistent memory garbage is periodically recycled through the background thread.
  16. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求1至10任一项中所述的方法的步骤。A computer-readable storage medium storing a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 10 when the computer program is executed by a processor .
  17. 一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现所述权利要求1至10任一项中所述的方法的步骤。An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the claims 1 to 10 when executing the computer program The steps of the method of any one.
PCT/CN2021/124463 2020-11-04 2021-10-18 Persistent memory key value system and operation method therefor WO2022095685A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011218384.6 2020-11-04
CN202011218384.6A CN113485946A (en) 2020-11-04 2020-11-04 Persistent memory key value system and operation method thereof

Publications (1)

Publication Number Publication Date
WO2022095685A1 true WO2022095685A1 (en) 2022-05-12

Family

ID=77932594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124463 WO2022095685A1 (en) 2020-11-04 2021-10-18 Persistent memory key value system and operation method therefor

Country Status (2)

Country Link
CN (1) CN113485946A (en)
WO (1) WO2022095685A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117131012A (en) * 2023-08-28 2023-11-28 中国科学院软件研究所 Sustainable and extensible lightweight multi-version ordered key value storage system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485946A (en) * 2020-11-04 2021-10-08 中兴通讯股份有限公司 Persistent memory key value system and operation method thereof
CN113608804B (en) * 2021-10-11 2022-01-04 北京华品博睿网络技术有限公司 Persistent Java off-heap cache system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107479833A (en) * 2017-08-21 2017-12-15 中国人民解放军国防科技大学 Key value storage-oriented remote nonvolatile memory access and management method
US9852146B1 (en) * 2015-03-20 2017-12-26 EMC IP Holding Company LLC Distributed metadata servers for cluster file systems using shared low latency persistent key-value metadata store
CN107728937A (en) * 2017-09-15 2018-02-23 上海交通大学 A kind of key-value pair persistence methods and system using Nonvolatile memory medium
CN108897642A (en) * 2018-06-27 2018-11-27 清华大学 The optimization method and device of log mechanism in persistence transactional memory system
CN113485946A (en) * 2020-11-04 2021-10-08 中兴通讯股份有限公司 Persistent memory key value system and operation method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9852146B1 (en) * 2015-03-20 2017-12-26 EMC IP Holding Company LLC Distributed metadata servers for cluster file systems using shared low latency persistent key-value metadata store
CN107479833A (en) * 2017-08-21 2017-12-15 中国人民解放军国防科技大学 Key value storage-oriented remote nonvolatile memory access and management method
CN107728937A (en) * 2017-09-15 2018-02-23 上海交通大学 A kind of key-value pair persistence methods and system using Nonvolatile memory medium
CN108897642A (en) * 2018-06-27 2018-11-27 清华大学 The optimization method and device of log mechanism in persistence transactional memory system
CN113485946A (en) * 2020-11-04 2021-10-08 中兴通讯股份有限公司 Persistent memory key value system and operation method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117131012A (en) * 2023-08-28 2023-11-28 中国科学院软件研究所 Sustainable and extensible lightweight multi-version ordered key value storage system
CN117131012B (en) * 2023-08-28 2024-04-16 中国科学院软件研究所 Sustainable and extensible lightweight multi-version ordered key value storage system

Also Published As

Publication number Publication date
CN113485946A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
WO2022095685A1 (en) Persistent memory key value system and operation method therefor
US10282122B2 (en) Methods and systems of a memory controller for hierarchical immutable content-addressable memory processor
US8209499B2 (en) Method of read-set and write-set management by distinguishing between shared and non-shared memory regions
EP3642722B1 (en) Mechanism for reducing page migration overhead in memory systems
US8245008B2 (en) System and method for NUMA-aware heap memory management
US8788543B2 (en) Scalable, concurrent resizing of hash tables
US8453015B2 (en) Memory allocation for crash dump
US7716448B2 (en) Page oriented memory management
CN109871386B (en) Multi-version concurrency control (MVCC) in non-volatile memory
WO2008082684A2 (en) System and method for optimistic creation of thread local objects in a virtual machine environment
US9208082B1 (en) Hardware-supported per-process metadata tags
US7500073B1 (en) Relocation of virtual-to-physical mappings
US7711921B2 (en) Page oriented memory management
US11687392B2 (en) Method and system for constructing persistent memory index in non-uniform memory access architecture
US12019629B2 (en) Hash-based data structure
US9223780B2 (en) Non-blocking caching technique
Chen et al. Lock-free high-performance hashing for persistent memory via PM-aware holistic optimization
US20080034022A1 (en) System and method for updating references when incrementally compacting a heap
Moreno et al. Releasing Memory with Optimistic Access: A Hybrid Approach to Memory Reclamation and Allocation in Lock-Free Programs
Singh et al. Efficient hardware primitives for immediate memory reclamation in optimistic data structures
US7464237B2 (en) System and method for implementing a fast file synchronization in a data processing system
US12019548B2 (en) Systems and methods for a cross-layer key-value store architecture with a computational storage device
US20230333984A1 (en) Systems and methods for a cross-layer key-value store with a computational storage device
Coccimiglio¹ et al. Check for updates The Fence Complexity of Persistent Sets
CN116302550A (en) Memory exchange method, memory exchange device, computer equipment and storage medium

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: 21888382

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.09.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21888382

Country of ref document: EP

Kind code of ref document: A1