WO2021227747A1 - Method and device for operating data, and method and device for managing persistent skip list - Google Patents

Method and device for operating data, and method and device for managing persistent skip list Download PDF

Info

Publication number
WO2021227747A1
WO2021227747A1 PCT/CN2021/086966 CN2021086966W WO2021227747A1 WO 2021227747 A1 WO2021227747 A1 WO 2021227747A1 CN 2021086966 W CN2021086966 W CN 2021086966W WO 2021227747 A1 WO2021227747 A1 WO 2021227747A1
Authority
WO
WIPO (PCT)
Prior art keywords
pointer
node
format
persistent
dirty bit
Prior art date
Application number
PCT/CN2021/086966
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 WO2021227747A1 publication Critical patent/WO2021227747A1/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/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery

Definitions

  • the present disclosure generally relates to the technical field of data operations of persistent memory devices (PMEM), and more specifically, to methods and devices for data operations of persistent memory devices and methods and devices for managing persistent jump tables .
  • PMEM persistent memory devices
  • FLUSH has nothing to do with the order in which the data is modified, and is determined by the CPU itself.
  • the program can achieve its goal by executing an additional instruction (CLFLUSH/CLWB), but these instructions cannot be combined with traditional CAS to form an atomic operation. Therefore, in some cases, the use of traditional CAS will cause data inconsistency after power failure.
  • X is controlled by thread 1, and its initial value is 1, and Y needs to always maintain its value equal to X+1, which is controlled by thread 2. Since CAS+FLUSH is not an atomic operation, threads 1 and 2 may be executed in the order shown in Figure 1. Therefore, if the system is powered off before the flush (X) of thread 1, the new value of X is not actually written after recovery.
  • the prior art can use a flush-on-read mechanism to solve the above problems in terms of correctness, that is, perform a FLUSH on the read data before CAS, but in the current system, there is a lack of determining whether the read data is The FLUSH method is required.
  • a large number of CAS is used in the implementation of lock-free jump tables. If FLUSH is performed before each CAS, a large number of unnecessary FLUSH will be generated, and FLUSH itself is a very time-consuming operation.
  • the prior art can also use Cacheline flush instructions (CLFLUSH/CLWB) to solve the above problems, but these instructions themselves are atomic operations only when the amount of flush data is less than or equal to 64 bytes (64B). A power failure occurs during the flush operation for data with a volume> 64B. After the system is restarted and restored, data with a data volume> 64B may have data inconsistencies caused by only part of the data being updated.
  • Exemplary embodiments of the present disclosure are to provide a method and device for operating data and a method and device for managing a persistent skip table, so as to at least solve the above-mentioned problems in the prior art.
  • a method for manipulating data may include: reading a first pointer sp having a specific format, wherein the specific format includes at least an address part and a dirty bit; The dirty bit of the pointer sp determines whether to perform a flush operation on the first pointer sp; the first pointer sp is modified to point to a new address by comparing and exchanging CAS operations.
  • an apparatus for manipulating data may include: a reading module configured to read a first pointer sp having a specific format, wherein the specific format includes at least an address part And a dirty bit; and a processing module configured to: determine whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp; and modify the first pointer sp to point to a new address by comparing and exchanging CAS operations.
  • a method for managing a persistent jump table may include: generating a persistent jump table based on a pointer with a first format and a pointer with a second format; and All the pointers in the first format and the key-value pairs and heights of all nodes in the persistent jump table are stored in a persistent storage device, where the first format includes at least the address part and the dirty bit, and the second format only includes the address Part, the dirty bit is used to determine whether to perform a flush operation on the pointer with the first format, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, and the persistent The next pointer of each node in the upper-level linked list except for the bottom-level linked list in the jump list has the second format.
  • an apparatus for managing a persistent jump table may include: a processing unit configured to generate a persistent table based on a pointer with a first format and a pointer with a second format.
  • a jump table ; and the storage unit is configured to store all pointers in the persistent jump table with the first format and the key-value pairs and heights of all nodes in the persistent storage device, wherein the first format includes at least The address part and the dirty bit.
  • the second format only includes the address part.
  • the dirty bit is used to determine whether to perform a flush operation on the pointer with the first format, wherein each node in the underlying linked list in the persistent jump table The next pointer of has the first format, and the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump table has the second format.
  • a computer-readable storage medium storing instructions, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the operation data described above.
  • a system including at least one computing device and at least one storage device storing instructions, wherein, when the instructions are executed by the at least one computing device, the at least one computing device The device executes the following steps of the method for operating data: reading a first pointer sp with a specific format, wherein the specific format includes at least an address part and a dirty bit; determining whether to check the first pointer sp according to the dirty bit of the first pointer sp Perform a flush operation; modify the first pointer sp to point to the new address by comparing and exchanging CAS operations.
  • a system including at least one computing device and at least one storage device storing instructions, wherein, when the instructions are executed by the at least one computing device, the at least one computing device The device executes the following steps of the method for managing a persistent jump table: generates a persistent jump table based on the pointers with the first format and the pointers with the second format; and all of the persistent jump tables have the first format
  • the pointers and the key-value pairs and heights of all nodes are stored in a persistent storage device.
  • the first format includes at least an address part and a dirty bit
  • the second format only includes an address part.
  • the dirty bit is used to determine whether the pair has The pointer in the first format executes the flush operation, wherein the next pointer of each node in the bottom-level linked list in the persistent jump table has the first format, and the persistent jump table is in addition to the bottom-level linked list The next pointer of each node in the upper linked list has the second format.
  • the method and device for manipulating data avoid unnecessary flushes by using a new smart pointer, realize an efficient PMEM-based CAS, and can solve the problem of data inconsistency caused by the CAS in the PMEM.
  • the method and device for managing a persistent jump table use the above-mentioned smart pointer to replace the traditional memory address pointer, and realize a persistent concurrent lock-free jump table.
  • FIG. 1 is a diagram showing an example of DRAM-based CAS operation in the related art
  • FIG. 2 is a diagram showing a normal pointer in the related art and a smart pointer according to an exemplary embodiment of the present disclosure
  • FIG. 3 is a general flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure
  • FIG. 4 is a detailed flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure
  • FIG. 5 is a block diagram showing an apparatus for manipulating data according to an exemplary embodiment of the present disclosure
  • FIG. 6 is a flowchart illustrating a method of managing a persistent skip table according to an exemplary embodiment of the present disclosure
  • FIG. 7 is a diagram showing examples of a traditional DRAM-based jump table and a PEME-based persistent jump table according to an exemplary embodiment of the present disclosure
  • FIG. 8 is a flowchart illustrating a process of modifying the underlying linked list of a persistent jump table based on PMEM according to an exemplary embodiment of the present disclosure
  • FIG. 9 is a flowchart illustrating a process of restoring a persistent skip table based on PMEM according to an exemplary embodiment of the present disclosure
  • FIG. 10 is a diagram illustrating a pseudo code of a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure
  • FIG. 11 is a block diagram showing an apparatus for managing a persistent skip table according to an exemplary embodiment of the present disclosure.
  • FIG. 2 is a diagram showing a normal pointer in the related art and a smart pointer according to an exemplary embodiment of the present disclosure.
  • the memory address used in the X86 64-bit CUP-based computer programming is 64 bits.
  • the ordinary pointer 101 in the prior art uses a 64-bit unsigned integer variable to store the pointed memory address, while the X86
  • the 8-byte CAS atomic operation supported in the 64-bit CPU must ensure 8-byte alignment. Since the basic unit of memory access is 1 byte, 8-byte alignment means the lowest 3 of the address that supports 8-byte CAS atomic operations. The ones place is always 0.
  • the smart pointer 102 has a specific format including at least an address part addr and a dirty bit dirty_flag.
  • the dirty_flag according to an exemplary embodiment of the present disclosure is at least one of the lowest 3 bits of the smart pointer 102 (that is, in the last reserved part of the smart pointer 102 in FIG. At least one bit), and the address part addr is the part of the smart pointer 102 excluding the lowest 3 bits, and the address part addr is used to store the memory address.
  • the dirty bit dirty_flag can be used to indicate whether a flush operation is required when the smart pointer 102 is accessed next time.
  • the dirty_flag is the first value (for example, 1), it means that the smart pointer 102 needs to be flushed the next time the smart pointer 102 is accessed. If the dirty_flag is the second value (for example, 0), it means the next time the smart pointer 102 is accessed. When accessing the smart pointer 102, there is no need to perform a flush operation on the smart pointer 102.
  • FIG. 3 is a general flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure.
  • step S301 the first pointer sp with the specific format is read, where the specific format includes at least the address part addr and the dirty bit dirtyflag, in other words, the first pointer sp has
  • the structure of the smart pointer 102 shown in FIG. 2 is a smart pointer.
  • step S302 it is determined whether to perform a flush operation on the first pointer sp according to the dirty flag of the first pointer sp.
  • step S303 the first pointer sp is modified to point to the new address by comparing and exchanging CAS operations. This will be described in detail below with reference to FIG. 4.
  • FIG. 4 is a detailed flowchart illustrating a method of manipulating data according to an exemplary embodiment of the present disclosure.
  • step S401 ie, S301
  • the first pointer sp with the specific format is read to obtain the address part addr and the dirty flag of the first pointer sp.
  • step S402 it is determined whether the dirty flag of the first pointer sp is the first value (for example, 1);
  • step S403 If the dirty flag of the first pointer sp is the first value (for example, 1), in step S403, the dirty flag of the first pointer sp is set to the second value (for example, 0), and the flush operation is performed on the first pointer sp. , And proceed to step S404.
  • the first value and the second value are different and can be any two values that are different from each other. If the dirty flag of the first pointer sp is the second value (for example, 0), the flush operation is not performed on the first pointer sp, and step S404 is directly performed. That is, step S302 includes step S402 and step S403.
  • step S404 a second pointer sp_old and a third pointer sp_new having the specific format are created.
  • step S405 the second pointer sp_old is pointed to the address part addr of the first pointer sp, and the dirty flag of the second pointer sp_old is set to a second value (for example, 0).
  • step S406 the third pointer sp_new is pointed to the new address, and the dirty bit dirty_flag of the third pointer sp_new is set to a first value (for example, 1).
  • a first value for example, 1.
  • step S407 a CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new, that is, CAS (sp, sp_old, sp_new). Specifically, first judge whether sp and sp_old are equal, if sp and sp_old are equal, then modify sp to sp_new and end. If sp and sp_old are not equal, return to step S401. That is, step S303 includes step S404 to step S407. From the above description, it can be seen that after the successful CAS operation based on the smart pointer, the dirty flag of the smart pointer must be 1.
  • FIG. 5 shows a block diagram of an apparatus 100 for operating data according to an exemplary embodiment of the present disclosure.
  • the device 100 may include a reading module 110 and a processing module 120.
  • the reading module 110 may be configured to read the first pointer sp with a specific format, where the specific format includes at least an address part addr and a dirty bit dirtyflag, where the dirty bit dirtyflag may be a smart bit as shown in FIG. 2 At least one of the lowest 3 bits of the pointer 102.
  • the processing module 120 may be configured to determine whether to perform a flush operation on the first pointer sp according to the dirty flag of the first pointer sp, and modify the first pointer sp to point to a new address by comparing and exchanging CAS operations.
  • the processing module 120 may determine whether to perform a flush operation on the first pointer sp through the following operations: First, determine whether the dirty flag of the first pointer sp is the first value (for example, 1); if the first pointer sp is If the dirty bit dirtyflag is the first value (for example, 1), the dirty flag of the first pointer sp is set to the second value (for example, 0) and the flush operation is performed on the first pointer sp. If the dirty flag of the first pointer sp is dirtyflag If the value is the second value (for example, 0), the flush operation is not performed on the first pointer sp.
  • the processing module 120 can modify the first pointer sp to point to the new address through the following operations: First, create a new address with the specific format The second pointer sp_old and the third pointer sp_new; then, the second pointer sp_old points to the address part addr of the first pointer sp, and the dirty flag of the second pointer sp_old is set to the second value (for example, 0); after that, the The third pointer sp_new points to the new address, and the dirty flag of the third pointer sp_new is set to the first value (for example, 1); finally, the CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new , That is, CAS (sp, sp_old, sp_new).
  • the method and device for operating data based on smart pointers can avoid unnecessary flush operations, implement efficient PMEM-based CAS, and can solve the problem of data inconsistency caused by CAS in PMEM.
  • FIG. 6 is a flowchart illustrating a method of managing a persistent skip table according to an exemplary embodiment of the present disclosure.
  • a persistent jump table is generated according to the pointer with the first format and the pointer with the second format, where the persistent jump table is a persistent lock-free jump table.
  • the first format includes at least the address part addr and the dirty bit dirtyflag.
  • the dirty bit dirtyflag is used to determine whether to perform a flush operation on the pointer with the first format, and the dirty bit dirtyflag in the first format is one of the lowest 3 bits of the pointer.
  • At least one bit, in other words, the first format is the format of the smart pointer 102 shown in FIG. 2.
  • the second format only includes the address part, in other words, the second format is the format of the ordinary pointer 101 shown in FIG. 2.
  • a persistent jump table can be generated according to an existing method of generating a common jump table, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, and the The next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list has the second format.
  • the dirty flag in the next pointer of each node in the underlying linked list in the persistent jump table is initialized to 1. Since the process of generating a jump table according to the existing method of generating a common jump table is well known to those skilled in the art, it will not be described in detail here.
  • step S602 all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table are stored in a persistent storage device. This will be described in detail below with reference to FIG. 7.
  • FIG. 7 is a diagram showing examples of a traditional DRAM-based jump table and a PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure.
  • the next pointer of the node in each level of the DRAM-based traditional jump table is a pointer in the second format (ie, the ordinary pointer 101 in FIG. 2).
  • the next pointers of the nodes in the underlying linked list of the PMEM-based persistent jump table are all pointers with the first format (that is, the smart pointer 102 in Figure 2), while the PMEM-based persistent jump table except for the underlying linked list
  • the next pointers of nodes in the linked lists of other layers are pointers with the second format, that is to say, the nodes in the underlying linked list of the persistent jump table based on PMEM include key-value pairs (that is, the key value k and the value v),
  • the next pointer that is, the smart pointer 102 in Figure 2 and height (height) with the first format.
  • the nodes in the persistent jump table except for the underlying linked list include key-value pairs (ie key The value k and the value v) and the next pointer in the second format (ie, the ordinary pointer 101 in FIG. 2).
  • key-value pairs ie key The value k and the value v
  • next pointer in the second format ie, the ordinary pointer 101 in FIG. 2.
  • next pointers of nodes in the linked list of other layers can be reconstructed on the basis of the underlying linked list during the recovery process of the persistent jump list, so the next pointers of nodes in the linked lists of other layers except the underlying linked list are set as Figure 2 Ordinary pointer 101 in.
  • FIG. 8 is a flowchart illustrating a process of modifying the underlying linked list of a PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure.
  • step S801 is first performed to read the next pointer sp of any one of the nodes, where the next pointer of any one of the nodes in the bottom-level linked list is
  • the pointer sp is a pointer having the structure of the smart pointer 102 in FIG. 2, therefore, the address part addr and the dirty bit dirtyflag of the next pointer sp can be obtained during the reading process.
  • step S802 it is determined whether the dirty flag of the next pointer sp of any node is the first value.
  • step S803 If the dirty flag of the next pointer sp of any node is the first value (for example, 1), proceed to step S803 to set the dirty flag of the next pointer sp of the any node to the second value (for example, 1). 0), perform a flush operation on the next pointer sp of any node, and proceed to step S804. If the dirty flag of the next pointer sp of any node is the second value (for example, 0), then the flush operation is not performed on the next pointer sp of any node, and the process proceeds directly to step S804.
  • the dirty flag of the next pointer sp of any node is the second value (for example, 0)
  • the flush operation is not performed on the next pointer sp of any node, and the process proceeds directly to step S804.
  • step S804 the next pointer sp of any node is modified to point to the new address by comparing and exchanging CAS operations.
  • the step of modifying the next pointer sp of any node to point to a new address by comparing and exchanging CAS operations may include: creating a pointer sp_old and a pointer sp_new having the first format; and pointing the pointer sp_old to any one The address part of the next pointer sp of the node, and set the dirty bit of the pointer sp_old to the second value; set the pointer sp_new to the new address, and set the dirty bit of the pointer sp_new to the first value; for any node
  • the next pointer sp, the pointer sp_old and the pointer sp_new perform CAS operations.
  • the dirty flag of the next pointer sp of any node will be set to 1. Since this process is similar to step S404 to step S407 in FIG. 4, the description will not be repeated.
  • the CAS operation based on the common pointer 101 can be used to implement the process, that is, read except the bottom-level linked list.
  • the next pointer sp of the any one of the nodes in the upper-level linked list create a pointer sp_old and a pointer sp_new with the second format, and point the pointer sp_old to any node in the upper-level linked list except the bottom-level linked list.
  • the next pointer sp points the pointer sp_new to the new address, and performs CAS operations on the next pointer sp, the pointer sp_old, and the pointer sp_new of any node in the upper linked list except the bottom linked list.
  • the persistent jump is restored by rebuilding the next pointer with the second format in the persistent jump table on the basis of the underlying linked list stored in the persistent storage device. surface. This will be described in detail below with reference to FIGS. 9 and 10.
  • FIG. 9 is a flowchart illustrating a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure.
  • FIG. 10 is a diagram illustrating a pseudo code of a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure.
  • step S901 the head node head of the bottom-level linked list in the persistent jump table is obtained, and the head node head is assigned to the current node node, where the head node is obtained in the process of obtaining the head node head.
  • the key-value pair of the node that is, the key-value k and the data v
  • the next pointer with the first format and the height.
  • max_height-1 represents the maximum value among the heights of all nodes of the PMEM-based persistent jump table stored in the PMEM.
  • the pseudo code part 1010 indicates that the cur[1...max_height-1] pointer array is initialized to the head node of the PMEM-based persistent linked list stored in PMEM, because the PMEM-based persistent jump list is in addition to the underlying linked list
  • the next pointer of each node in the linked list of other layers belongs to the ordinary pointer 101 shown in Figure 2, so cur[i] is assigned the value of head.addr.
  • node represents the current node (in other words, a variable used to represent the current node)
  • head represents the head node, that is, the pseudo code part 1020 represents the assignment of the head node head to the current node
  • the node node determines the current node node as the head node head.
  • step S901 starting from the head node head, proceed to the subsequent steps S902 to S904.
  • step S902 it is determined whether the next pointer of the current node node in the underlying linked list points to the tail node tail.
  • tail represents the tail node
  • node_addr is used to temporarily store the address part addr of the next pointer of the current node node, where the next pointer of the current node node belongs to the smart pointer shown in Figure 2 102.
  • the judgment statement in the while statement in the pseudo code part 1030 indicates whether the next pointer of the current node points to the tail node tail.
  • step S905 the next pointer of the last node of each upper-level linked list is modified to point to the tail node tail, as shown in FIG. 10 Shown in code 1040.
  • FIG. 11 is a block diagram showing an apparatus for managing a persistent skip table according to an exemplary embodiment of the present disclosure.
  • the device 20 includes a processing unit 210 and a storage unit 220.
  • the processing unit 210 may be configured to generate a persistent jump table according to the pointer with the first format and the pointer with the second format, wherein the persistent jump table is a persistent lock-free jump table.
  • the first format includes at least the address part addr and the dirty bit dirtyflag.
  • the dirty bit dirtyflag is used to determine whether to perform a flush operation on the pointer with the first format, and the dirty bit dirtyflag in the first format is one of the lowest 3 bits of the pointer.
  • At least one bit, in other words, the first format is the format of the smart pointer 102 shown in FIG. 2.
  • the second format only includes the address part, in other words, the second format is the format of the ordinary pointer 101 shown in FIG. 2.
  • the processing unit 210 may generate a persistent jump table according to an existing method of generating a common jump table, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, And the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list has the second format.
  • the dirty flag in the next pointer of each node in the underlying linked list in the persistent jump table is initialized to 1. Since the process of generating a jump table according to the existing method of generating a common jump table is well known to those skilled in the art, it will not be described in detail here.
  • the storage unit 220 may be configured to store all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table in the persistent storage device. Since the traditional DRAM-based jump table and the PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure have been described in detail above with reference to FIG. 7, the description will not be repeated here.
  • processing unit 210 operates when modifying any node in the underlying linked list.
  • the processing unit 210 may be configured to read the next pointer sp of any node, where the next pointer sp of any node in the underlying linked list has The structure of the smart pointer 102 in FIG. 2 is a pointer. Therefore, during the reading process, the processing unit 210 can obtain the address part addr and the dirty bit dirtyflag of the next pointer sp.
  • the processing unit 210 may determine whether the dirty bit of the next pointer sp of any one of the nodes is the first value. If the dirty flag of the next pointer sp of any node is the first value (for example, 1), the processing unit 210 may set the dirty flag of the next pointer sp of the any node to the second value (for example, 0). ), perform a flush operation on the next pointer sp of any node, and modify the next pointer sp of any node to point to a new address by comparing and exchanging CAS operations.
  • the processing unit 210 may not perform the flush operation on the next pointer sp of the any node, and compare and exchange CAS operations.
  • the next pointer sp of any node is modified to point to the new address.
  • the processing unit 210 may be configured to modify the first pointer sp to point to the new address through the following operations: create a pointer sp_old and a pointer sp_new with the first format; point the pointer sp_old to the next node of any node The address part of the pointer sp, and the dirty bit of the pointer sp_old is set to the second value; the pointer sp_new is pointed to the new address, and the dirty bit of the pointer sp_new is set to the first value; the next pointer of the any node sp, pointer sp_old and pointer sp_new perform CAS operations.
  • the dirty flag of the next pointer sp of any node will be set to 1. Since this process is similar to step S404 to step S407 in FIG. 4, the description will not be repeated.
  • the processing unit 210 can use the CAS operation based on the common pointer 101 to implement the process, that is, the processor 210 can read the next pointer sp of any node in the upper-level linked list except for the bottom-level linked list, create a pointer sp_old and a pointer sp_new in the second format, and point the pointer sp_old to something other than the bottom-level linked list
  • the next pointer sp of the any node in the upper linked list points the pointer sp_new to the new address, and the next pointer sp, the pointer sp_old, and the pointer sp_new of the any node in the upper linked list except the bottom linked list Perform CAS operations.
  • the processing unit may be configured to rebuild the persistent jump table with the first one in the persistent jump table by the storage unit 220 on the basis of the underlying linked list stored in the persistent storage device.
  • the next pointer in the second format is used to restore the persistent jump table.
  • the processing unit 210 may be configured to restore the persistent skip list through the following operations.
  • the steps include: obtaining the head node of the underlying linked list, and assigning the head node to the current node; starting from the head node, If the next pointer of the current node in the underlying linked list does not point to the tail node, then according to the height of the current node in the underlying linked list, the next pointer of the corresponding level linked list of the previous node of each upper linked list is modified to point to the current node If the next pointer of the current node in the bottom-level linked list points to the tail node, then the next pointer of the last node of each upper-level linked list is modified to point to the tail node. Since this has been described in detail above with reference to FIGS. 9 and 10, the description will not be repeated here.
  • the devices shown in the drawings may be respectively configured as software, hardware, firmware or any combination of the above to perform specific functions.
  • the device may correspond to a dedicated integrated circuit, may also correspond to pure software code, or may correspond to a module combining software and hardware.
  • one or more functions implemented by the apparatus may also be uniformly performed by components in a physical physical device (for example, a processor, a client, or a server, etc.).
  • the method of operating data according to an exemplary embodiment of the present disclosure can be implemented by instructions recorded on a computer-readable storage medium.
  • a computer storing instructions can be provided.
  • a readable storage medium wherein, when the instruction is executed by at least one computing device, the at least one computing device is prompted to perform the following steps: reading a first pointer sp with a specific format, wherein the specific format includes at least an address Part and dirty bit; determine whether to perform flush operation on the first pointer sp according to the dirty bit of the first pointer sp; modify the first pointer sp to point to the new address by comparing and exchanging CAS operations.
  • a computer-readable storage medium storing instructions may be provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is caused to perform the following Steps: generate a persistent jump table according to the pointers with the first format and the pointers with the second format; and combine all the pointers with the first format in the persistent jump table and the key-value pairs and heights of all nodes Stored in a persistent storage device, where the first format includes at least an address part and a dirty bit, and the second format only includes an address part.
  • the dirty bit is used to determine whether to perform a flush operation on a pointer with the first format, wherein, The next pointer of each node in the bottom linked list in the persistent jump list has the first format, and the next pointer of each node in the upper linked list except the bottom linked list in the persistent jump list Has a second format.
  • the instructions stored in the above-mentioned computer-readable storage medium can be executed in an environment deployed in computer equipment such as a client, a host, an agent device, and a server. Processing, the content of these further processing has been mentioned in the description with reference to FIG. 2 to FIG. 4 and FIG. 6 to FIG.
  • the online device of the model according to the exemplary embodiment of the present disclosure can completely rely on the operation of the computer program to realize the corresponding function.
  • the software package (for example, lib library) is called to realize the corresponding function.
  • the device for operating data may also be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof.
  • the program code or code segment used to perform the corresponding operation can be stored in a computer-readable medium such as a storage medium, so that the processor can read and run the corresponding program Code or code segment to perform the corresponding operation.
  • a system including at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one A computing device executes the following steps: reading a first pointer sp with a specific format, where the specific format includes at least an address part and a dirty bit; determining whether to flush the first pointer sp according to the dirty bit of the first pointer sp Operation: The first pointer sp is modified to point to the new address by comparing and exchanging CAS operations.
  • a system including at least one computing device and at least one storage device storing instructions may be provided, wherein the instructions, when executed by the at least one computing device, cause The at least one computing device executes the following steps: generating a persistent jump table based on the pointers with the first format and the pointers with the second format; and storing all pointers in the persistent jump table with the first format And the key-value pairs and heights of all nodes are stored in a persistent storage device, where the first format includes at least an address part and a dirty bit, and the second format only includes an address part, and the dirty bit is used to determine whether the pair has the first
  • the format pointer executes the flush operation, wherein the next pointer of each node in the bottom-layer linked list in the persistent jump table has the first format, and the upper layer in the persistent jump table except the bottom-layer linked list The next pointer of each node in the linked list has the second format.
  • the instructions stored in the above at least one storage device may also perform more specific processing when performing the above steps, and the content of these further processing has been mentioned in the description with reference to FIGS. 2 to 4 and FIGS. 6 to 10 , So in order to avoid repetition here will not repeat them.
  • the above-mentioned system can be deployed in a server or a client, and can also be deployed on a node in a distributed network environment.
  • the system may be a PC computer, a tablet device, a personal digital assistant, a smart phone, a web application, or other devices capable of executing the above set of instructions.
  • the system may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.).
  • all components of the system may be connected to each other via a bus and/or a network.
  • the system does not have to be a single system, and may also be any collection of devices or circuits that can execute the above-mentioned instructions (or instruction sets) individually or jointly.
  • the system may also be a part of an integrated control system or a system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
  • the at least one computing device may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor.
  • the at least one computing device may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like.
  • the computing device can run instructions or codes stored in one of the storage devices, where the storage device can also store data. Instructions and data can also be sent and received via a network via a network interface device, wherein the network interface device can use any known transmission protocol.
  • the storage device can be integrated with the computing device, for example, RAM or flash memory is arranged in an integrated circuit microprocessor or the like.
  • the storage device may include a stand-alone device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system.
  • the storage device and the computing device may be operatively coupled, or may communicate with each other, for example, through an I/O port, a network connection, etc., so that the computing device can read the instructions stored in the storage device.
  • the method and device for manipulating data according to the exemplary embodiments of the present disclosure can be used to perform CAS in PMEM.
  • a new smart pointer By using a new smart pointer, unnecessary flushes are avoided, and efficient PMEM-based CAS is realized.
  • it can solve the problem of CAS in PMEM. Data inconsistency caused by the problem.
  • the method and device for managing a persistent jump table according to the exemplary embodiments of the present disclosure use the above-mentioned smart pointer to replace the traditional memory address pointer, and realize a persistent concurrent lock-free jump table.

Landscapes

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

Abstract

Provided are a method and device for operating data, and a method and device for managing a persistent skip list. The method for operating data comprises: reading a first pointer sp having a specific format, wherein the specific format comprises at least an address portion and a dirty bit; determining, according to the dirty bit of the first pointer sp, whether or not to perform a flush operation on the first pointer sp; and modifying, by means of a compare-and-swap (CAS) operation, the first pointer sp such that the first pointer sp points to a new address.

Description

操作数据的方法和装置以及管理持久化跳表的方法和装置Method and device for operating data and method and device for managing persistent jump tables
本申请要求申请号为202010398318.5,申请日为2020年5月12日,发明名称为“操作数据的方法和装置以及管理持久化跳表的方法和装置”的中国专利申请的优先权,其中,该中国专利申请的内容通过引用结合在本公开中。This application requires the priority of a Chinese patent application whose application number is 202010398318.5, the filing date is May 12, 2020, and the invention title is "Method and device for operating data and method and device for managing persistent jump tables". The content of the Chinese patent application is incorporated in this disclosure by reference.
技术领域Technical field
本公开总体说来涉及持久化内存设备(Persistent Memory,PMEM)的数据操作的技术领域,更具体地讲,涉及持久化内存设备的数据操作的方法和装置以及管理持久化跳表的方法和装置。The present disclosure generally relates to the technical field of data operations of persistent memory devices (PMEM), and more specifically, to methods and devices for data operations of persistent memory devices and methods and devices for managing persistent jump tables .
背景技术Background technique
现有的并发无锁跳表都是基于比较并交换(Compare and Swap,CAS)操作实现的,但是PMEM不同于DRAM的地方在于持久化特性,即在断电时数据不会丢失。在现有计算机软硬件架构下,程序对内存的读写都会经过CPU中的缓存(基本单元叫做缓存行(Cacheline)),所以对于PMEM中的数据的写操作(包括CAS),并不能保证此被写入的新数据会被立刻写入PMEM。只有当新数据所在的Cacheline被写回PMEM中(即进行缓存行刷新(Cacheline flush),以下简称FLUSH)时,数据才被真正写入PMEM。FLUSH的顺序与数据被修改的顺序无关,由CPU自行决定,程序可以通过额外执行一次指令(CLFLUSH/CLWB)达到目的,但是这些指令无法与传统CAS组合成原子操作。因此在某些情况下,使用传统CAS在断电恢复后会造成数据不一致的问题。例如,如图1中所示,X由线程1控制,初始值为1,Y需要始终保持其值等于X+1,由线程2控制。由于CAS+FLUSH不是原子操作,因此线程1和2可能会按照图1的顺序执行,因此,如果在线程1的flush(X)前***断电,则恢复后由于X的新值未被真正写入PMEM,因此会导致X的值仍为修改前的1,而Y的新值4已经写入PMEM,导致Y≠X+1,进而造成数据不一致的问题。所以现有的CAS无法运用到基于PMEM的持久化数据 结构中。Existing concurrent lock-free skip tables are all implemented based on the Compare and Swap (CAS) operation, but the difference between PMEM and DRAM is the persistence feature, that is, the data will not be lost when the power is off. Under the existing computer software and hardware architecture, the program reads and writes to the memory will pass through the cache in the CPU (the basic unit is called the cache line (Cacheline)), so for the write operation of the data in the PMEM (including CAS), this cannot be guaranteed. The new data written will be written into PMEM immediately. Only when the Cacheline where the new data is located is written back to the PMEM (that is, cache line flush (Cacheline flush, hereinafter referred to as FLUSH)), the data is actually written into the PMEM. The order of FLUSH has nothing to do with the order in which the data is modified, and is determined by the CPU itself. The program can achieve its goal by executing an additional instruction (CLFLUSH/CLWB), but these instructions cannot be combined with traditional CAS to form an atomic operation. Therefore, in some cases, the use of traditional CAS will cause data inconsistency after power failure. For example, as shown in Figure 1, X is controlled by thread 1, and its initial value is 1, and Y needs to always maintain its value equal to X+1, which is controlled by thread 2. Since CAS+FLUSH is not an atomic operation, threads 1 and 2 may be executed in the order shown in Figure 1. Therefore, if the system is powered off before the flush (X) of thread 1, the new value of X is not actually written after recovery. Into PMEM, therefore, the value of X will still be 1 before modification, and the new value of Y 4 has been written into PMEM, resulting in Y≠X+1, which will cause data inconsistency. Therefore, the existing CAS cannot be used in the persistent data structure based on PMEM.
虽然,现有技术可利用读前刷新(flush-on-read)机制从正确性上解决以上问题,即在CAS前对所读数据进行一次FLUSH,但是在现今***中,缺乏判断所读数据是否需要FLUSH的方法。此外,在无锁跳表的实现中大量使用了CAS,如果每个CAS前都进行FLUSH,则会产生大量的不必要的FLUSH,而FLUSH本身是一个非常耗时的操作。此外,现有技术还可利用Cacheline flush指令(CLFLUSH/CLWB)来解决以上问题,但是这些指令本身只有在flush的数据量≤64字节(64B)才是原子操作,这意味着如果在对于数据量>64B的数据执行flush操作的过程中发生断电,则在***重启恢复后,涉及的数据量>64B的数据可能会出现只有部分数据被更新而导致的数据不一致的问题。Although the prior art can use a flush-on-read mechanism to solve the above problems in terms of correctness, that is, perform a FLUSH on the read data before CAS, but in the current system, there is a lack of determining whether the read data is The FLUSH method is required. In addition, a large number of CAS is used in the implementation of lock-free jump tables. If FLUSH is performed before each CAS, a large number of unnecessary FLUSH will be generated, and FLUSH itself is a very time-consuming operation. In addition, the prior art can also use Cacheline flush instructions (CLFLUSH/CLWB) to solve the above problems, but these instructions themselves are atomic operations only when the amount of flush data is less than or equal to 64 bytes (64B). A power failure occurs during the flush operation for data with a volume> 64B. After the system is restarted and restored, data with a data volume> 64B may have data inconsistencies caused by only part of the data being updated.
发明内容Summary of the invention
本公开的示例性实施例在于提供一种操作数据的方法和装置以及管理持久化跳表的方法和装置,以至少解决现有技术存在的上述问题。Exemplary embodiments of the present disclosure are to provide a method and device for operating data and a method and device for managing a persistent skip table, so as to at least solve the above-mentioned problems in the prior art.
根据本公开的第一方面,提供一种操作数据的方法,所述方法可包括:读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;通过比较并交换CAS操作将第一指针sp修改为指向新地址。According to a first aspect of the present disclosure, there is provided a method for manipulating data. The method may include: reading a first pointer sp having a specific format, wherein the specific format includes at least an address part and a dirty bit; The dirty bit of the pointer sp determines whether to perform a flush operation on the first pointer sp; the first pointer sp is modified to point to a new address by comparing and exchanging CAS operations.
根据本公开的第二方面,提供一种操作数据的装置,所述装置可包括:读取模块,被配置为读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;以及处理模块,被配置为:根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;并且通过比较并交换CAS操作将第一指针sp修改为指向新地址。According to a second aspect of the present disclosure, there is provided an apparatus for manipulating data, the apparatus may include: a reading module configured to read a first pointer sp having a specific format, wherein the specific format includes at least an address part And a dirty bit; and a processing module configured to: determine whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp; and modify the first pointer sp to point to a new address by comparing and exchanging CAS operations.
根据本公开的第三方面,提供一种管理持久化跳表的方法,所述方法可包括:根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的 上层链表中的每个节点的next指针具有第二格式。According to a third aspect of the present disclosure, there is provided a method for managing a persistent jump table, the method may include: generating a persistent jump table based on a pointer with a first format and a pointer with a second format; and All the pointers in the first format and the key-value pairs and heights of all nodes in the persistent jump table are stored in a persistent storage device, where the first format includes at least the address part and the dirty bit, and the second format only includes the address Part, the dirty bit is used to determine whether to perform a flush operation on the pointer with the first format, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, and the persistent The next pointer of each node in the upper-level linked list except for the bottom-level linked list in the jump list has the second format.
根据本公开的第四方面,提供一种管理持久化跳表的装置,所述装置可包括:处理单元,被配置为根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且存储单元,被配置为将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。According to a fourth aspect of the present disclosure, there is provided an apparatus for managing a persistent jump table. The apparatus may include: a processing unit configured to generate a persistent table based on a pointer with a first format and a pointer with a second format. A jump table; and the storage unit is configured to store all pointers in the persistent jump table with the first format and the key-value pairs and heights of all nodes in the persistent storage device, wherein the first format includes at least The address part and the dirty bit. The second format only includes the address part. The dirty bit is used to determine whether to perform a flush operation on the pointer with the first format, wherein each node in the underlying linked list in the persistent jump table The next pointer of has the first format, and the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump table has the second format.
根据本公开的第五方面,提供了一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行如上所述的操作数据的方法或如上所述的管理持久化跳表的方法。According to a fifth aspect of the present disclosure, there is provided a computer-readable storage medium storing instructions, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the operation data described above. Method or the method of managing persistent jump tables as described above.
根据本公开的第六方面,提供了一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行操作数据的方法的以下步骤:读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;通过比较并交换CAS操作将第一指针sp修改为指向新地址。According to a sixth aspect of the present disclosure, there is provided a system including at least one computing device and at least one storage device storing instructions, wherein, when the instructions are executed by the at least one computing device, the at least one computing device The device executes the following steps of the method for operating data: reading a first pointer sp with a specific format, wherein the specific format includes at least an address part and a dirty bit; determining whether to check the first pointer sp according to the dirty bit of the first pointer sp Perform a flush operation; modify the first pointer sp to point to the new address by comparing and exchanging CAS operations.
根据本公开的第七方面,提供了一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行管理持久化跳表的方法的以下步骤:根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。According to a seventh aspect of the present disclosure, there is provided a system including at least one computing device and at least one storage device storing instructions, wherein, when the instructions are executed by the at least one computing device, the at least one computing device The device executes the following steps of the method for managing a persistent jump table: generates a persistent jump table based on the pointers with the first format and the pointers with the second format; and all of the persistent jump tables have the first format The pointers and the key-value pairs and heights of all nodes are stored in a persistent storage device. The first format includes at least an address part and a dirty bit, and the second format only includes an address part. The dirty bit is used to determine whether the pair has The pointer in the first format executes the flush operation, wherein the next pointer of each node in the bottom-level linked list in the persistent jump table has the first format, and the persistent jump table is in addition to the bottom-level linked list The next pointer of each node in the upper linked list has the second format.
根据本公开的示例性实施例的操作数据的方法和装置利用新的智能指针避免了不必要的flush,实现了高效的基于PMEM的CAS,同时能够解决CAS 在PMEM中导致的数据不一致的问题。此外,根据本公开的示例性实施例的管理持久化跳表的方法和装置利用上述智能指针取代传统内存地址指针,实现了持久化并发无锁跳表。The method and device for manipulating data according to the exemplary embodiments of the present disclosure avoid unnecessary flushes by using a new smart pointer, realize an efficient PMEM-based CAS, and can solve the problem of data inconsistency caused by the CAS in the PMEM. In addition, the method and device for managing a persistent jump table according to the exemplary embodiments of the present disclosure use the above-mentioned smart pointer to replace the traditional memory address pointer, and realize a persistent concurrent lock-free jump table.
将在接下来的描述中部分阐述本公开总体构思另外的方面和/或优点,还有一部分通过描述将是清楚的,或者可以经过本公开总体构思的实施而得知。Additional aspects and/or advantages of the general concept of the present disclosure will be partially explained in the following description, and some of them will be clear through the description, or can be learned through the implementation of the general concept of the present disclosure.
附图说明Description of the drawings
从下面结合附图对本公开实施例的详细描述中,本公开的这些和/或其他方面和优点将变得更加清楚并更容易理解,其中:From the following detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings, these and/or other aspects and advantages of the present disclosure will become clearer and easier to understand, in which:
图1是示出现有技术中的基于DRAM的CAS操作的示例的示图;FIG. 1 is a diagram showing an example of DRAM-based CAS operation in the related art;
图2是示出现有技术中的普通指针和根据本公开示例性实施例的智能指针的示图;FIG. 2 is a diagram showing a normal pointer in the related art and a smart pointer according to an exemplary embodiment of the present disclosure;
图3是示出根据本公开示例性实施例的操作数据的方法的总流程图;FIG. 3 is a general flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure;
图4是示出根据本公开示例性实施例的操作数据的方法的详细流程图;4 is a detailed flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure;
图5是示出根据本公开示例性实施例的操作数据的装置的框图;FIG. 5 is a block diagram showing an apparatus for manipulating data according to an exemplary embodiment of the present disclosure;
图6是示出根据本公开示例性实施例的管理持久化跳表的方法的流程图;FIG. 6 is a flowchart illustrating a method of managing a persistent skip table according to an exemplary embodiment of the present disclosure;
图7是示出基于DRAM的传统跳表和根据本公开示例性实施例的基于PEME的持久化跳表的示例的示图;7 is a diagram showing examples of a traditional DRAM-based jump table and a PEME-based persistent jump table according to an exemplary embodiment of the present disclosure;
图8是示出根据本公开示例性实施例的修改基于PMEM的持久化跳表的底层链表的过程的流程图;FIG. 8 is a flowchart illustrating a process of modifying the underlying linked list of a persistent jump table based on PMEM according to an exemplary embodiment of the present disclosure;
图9是示出根据本公开示例性实施例的恢复基于PMEM的持久化跳表的过程的流程图;FIG. 9 is a flowchart illustrating a process of restoring a persistent skip table based on PMEM according to an exemplary embodiment of the present disclosure;
图10是示出根据本公开示例性实施例的恢复基于PMEM的持久化跳表的过程的伪代码的示图;FIG. 10 is a diagram illustrating a pseudo code of a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure;
图11是示出根据本公开示例性实施例的管理持久化跳表的装置的框图。FIG. 11 is a block diagram showing an apparatus for managing a persistent skip table according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
现在将详细参照本公开的实施例,所述实施例的示例在附图中示出。以下将通过参照附图来说明所述实施例,以便解释本公开。在此需要说明的是,在本公开中出现的“若干项之中的至少一项”均表示包含“该若干项中的任意一项”、“该若干项中的任意多项的组合”、“该若干项的全体”这三类并列 的情况。例如“包括A和B之中的至少一个”即包括如下三种并列的情况:(1)包括A;(2)包括B;(3)包括A和B。又例如“执行步骤一和步骤二之中的至少一个”,即表示如下三种并列的情况:(1)执行步骤一;(2)执行步骤二;(3)执行步骤一和步骤二。Reference will now be made in detail to the embodiments of the present disclosure, examples of which are shown in the accompanying drawings. The embodiments will be described below in order to explain the present disclosure by referring to the drawings. It should be noted here that "at least one of several items" appearing in the present disclosure all means to include "any one of the several items", "a combination of any multiple of the several items", The three categories of "the totality of the several items" are in parallel. For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "execute at least one of step one and step two", which means the following three parallel situations: (1) perform step one; (2) perform step two; (3) perform step one and step two.
图2是示出现有技术中的普通指针和根据本公开示例性实施例的智能指针的示图。FIG. 2 is a diagram showing a normal pointer in the related art and a smart pointer according to an exemplary embodiment of the present disclosure.
如图2中所示,在基于X86 64位CUP的计算机编程中使用的内存地址是64位,现有技术中的普通指针101使用64位无符号整数型变量来存储指向的内存地址,而X86 64位CPU中支持的8字节CAS原子操作必须保证8字节对齐,由于内存访问的基本单元为1字节,因此8字节对齐意味着支持8字节CAS原子操作的地址的最低的3个位始终为0。As shown in Figure 2, the memory address used in the X86 64-bit CUP-based computer programming is 64 bits. The ordinary pointer 101 in the prior art uses a 64-bit unsigned integer variable to store the pointed memory address, while the X86 The 8-byte CAS atomic operation supported in the 64-bit CPU must ensure 8-byte alignment. Since the basic unit of memory access is 1 byte, 8-byte alignment means the lowest 3 of the address that supports 8-byte CAS atomic operations. The ones place is always 0.
根据本公开示例性实施例的智能指针102具有特定格式,所述特定格式至少包括地址部分addr和脏位dirty_flag。如图2中所示,根据本公开示例性实施例的脏位dirty_flag是智能指针102的最低的3个位中的至少一位(即图2中的智能指针102的最后的预留部分中的至少一位),而地址部分addr是智能指针102的除了最低的3个位以外的部分,该地址部分addr用于存储内存地址。其中,脏位dirty_flag可用于表示在下一次对智能指针102进行访问时是否需要进行flush操作。如果脏位dirty_flag是第一值(例如1),则表示在下一次对智能指针102进行访问时需要对智能指针102执行flush操作,如果脏位dirty_flag是第二值(例如0),则表示在下一次对智能指针102进行访问时不需要对智能指针102执行flush操作。The smart pointer 102 according to an exemplary embodiment of the present disclosure has a specific format including at least an address part addr and a dirty bit dirty_flag. As shown in FIG. 2, the dirty_flag according to an exemplary embodiment of the present disclosure is at least one of the lowest 3 bits of the smart pointer 102 (that is, in the last reserved part of the smart pointer 102 in FIG. At least one bit), and the address part addr is the part of the smart pointer 102 excluding the lowest 3 bits, and the address part addr is used to store the memory address. Among them, the dirty bit dirty_flag can be used to indicate whether a flush operation is required when the smart pointer 102 is accessed next time. If the dirty_flag is the first value (for example, 1), it means that the smart pointer 102 needs to be flushed the next time the smart pointer 102 is accessed. If the dirty_flag is the second value (for example, 0), it means the next time the smart pointer 102 is accessed. When accessing the smart pointer 102, there is no need to perform a flush operation on the smart pointer 102.
下面将详细描述根据本公开示例性实施例的基于图2中的智能指针的操作数据的方法。The method for operating data based on the smart pointer in FIG. 2 according to an exemplary embodiment of the present disclosure will be described in detail below.
图3是示出根据本公开示例性实施例的操作数据的方法的总流程图。FIG. 3 is a general flowchart showing a method of manipulating data according to an exemplary embodiment of the present disclosure.
如图3中所示,在步骤S301,读取具有所述特定格式的第一指针sp,其中,所述特定格式至少包括地址部分addr和脏位dirtyflag,换句话说,第一指针sp是具有图2中所示的智能指针102的结构的智能指针。As shown in FIG. 3, in step S301, the first pointer sp with the specific format is read, where the specific format includes at least the address part addr and the dirty bit dirtyflag, in other words, the first pointer sp has The structure of the smart pointer 102 shown in FIG. 2 is a smart pointer.
在步骤S302,根据第一指针sp的脏位dirtyflag确定是否对第一指针sp执行flush操作。In step S302, it is determined whether to perform a flush operation on the first pointer sp according to the dirty flag of the first pointer sp.
在步骤S303,通过比较并交换CAS操作将第一指针sp修改为指向新地址。下面参照图4对此进行详细描述。In step S303, the first pointer sp is modified to point to the new address by comparing and exchanging CAS operations. This will be described in detail below with reference to FIG. 4.
图4是示出根据本公开示例性实施例的操作数据的方法的详细流程图。FIG. 4 is a detailed flowchart illustrating a method of manipulating data according to an exemplary embodiment of the present disclosure.
如图4中所示,在步骤S401(即S301),读取具有所述特定格式的第一指针sp,以得到第一指针sp的地址部分addr和脏位dirtyflag。As shown in FIG. 4, in step S401 (ie, S301), the first pointer sp with the specific format is read to obtain the address part addr and the dirty flag of the first pointer sp.
在步骤S402,确定第一指针sp的脏位dirtyflag是否为第一值(例如1);In step S402, it is determined whether the dirty flag of the first pointer sp is the first value (for example, 1);
如果第一指针sp的脏位dirtyflag为第一值(例如1),则在步骤S403,将第一指针sp的脏位dirtyflag设置为第二值(例如0),对第一指针sp执行flush操作,并进行到步骤S404。在本文中,第一值与第二值不同且可以是任何互不相同的两个值。如果第一指针sp的脏位dirtyflag为第二值(例如0),则不对第一指针sp执行flush操作,而是直接进行到步骤S404。也就是说,步骤S302包括了步骤S402和步骤S403。If the dirty flag of the first pointer sp is the first value (for example, 1), in step S403, the dirty flag of the first pointer sp is set to the second value (for example, 0), and the flush operation is performed on the first pointer sp. , And proceed to step S404. Here, the first value and the second value are different and can be any two values that are different from each other. If the dirty flag of the first pointer sp is the second value (for example, 0), the flush operation is not performed on the first pointer sp, and step S404 is directly performed. That is, step S302 includes step S402 and step S403.
在步骤S404,创建具有所述特定格式的第二指针sp_old和第三指针sp_new。In step S404, a second pointer sp_old and a third pointer sp_new having the specific format are created.
在步骤S405,将第二指针sp_old指向第一指针sp的地址部分addr,并将第二指针sp_old的脏位dirtyflag设置为第二值(例如0)。In step S405, the second pointer sp_old is pointed to the address part addr of the first pointer sp, and the dirty flag of the second pointer sp_old is set to a second value (for example, 0).
在步骤S406,将第三指针sp_new指向所述新地址,并将第三指针sp_new的脏位dirty_flag设置为第一值(例如1)。步骤S405和步骤S406之间的顺序可互换。In step S406, the third pointer sp_new is pointed to the new address, and the dirty bit dirty_flag of the third pointer sp_new is set to a first value (for example, 1). The order between step S405 and step S406 can be interchanged.
在步骤S407,对第一指针sp、第二指针sp_old和第三指针sp_new执行CAS操作,即,CAS(sp,sp_old,sp_new)。具体地讲,首先判断sp和sp_old是否相等,如果sp和sp_old相等,则将sp修改为sp_new并结束。如果sp和sp_old不相等,则返回步骤S401。也就是说,步骤S303包括了步骤S404至步骤S407。通过以上描述可知,在基于智能指针的CAS操作成功后,智能指针的脏位dirtyflag一定为1。In step S407, a CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new, that is, CAS (sp, sp_old, sp_new). Specifically, first judge whether sp and sp_old are equal, if sp and sp_old are equal, then modify sp to sp_new and end. If sp and sp_old are not equal, return to step S401. That is, step S303 includes step S404 to step S407. From the above description, it can be seen that after the successful CAS operation based on the smart pointer, the dirty flag of the smart pointer must be 1.
图5示出了根据本公开示例性实施例的操作数据的装置100的框图。FIG. 5 shows a block diagram of an apparatus 100 for operating data according to an exemplary embodiment of the present disclosure.
如图5中所示,装置100可包括读取模块110和处理模块120。As shown in FIG. 5, the device 100 may include a reading module 110 and a processing module 120.
读取模块110可被配置为读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分addr和脏位dirtyflag,其中,脏位dirtyflag可以是如图2中所示的智能指针102的最低的3个位中的至少一位。处理模块120可被配置为根据第一指针sp的脏位dirtyflag确定是否对第一指针sp执行flush操作,并且通过比较并交换CAS操作将第一指针sp修改为指向新地址。The reading module 110 may be configured to read the first pointer sp with a specific format, where the specific format includes at least an address part addr and a dirty bit dirtyflag, where the dirty bit dirtyflag may be a smart bit as shown in FIG. 2 At least one of the lowest 3 bits of the pointer 102. The processing module 120 may be configured to determine whether to perform a flush operation on the first pointer sp according to the dirty flag of the first pointer sp, and modify the first pointer sp to point to a new address by comparing and exchanging CAS operations.
具体地讲,处理模块120可通过以下操作来确定是否对第一指针sp执行 flush操作:首先,确定第一指针sp的脏位dirtyflag是否为第一值(例如1);如果第一指针sp的脏位dirtyflag为第一值(例如1),则将第一指针sp的脏位dirtyflag设置为第二值(例如0)并对第一指针sp执行flush操作,如果第一指针sp的脏位dirtyflag为第二值(例如0),则不对第一指针sp执行flush操作。Specifically, the processing module 120 may determine whether to perform a flush operation on the first pointer sp through the following operations: First, determine whether the dirty flag of the first pointer sp is the first value (for example, 1); if the first pointer sp is If the dirty bit dirtyflag is the first value (for example, 1), the dirty flag of the first pointer sp is set to the second value (for example, 0) and the flush operation is performed on the first pointer sp. If the dirty flag of the first pointer sp is dirtyflag If the value is the second value (for example, 0), the flush operation is not performed on the first pointer sp.
在处理模块120通过以上操作确定了是否对第一指针sp执行flush操作之后,处理模块120可通过以下操作来将第一指针sp修改为指向所述新地址:首先,创建具有所述特定格式的第二指针sp_old和第三指针sp_new;然后,将第二指针sp_old指向第一指针sp的地址部分addr,并将第二指针sp_old的脏位dirtyflag设置为第二值(例如0);此后,将第三指针sp_new指向所述新地址,并将第三指针sp_new的脏位dirtyflag设置为第一值(例如1);最后,对第一指针sp、第二指针sp_old和第三指针sp_new执行CAS操作,即,CAS(sp,sp_old,sp_new)。After the processing module 120 determines whether to perform a flush operation on the first pointer sp through the above operations, the processing module 120 can modify the first pointer sp to point to the new address through the following operations: First, create a new address with the specific format The second pointer sp_old and the third pointer sp_new; then, the second pointer sp_old points to the address part addr of the first pointer sp, and the dirty flag of the second pointer sp_old is set to the second value (for example, 0); after that, the The third pointer sp_new points to the new address, and the dirty flag of the third pointer sp_new is set to the first value (for example, 1); finally, the CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new , That is, CAS (sp, sp_old, sp_new).
根据本公开示例性实施例的基于智能指针的操作数据的方法和装置可避免不必要的flush操作,实现了高效的基于PMEM的CAS,同时能够解决CAS在PMEM中导致的数据不一致的问题。The method and device for operating data based on smart pointers according to exemplary embodiments of the present disclosure can avoid unnecessary flush operations, implement efficient PMEM-based CAS, and can solve the problem of data inconsistency caused by CAS in PMEM.
下面将描述利用参照图2至图5描述的智能指针实现的管理持久化跳表的方法和装置。The following will describe a method and device for managing a persistent jump table implemented by using the smart pointer described with reference to FIGS. 2 to 5.
图6是示出根据本公开示例性实施例的管理持久化跳表的方法的流程图。FIG. 6 is a flowchart illustrating a method of managing a persistent skip table according to an exemplary embodiment of the present disclosure.
如图6中所示,在步骤S601,根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表,其中,该持久化跳表是一个持久化无锁跳表。第一格式至少包括地址部分addr和脏位dirtyflag,脏位dirtyflag用于确定是否对具有第一格式的指针执行flush操作,并且第一格式中的脏位dirtyflag是指针的最低的3个位中的至少一位,换句话说,第一格式就是图2中示出的智能指针102的格式。第二格式仅包括地址部分,换句话说,第二格式就是图2中示出的普通指针101的格式。As shown in FIG. 6, in step S601, a persistent jump table is generated according to the pointer with the first format and the pointer with the second format, where the persistent jump table is a persistent lock-free jump table. The first format includes at least the address part addr and the dirty bit dirtyflag. The dirty bit dirtyflag is used to determine whether to perform a flush operation on the pointer with the first format, and the dirty bit dirtyflag in the first format is one of the lowest 3 bits of the pointer. At least one bit, in other words, the first format is the format of the smart pointer 102 shown in FIG. 2. The second format only includes the address part, in other words, the second format is the format of the ordinary pointer 101 shown in FIG. 2.
具体地讲,可根据现有的生成普通跳表的方法来生成持久化跳表,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。此外,在所述持久化跳表中的底层链表中的每个节点的next指针中的脏位dirtyflag均被初始化为1。由于根据现有的生成普通跳表的 方法来生成跳表的过程是本领域技术人员公知的,因此在此不进行详细描述。Specifically, a persistent jump table can be generated according to an existing method of generating a common jump table, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, and the The next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list has the second format. In addition, the dirty flag in the next pointer of each node in the underlying linked list in the persistent jump table is initialized to 1. Since the process of generating a jump table according to the existing method of generating a common jump table is well known to those skilled in the art, it will not be described in detail here.
在步骤S602,将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中。下面将参照图7对此进行详细描述。图7是示出基于DRAM的传统跳表和根据本公开示例性实施例的基于PMEM的持久化跳表的示例的示图。In step S602, all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table are stored in a persistent storage device. This will be described in detail below with reference to FIG. 7. FIG. 7 is a diagram showing examples of a traditional DRAM-based jump table and a PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure.
如图7中所示,基于DRAM的传统跳表的每一层链表中的节点的next指针都是第二格式的指针(即图2中的普通指针101),然而,根据本公开示例性实施例的基于PMEM的持久化跳表的底层链表中的节点的next指针都是具有第一格式的指针(即图2中的智能指针102),而基于PMEM的持久化跳表的除了底层链表之外的其它层链表中的节点的next指针是具有第二格式的指针,也就是说,基于PMEM的持久化跳表的底层链表中的节点包括键值对(即键值k和数值v)、具有第一格式的next指针(即图2中的智能指针102)和高度(height),另外,持久化跳表的除了底层链表之外的其它层链表中的节点包括了键值对(即键值k和数值v)和具有第二格式的next指针(即图2中的普通指针101)。在本公开中,为了使整个跳表持久化,只需要保证最底层链表的持久化,所以需要将底层链表中的节点的next指针设置为图2中的智能指针102,而除了底层链表之外的其它层链表中的节点的next指针可在持久化跳表的恢复过程中在底层链表的基础上被重建,因此除了底层链表之外的其它层链表中的节点的next指针被设置为图2中的普通指针101。As shown in FIG. 7, the next pointer of the node in each level of the DRAM-based traditional jump table is a pointer in the second format (ie, the ordinary pointer 101 in FIG. 2). However, according to an exemplary implementation of the present disclosure For example, the next pointers of the nodes in the underlying linked list of the PMEM-based persistent jump table are all pointers with the first format (that is, the smart pointer 102 in Figure 2), while the PMEM-based persistent jump table except for the underlying linked list The next pointers of nodes in the linked lists of other layers are pointers with the second format, that is to say, the nodes in the underlying linked list of the persistent jump table based on PMEM include key-value pairs (that is, the key value k and the value v), The next pointer (that is, the smart pointer 102 in Figure 2) and height (height) with the first format. In addition, the nodes in the persistent jump table except for the underlying linked list include key-value pairs (ie key The value k and the value v) and the next pointer in the second format (ie, the ordinary pointer 101 in FIG. 2). In this disclosure, in order to make the entire jump list persistent, it is only necessary to ensure the persistence of the bottom-level linked list, so the next pointer of the node in the bottom-level linked list needs to be set to the smart pointer 102 in FIG. 2 except for the bottom-level linked list. The next pointers of nodes in the linked list of other layers can be reconstructed on the basis of the underlying linked list during the recovery process of the persistent jump list, so the next pointers of nodes in the linked lists of other layers except the underlying linked list are set as Figure 2 Ordinary pointer 101 in.
下面将参照图8描述在对根据本公开示例性实施例的基于PMEM的持久化跳表进行修改时的操作过程。The operation process when the PMEM-based persistent skip table is modified according to an exemplary embodiment of the present disclosure will be described below with reference to FIG. 8.
图8是示出根据本公开示例性实施例的修改基于PMEM的持久化跳表的底层链表的过程的流程图。FIG. 8 is a flowchart illustrating a process of modifying the underlying linked list of a PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure.
如图8中所示,当修改所述底层链表中的任意一个节点时,首先进行步骤S801,读取所述任意一个节点的next指针sp,其中,所述底层链表中的任意一个节点的next指针sp是一个具有图2中的智能指针102的结构的指针,因此,该读取过程可获得next指针sp的地址部分addr和脏位dirtyflag。As shown in FIG. 8, when modifying any node in the bottom-level linked list, step S801 is first performed to read the next pointer sp of any one of the nodes, where the next pointer of any one of the nodes in the bottom-level linked list is The pointer sp is a pointer having the structure of the smart pointer 102 in FIG. 2, therefore, the address part addr and the dirty bit dirtyflag of the next pointer sp can be obtained during the reading process.
此后,在步骤S802,确定所述任意一个节点的next指针sp的脏位dirtyflag是否为第一值。Thereafter, in step S802, it is determined whether the dirty flag of the next pointer sp of any node is the first value.
如果所述任意一个节点的next指针sp的脏位dirtyflag为第一值(例如1),则进行到步骤S803,将所述任意一个节点的next指针sp的脏位dirtyflag设 置为第二值(例如0),对所述任意一个节点的next指针sp执行flush操作,并进行到步骤S804。如果所述任意一个节点的next指针sp的脏位dirtyflag为第二值(例如0),则不对所述任意一个节点的next指针sp执行flush操作,而是直接进行到步骤S804。If the dirty flag of the next pointer sp of any node is the first value (for example, 1), proceed to step S803 to set the dirty flag of the next pointer sp of the any node to the second value (for example, 1). 0), perform a flush operation on the next pointer sp of any node, and proceed to step S804. If the dirty flag of the next pointer sp of any node is the second value (for example, 0), then the flush operation is not performed on the next pointer sp of any node, and the process proceeds directly to step S804.
在步骤S804,通过比较并交换CAS操作将所述任意一个节点的next指针sp修改为指向新地址。In step S804, the next pointer sp of any node is modified to point to the new address by comparing and exchanging CAS operations.
具体地讲,通过比较并交换CAS操作将所述任意一个节点的next指针sp修改为指向新地址的步骤可包括:创建具有第一格式的指针sp_old和指针sp_new;将指针sp_old指向所述任意一个节点的next指针sp的地址部分,并将指针sp_old的脏位设置为第二值;将指针sp_new指向所述新地址,并将指针sp_new的脏位设置为第一值;对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。在经过以上过程之后,所述任意一个节点的next指针sp的脏位dirtyflag会被设置为1。由于该过程与图4的步骤S404至步骤S407相似,因此不对此进行重复描述。Specifically, the step of modifying the next pointer sp of any node to point to a new address by comparing and exchanging CAS operations may include: creating a pointer sp_old and a pointer sp_new having the first format; and pointing the pointer sp_old to any one The address part of the next pointer sp of the node, and set the dirty bit of the pointer sp_old to the second value; set the pointer sp_new to the new address, and set the dirty bit of the pointer sp_new to the first value; for any node The next pointer sp, the pointer sp_old and the pointer sp_new perform CAS operations. After the above process, the dirty flag of the next pointer sp of any node will be set to 1. Since this process is similar to step S404 to step S407 in FIG. 4, the description will not be repeated.
当修改所述持久化跳表中的除了所述底层链表之外的上层链表中的任意一个节点时,可利用基于普通指针101的CAS操作来实现该过程,即,读取除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp,创建具有第二格式的指针sp_old和指针sp_new,将指针sp_old指向除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp,将指针sp_new指向新地址,并对除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。When modifying any node in the upper-level linked list except for the bottom-level linked list in the persistent jump list, the CAS operation based on the common pointer 101 can be used to implement the process, that is, read except the bottom-level linked list. The next pointer sp of the any one of the nodes in the upper-level linked list, create a pointer sp_old and a pointer sp_new with the second format, and point the pointer sp_old to any node in the upper-level linked list except the bottom-level linked list The next pointer sp, points the pointer sp_new to the new address, and performs CAS operations on the next pointer sp, the pointer sp_old, and the pointer sp_new of any node in the upper linked list except the bottom linked list.
此外,当使用管理持久化跳表的方法的装置上电时,通过在持久化存储装置中存储的底层链表的基础上重建持久化跳表中的具有第二格式的next指针来恢复持久化跳表。下面将参照图9和图10对此进行详细描述。In addition, when the device using the method of managing the persistent jump table is powered on, the persistent jump is restored by rebuilding the next pointer with the second format in the persistent jump table on the basis of the underlying linked list stored in the persistent storage device. surface. This will be described in detail below with reference to FIGS. 9 and 10.
图9是示出根据本公开示例性实施例的恢复基于PMEM的持久化跳表的过程的流程图。图10是示出根据本公开示例性实施例的恢复基于PMEM的持久化跳表的过程的伪代码的示图。FIG. 9 is a flowchart illustrating a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure. FIG. 10 is a diagram illustrating a pseudo code of a process of restoring a PMEM-based persistent skip table according to an exemplary embodiment of the present disclosure.
如图9中所示,在步骤S901,获得持久化跳表中的底层链表的头节点head,并将头节点head赋值给当前节点node,其中,在获得头节点head的过程中获得了该头节点的键值对(即键值k和数据v)、具有第一格式的next指针以及高度height。As shown in Figure 9, in step S901, the head node head of the bottom-level linked list in the persistent jump table is obtained, and the head node head is assigned to the current node node, where the head node is obtained in the process of obtaining the head node head. The key-value pair of the node (that is, the key-value k and the data v), the next pointer with the first format, and the height.
在该步骤中,需要设置一个临时的指针数组cur[1...max_height-1],并对该指针数组cur[1...max_height-1]进行初始化,如图10中所示,在伪代码部分1010中,max_height-1表示存储在PMEM中的基于PMEM的持久化跳表的所有节点的高度中的最大值。伪代码部分1010表示将cur[1...max_height-1]指针数组初始化为PMEM中存储的基于PMEM的持久化链表的头节点head,由于基于PMEM的持久化跳表中的除了底层链表之外的其它层链表中的每个节点的next指针属于图2中所示出的普通指针101,所以cur[i]被赋值为head.addr。此外,在伪代码部分1020中,node表示当前节点(换句话说,是一个用于表示当前节点的变量),head表示头节点,也就是说,伪代码部分1020表示将头节点head赋值给当前节点node,换句话说,将当前节点node确定为头节点head。In this step, you need to set up a temporary pointer array cur[1...max_height-1], and initialize the pointer array cur[1...max_height-1], as shown in Figure 10, in the pseudo In the code part 1010, max_height-1 represents the maximum value among the heights of all nodes of the PMEM-based persistent jump table stored in the PMEM. The pseudo code part 1010 indicates that the cur[1...max_height-1] pointer array is initialized to the head node of the PMEM-based persistent linked list stored in PMEM, because the PMEM-based persistent jump list is in addition to the underlying linked list The next pointer of each node in the linked list of other layers belongs to the ordinary pointer 101 shown in Figure 2, so cur[i] is assigned the value of head.addr. In addition, in the pseudo code part 1020, node represents the current node (in other words, a variable used to represent the current node), head represents the head node, that is, the pseudo code part 1020 represents the assignment of the head node head to the current node The node node, in other words, determines the current node node as the head node head.
在步骤S901之后,从头节点head开始,进行后续的步骤S902至S904。After step S901, starting from the head node head, proceed to the subsequent steps S902 to S904.
具体地讲,首先,在步骤S902,判断底层链表中的当前节点node的next指针是否指向尾节点tail。参照图10,在伪代码部分1030中,tail表示尾节点,node_addr用于临时存储当前节点node的next指针的地址部分addr,其中,当前节点node的next指针属于图2中所示出的智能指针102。伪代码部分1030中的while语句中的判断语句表示判断当前节点的next指针是否指向尾节点tail。Specifically, first, in step S902, it is determined whether the next pointer of the current node node in the underlying linked list points to the tail node tail. 10, in the pseudo code part 1030, tail represents the tail node, node_addr is used to temporarily store the address part addr of the next pointer of the current node node, where the next pointer of the current node node belongs to the smart pointer shown in Figure 2 102. The judgment statement in the while statement in the pseudo code part 1030 indicates whether the next pointer of the current node points to the tail node tail.
如果所述底层链表中的当前节点node的next指针未指向尾节点tail,则在步骤S903,根据所述底层链表中的当前节点node的高度height,将每一个上层链表前一个节点的相应层链表的next指针修改为指向当前节点node,如图10中的伪代码1031所示。此后,在步骤S904,将所述底层链表中的下一个节点赋值给当前节点node,如图10所示,伪代码1030中的node=node->next[0]语句表示将下一个节点node->next[0]赋值给当前节点node。If the next pointer of the current node node in the bottom linked list does not point to the tail node tail, then in step S903, according to the height of the current node node in the bottom linked list, the corresponding layer linked list of the previous node of each upper linked list The next pointer of is modified to point to the current node node, as shown in the pseudo code 1031 in Figure 10. Thereafter, in step S904, the next node in the underlying linked list is assigned to the current node node, as shown in Figure 10, the sentence node=node->next[0] in the pseudo code 1030 indicates that the next node node- >next[0] is assigned to the current node node.
如果所述底层链表中的当前节点node的next指针指向尾节点tail,则在步骤S905,将每一个上层链表的最后一个节点的next指针修改为指向所述尾节点tail,如图10中的伪代码1040所示。If the next pointer of the current node node in the bottom-level linked list points to the tail node tail, then in step S905, the next pointer of the last node of each upper-level linked list is modified to point to the tail node tail, as shown in FIG. 10 Shown in code 1040.
通过以上描述的图6至图10实现了持久化并发无所跳表。Figure 6 to Figure 10 described above realize the persistent concurrent non-jump table.
图11是示出根据本公开示例性实施例的管理持久化跳表的装置的框图。FIG. 11 is a block diagram showing an apparatus for managing a persistent skip table according to an exemplary embodiment of the present disclosure.
如图11中所示,装置20包括处理单元210和存储单元220。As shown in FIG. 11, the device 20 includes a processing unit 210 and a storage unit 220.
处理单元210可被配置为根据具有第一格式的指针和具有第二格式的指 针来生成一个持久化跳表,其中,该持久化跳表是一个持久化无锁跳表。第一格式至少包括地址部分addr和脏位dirtyflag,脏位dirtyflag用于确定是否对具有第一格式的指针执行flush操作,并且第一格式中的脏位dirtyflag是指针的最低的3个位中的至少一位,换句话说,第一格式就是图2中示出的智能指针102的格式。第二格式仅包括地址部分,换句话说,第二格式就是图2中示出的普通指针101的格式。The processing unit 210 may be configured to generate a persistent jump table according to the pointer with the first format and the pointer with the second format, wherein the persistent jump table is a persistent lock-free jump table. The first format includes at least the address part addr and the dirty bit dirtyflag. The dirty bit dirtyflag is used to determine whether to perform a flush operation on the pointer with the first format, and the dirty bit dirtyflag in the first format is one of the lowest 3 bits of the pointer. At least one bit, in other words, the first format is the format of the smart pointer 102 shown in FIG. 2. The second format only includes the address part, in other words, the second format is the format of the ordinary pointer 101 shown in FIG. 2.
具体地讲,处理单元210可根据现有的生成普通跳表的方法来生成持久化跳表,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。此外,在所述持久化跳表中的底层链表中的每个节点的next指针中的脏位dirtyflag均被初始化为1。由于根据现有的生成普通跳表的方法来生成跳表的过程是本领域技术人员公知的,因此在此不进行详细描述。Specifically, the processing unit 210 may generate a persistent jump table according to an existing method of generating a common jump table, wherein the next pointer of each node in the underlying linked list in the persistent jump table has the first format, And the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list has the second format. In addition, the dirty flag in the next pointer of each node in the underlying linked list in the persistent jump table is initialized to 1. Since the process of generating a jump table according to the existing method of generating a common jump table is well known to those skilled in the art, it will not be described in detail here.
存储单元220可被配置为将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中。由于以上已经参照图7详细描述了基于DRAM的传统跳表和根据本公开示例性实施例的基于PMEM的持久化跳表的情况,因此,此处不再进行重复描述。The storage unit 220 may be configured to store all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table in the persistent storage device. Since the traditional DRAM-based jump table and the PMEM-based persistent jump table according to an exemplary embodiment of the present disclosure have been described in detail above with reference to FIG. 7, the description will not be repeated here.
下面将描述在修改所述底层链表中的任意一个节点时处理单元210如何进行操作。The following will describe how the processing unit 210 operates when modifying any node in the underlying linked list.
当修改所述底层链表中的任意一个节点时,处理单元210可被配置为读取所述任意一个节点的next指针sp,其中,所述底层链表中的任意一个节点的next指针sp是一个具有图2中的智能指针102的结构的指针,因此,在该读取过程中,处理单元210可获得next指针sp的地址部分addr和脏位dirtyflag。When modifying any node in the underlying linked list, the processing unit 210 may be configured to read the next pointer sp of any node, where the next pointer sp of any node in the underlying linked list has The structure of the smart pointer 102 in FIG. 2 is a pointer. Therefore, during the reading process, the processing unit 210 can obtain the address part addr and the dirty bit dirtyflag of the next pointer sp.
此后,处理单元210可确定所述任意一个节点的next指针sp的脏位是否为第一值。如果所述任意一个节点的next指针sp的脏位dirtyflag为第一值(例如1),则处理单元210可将所述任意一个节点的next指针sp的脏位dirtyflag设置为第二值(例如0),对所述任意一个节点的next指针sp执行flush操作,并通过比较并交换CAS操作将所述任意一个节点的next指针sp修改为指向新地址。如果所述任意一个节点的next指针sp的脏位dirtyflag为第二值(例如0),则处理单元210可不对所述任意一个节点的next指针sp执行flush操作,并通过比较并交换CAS操作将所述任意一个节点的next指针sp 修改为指向新地址。Thereafter, the processing unit 210 may determine whether the dirty bit of the next pointer sp of any one of the nodes is the first value. If the dirty flag of the next pointer sp of any node is the first value (for example, 1), the processing unit 210 may set the dirty flag of the next pointer sp of the any node to the second value (for example, 0). ), perform a flush operation on the next pointer sp of any node, and modify the next pointer sp of any node to point to a new address by comparing and exchanging CAS operations. If the dirty flag of the next pointer sp of any node is the second value (for example, 0), the processing unit 210 may not perform the flush operation on the next pointer sp of the any node, and compare and exchange CAS operations. The next pointer sp of any node is modified to point to the new address.
具体地讲,处理单元210可被配置为通过以下操作将第一指针sp修改为指向所述新地址:创建具有第一格式的指针sp_old和指针sp_new;将指针sp_old指向所述任意一个节点的next指针sp的地址部分,并将指针sp_old的脏位设置为第二值;将指针sp_new指向所述新地址,并将指针sp_new的脏位设置为第一值;对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。在经过以上过程之后,所述任意一个节点的next指针sp的脏位dirtyflag会被设置为1。由于该过程与图4的步骤S404至步骤S407相似,因此不对此进行重复描述。Specifically, the processing unit 210 may be configured to modify the first pointer sp to point to the new address through the following operations: create a pointer sp_old and a pointer sp_new with the first format; point the pointer sp_old to the next node of any node The address part of the pointer sp, and the dirty bit of the pointer sp_old is set to the second value; the pointer sp_new is pointed to the new address, and the dirty bit of the pointer sp_new is set to the first value; the next pointer of the any node sp, pointer sp_old and pointer sp_new perform CAS operations. After the above process, the dirty flag of the next pointer sp of any node will be set to 1. Since this process is similar to step S404 to step S407 in FIG. 4, the description will not be repeated.
此外,当修改所述持久化跳表中的除了所述底层链表之外的上层链表中的任意一个节点时,处理单元210可利用基于普通指针101的CAS操作来实现该过程,即,处理器210可读取除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp,创建具有第二格式的指针sp_old和指针sp_new,将指针sp_old指向除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp,将指针sp_new指向新地址,并对除了所述底层链表之外的上层链表中的所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。In addition, when modifying any node in the upper-level linked list except the bottom-level linked list in the persistent jump list, the processing unit 210 can use the CAS operation based on the common pointer 101 to implement the process, that is, the processor 210 can read the next pointer sp of any node in the upper-level linked list except for the bottom-level linked list, create a pointer sp_old and a pointer sp_new in the second format, and point the pointer sp_old to something other than the bottom-level linked list The next pointer sp of the any node in the upper linked list points the pointer sp_new to the new address, and the next pointer sp, the pointer sp_old, and the pointer sp_new of the any node in the upper linked list except the bottom linked list Perform CAS operations.
此外,当管理持久化跳表的装置上电时,处理单元可被配置为通过由存储单元220在在所述持久化存储装置中存储的底层链表的基础上重建持久化跳表中的具有第二格式的next指针来恢复持久化跳表。In addition, when the device that manages the persistent jump table is powered on, the processing unit may be configured to rebuild the persistent jump table with the first one in the persistent jump table by the storage unit 220 on the basis of the underlying linked list stored in the persistent storage device. The next pointer in the second format is used to restore the persistent jump table.
具体地讲,处理单元210可被配置为通过以下操作恢复所述持久化跳表的步骤包括:获得所述底层链表的头节点,并将头节点赋值给当前节点;从所述头节点开始,如果所述底层链表中的当前节点的next指针未指向尾节点,则根据所述底层链表中的当前节点的高度,将每一个上层链表前一个节点的相应层链表的next指针修改为指向当前节点,如果所述底层链表中的当前节点的next指针指向所述尾节点,则将每一个上层链表的最后一个节点的next指针修改为指向所述尾节点。由于以上已经参照图9和图10对此进行了详细描述,因此此处不再进行重复描述。Specifically, the processing unit 210 may be configured to restore the persistent skip list through the following operations. The steps include: obtaining the head node of the underlying linked list, and assigning the head node to the current node; starting from the head node, If the next pointer of the current node in the underlying linked list does not point to the tail node, then according to the height of the current node in the underlying linked list, the next pointer of the corresponding level linked list of the previous node of each upper linked list is modified to point to the current node If the next pointer of the current node in the bottom-level linked list points to the tail node, then the next pointer of the last node of each upper-level linked list is modified to point to the tail node. Since this has been described in detail above with reference to FIGS. 9 and 10, the description will not be repeated here.
以上已参照图2至图11描述了根据本公开示例性实施例的操作数据的方法和装置以及管理持久化跳表的方法和装置。然而,应理解的是:附图中示出的装置可被分别配置为执行特定功能的软件、硬件、固件或上述项的任意 组合。例如,该装置可对应于专用的集成电路,也可对应于纯粹的软件代码,还可对应于软件与硬件相结合的模块。此外,该装置所实现的一个或多个功能也可由物理实体设备(例如,处理器、客户端或服务器等)中的组件来统一执行。The method and device for manipulating data and the method and device for managing persistent skip tables according to exemplary embodiments of the present disclosure have been described above with reference to FIGS. 2 to 11. However, it should be understood that the devices shown in the drawings may be respectively configured as software, hardware, firmware or any combination of the above to perform specific functions. For example, the device may correspond to a dedicated integrated circuit, may also correspond to pure software code, or may correspond to a module combining software and hardware. In addition, one or more functions implemented by the apparatus may also be uniformly performed by components in a physical physical device (for example, a processor, a client, or a server, etc.).
应当理解,根据本公开的示例性实施例的操作数据的方法可通过记录在计算机可读存储介质上的指令来实现,例如,根据本公开的示例性实施例,可提供一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行以下步骤:读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;通过比较并交换CAS操作将第一指针sp修改为指向新地址。It should be understood that the method of operating data according to an exemplary embodiment of the present disclosure can be implemented by instructions recorded on a computer-readable storage medium. For example, according to an exemplary embodiment of the present disclosure, a computer storing instructions can be provided. A readable storage medium, wherein, when the instruction is executed by at least one computing device, the at least one computing device is prompted to perform the following steps: reading a first pointer sp with a specific format, wherein the specific format includes at least an address Part and dirty bit; determine whether to perform flush operation on the first pointer sp according to the dirty bit of the first pointer sp; modify the first pointer sp to point to the new address by comparing and exchanging CAS operations.
又例如,根据本公开的另一示例性实施例,可提供一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行以下步骤:根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。For another example, according to another exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may be provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is caused to perform the following Steps: generate a persistent jump table according to the pointers with the first format and the pointers with the second format; and combine all the pointers with the first format in the persistent jump table and the key-value pairs and heights of all nodes Stored in a persistent storage device, where the first format includes at least an address part and a dirty bit, and the second format only includes an address part. The dirty bit is used to determine whether to perform a flush operation on a pointer with the first format, wherein, The next pointer of each node in the bottom linked list in the persistent jump list has the first format, and the next pointer of each node in the upper linked list except the bottom linked list in the persistent jump list Has a second format.
上述计算机可读存储介质中存储的指令可在诸如客户端、主机、代理装置、服务器等计算机设备中部署的环境中运行,应注意,所述指令还可在执行上述步骤时执行更为具体的处理,这些进一步处理的内容已经在参照图2至图4和图6至图10的描述中提及,因此这里为了避免重复将不再进行赘述。The instructions stored in the above-mentioned computer-readable storage medium can be executed in an environment deployed in computer equipment such as a client, a host, an agent device, and a server. Processing, the content of these further processing has been mentioned in the description with reference to FIG. 2 to FIG. 4 and FIG. 6 to FIG.
应注意,根据本公开示例性实施例的模型上线的装置可完全依赖计算机程序的运行来实现相应的功能,即,各个装置与计算机程序的功能架构中与各步骤相应,使得整个***通过专门的软件包(例如,lib库)而被调用,以实现相应的功能。It should be noted that the online device of the model according to the exemplary embodiment of the present disclosure can completely rely on the operation of the computer program to realize the corresponding function. The software package (for example, lib library) is called to realize the corresponding function.
另一方面,根据本公开示例性实施例的操作数据的装置也可以通过硬件、软件、固件、中间件、微代码或其任意组合来实现。当以软件、固件、中间件或微代码实现时,用于执行相应操作的程序代码或者代码段可以存储在诸 如存储介质的计算机可读介质中,使得处理器可通过读取并运行相应的程序代码或者代码段来执行相应的操作。On the other hand, the device for operating data according to an exemplary embodiment of the present disclosure may also be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof. When implemented in software, firmware, middleware, or microcode, the program code or code segment used to perform the corresponding operation can be stored in a computer-readable medium such as a storage medium, so that the processor can read and run the corresponding program Code or code segment to perform the corresponding operation.
例如,根据本公开示例性实施例,可提供一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行下述步骤:读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;通过比较并交换CAS操作将第一指针sp修改为指向新地址。For example, according to an exemplary embodiment of the present disclosure, it is possible to provide a system including at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one A computing device executes the following steps: reading a first pointer sp with a specific format, where the specific format includes at least an address part and a dirty bit; determining whether to flush the first pointer sp according to the dirty bit of the first pointer sp Operation: The first pointer sp is modified to point to the new address by comparing and exchanging CAS operations.
又例如,根据本公开另一示例性实施例,可提供一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行下述步骤:根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。For another example, according to another exemplary embodiment of the present disclosure, a system including at least one computing device and at least one storage device storing instructions may be provided, wherein the instructions, when executed by the at least one computing device, cause The at least one computing device executes the following steps: generating a persistent jump table based on the pointers with the first format and the pointers with the second format; and storing all pointers in the persistent jump table with the first format And the key-value pairs and heights of all nodes are stored in a persistent storage device, where the first format includes at least an address part and a dirty bit, and the second format only includes an address part, and the dirty bit is used to determine whether the pair has the first The format pointer executes the flush operation, wherein the next pointer of each node in the bottom-layer linked list in the persistent jump table has the first format, and the upper layer in the persistent jump table except the bottom-layer linked list The next pointer of each node in the linked list has the second format.
应当注意,上述至少一个存储装置中存储的指令还可在执行上述步骤时执行更为具体的处理,这些进一步处理的内容已经在参照图2至图4和图6至图10的描述中提及,因此这里为了避免重复将不再进行赘述。It should be noted that the instructions stored in the above at least one storage device may also perform more specific processing when performing the above steps, and the content of these further processing has been mentioned in the description with reference to FIGS. 2 to 4 and FIGS. 6 to 10 , So in order to avoid repetition here will not repeat them.
具体说来,上述***可以部署在服务器或客户端中,也可以部署在分布式网络环境中的节点上。此外,所述***可以是PC计算机、平板装置、个人数字助理、智能手机、web应用或其他能够执行上述指令集合的装置。此外,所述***还可包括视频显示器(诸如,液晶显示器)和用户交互接口(诸如,键盘、鼠标、触摸输入装置等)。另外,所述***的所有组件可经由总线和/或网络而彼此连接。Specifically, the above-mentioned system can be deployed in a server or a client, and can also be deployed on a node in a distributed network environment. In addition, the system may be a PC computer, a tablet device, a personal digital assistant, a smart phone, a web application, or other devices capable of executing the above set of instructions. In addition, the system may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.). In addition, all components of the system may be connected to each other via a bus and/or a network.
这里,所述***并非必须是单个***,还可以是任何能够单独或联合执行上述指令(或指令集)的装置或电路的集合体。所述***还可以是集成控制***或***管理器的一部分,或者可被配置为与本地或远程(例如,经由无线传输)以接口互联的便携式电子装置。Here, the system does not have to be a single system, and may also be any collection of devices or circuits that can execute the above-mentioned instructions (or instruction sets) individually or jointly. The system may also be a part of an integrated control system or a system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
在所述***中,所述至少一个计算装置可包括中央处理器(CPU)、图形处理器(GPU)、可编程逻辑装置、专用处理器***、微控制器或微处理器。作为示例而非限制,所述至少一个计算装置还可包括模拟处理器、数字处理器、微处理器、多核处理器、处理器阵列、网络处理器等。计算装置可运行存储在存储装置之一中的指令或代码,其中,所述存储装置还可以存储数据。指令和数据还可经由网络接口装置而通过网络被发送和接收,其中,所述网络接口装置可采用任何已知的传输协议。In the system, the at least one computing device may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. As an example and not limitation, the at least one computing device may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like. The computing device can run instructions or codes stored in one of the storage devices, where the storage device can also store data. Instructions and data can also be sent and received via a network via a network interface device, wherein the network interface device can use any known transmission protocol.
存储装置可与计算装置集成为一体,例如,将RAM或闪存布置在集成电路微处理器等之内。此外,存储装置可包括独立的装置,诸如,外部盘驱动、存储阵列或任何数据库***可使用的其他存储装置。存储装置和计算装置可在操作上进行耦合,或者可例如通过I/O端口、网络连接等互相通信,使得计算装置能够读取存储在存储装置中的指令。The storage device can be integrated with the computing device, for example, RAM or flash memory is arranged in an integrated circuit microprocessor or the like. In addition, the storage device may include a stand-alone device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The storage device and the computing device may be operatively coupled, or may communicate with each other, for example, through an I/O port, a network connection, etc., so that the computing device can read the instructions stored in the storage device.
以上描述了本公开的各示例性实施例,应理解,上述描述仅是示例性的,并非穷尽性的,本公开不限于所披露的各示例性实施例。在不偏离本公开的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。因此,本公开的保护范围应该以权利要求的范围为准。The exemplary embodiments of the present disclosure are described above. It should be understood that the foregoing description is only exemplary and not exhaustive, and the present disclosure is not limited to the disclosed exemplary embodiments. Without departing from the scope and spirit of the present disclosure, many modifications and alterations are obvious to those of ordinary skill in the art. Therefore, the protection scope of the present disclosure should be subject to the scope of the claims.
工业实用性Industrial applicability
根据本公开示例性实施例的操作数据的方法和装置可用于在PMEM中进行CAS,通过利用新的智能指针避免了不必要的flush,实现了高效的基于PMEM的CAS,同时能够解决CAS在PMEM中导致的数据不一致的问题。此外,根据本公开的示例性实施例的管理持久化跳表的方法和装置利用上述智能指针取代传统内存地址指针,实现了持久化并发无锁跳表。The method and device for manipulating data according to the exemplary embodiments of the present disclosure can be used to perform CAS in PMEM. By using a new smart pointer, unnecessary flushes are avoided, and efficient PMEM-based CAS is realized. At the same time, it can solve the problem of CAS in PMEM. Data inconsistency caused by the problem. In addition, the method and device for managing a persistent jump table according to the exemplary embodiments of the present disclosure use the above-mentioned smart pointer to replace the traditional memory address pointer, and realize a persistent concurrent lock-free jump table.

Claims (25)

  1. 一种操作数据的方法,所述方法包括:A method for manipulating data, the method includes:
    读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;Reading the first pointer sp with a specific format, where the specific format includes at least an address part and a dirty bit;
    根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;Determine whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp;
    通过比较并交换CAS操作将第一指针sp修改为指向新地址。The first pointer sp is modified to point to the new address by comparing and exchanging CAS operations.
  2. 如权利要求1所述的方法,其中,根据第一指针sp的脏位确定是否对第一指针sp执行flush操作的步骤包括:The method of claim 1, wherein the step of determining whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp comprises:
    确定第一指针sp的脏位是否为第一值;Determine whether the dirty bit of the first pointer sp is the first value;
    如果第一指针sp的脏位为第一值,则将第一指针sp的脏位设置为第二值并对第一指针sp执行flush操作,如果第一指针sp的脏位为第二值,则不对第一指针sp执行flush操作。If the dirty bit of the first pointer sp is the first value, set the dirty bit of the first pointer sp to the second value and perform a flush operation on the first pointer sp. If the dirty bit of the first pointer sp is the second value, Then the flush operation is not performed on the first pointer sp.
  3. 如权利要求1所述的方法,其中,所述特定格式中的脏位是指针的最低的3个位中的至少一位。The method of claim 1, wherein the dirty bit in the specific format is at least one of the lowest 3 bits of the pointer.
  4. 如权利要求2所述的方法,其中,通过比较并交换CAS操作将第一指针sp修改为指向所述新地址的步骤包括:The method according to claim 2, wherein the step of modifying the first pointer sp to point to the new address by comparing and exchanging CAS operations comprises:
    创建具有所述特定格式的第二指针sp_old和第三指针sp_new;Creating a second pointer sp_old and a third pointer sp_new with the specific format;
    将第二指针sp_old指向第一指针sp的地址部分,并将第二指针sp_old的脏位设置为第二值;Point the second pointer sp_old to the address part of the first pointer sp, and set the dirty bit of the second pointer sp_old to the second value;
    将第三指针sp_new指向所述新地址,并将第三指针sp_new的脏位设置为第一值;Point the third pointer sp_new to the new address, and set the dirty bit of the third pointer sp_new to the first value;
    对第一指针sp、第二指针sp_old和第三指针sp_new执行CAS操作。The CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new.
  5. 一种操作数据的装置,所述装置包括:A device for manipulating data, the device comprising:
    读取模块,被配置为读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;以及A reading module configured to read the first pointer sp with a specific format, wherein the specific format includes at least an address part and a dirty bit; and
    处理模块,被配置为:The processing module is configured as:
    根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;并且Determine whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp; and
    通过比较并交换CAS操作将第一指针sp修改为指向新地址。The first pointer sp is modified to point to the new address by comparing and exchanging CAS operations.
  6. 一种管理持久化跳表的方法,所述方法包括:A method for managing a persistent jump table, the method comprising:
    根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表; 并且Generate a persistent jump table according to the pointer with the first format and the pointer with the second format; and
    将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,Storing all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table in a persistent storage device,
    其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,Wherein, the first format includes at least an address part and a dirty bit, and the second format only includes an address part, and the dirty bit is used to determine whether to perform a flush operation on a pointer with the first format,
    其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。Wherein, the next pointer of each node in the bottom-level linked list in the persistent jump list has the first format, and the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list The next pointer has the second format.
  7. 如权利要求6所述的方法,其中,第一格式中的脏位是指针的最低的3个位中的至少一位。7. The method of claim 6, wherein the dirty bit in the first format is at least one of the lowest 3 bits of the pointer.
  8. 如权利要求6所述的方法,其中,当修改所述底层链表中的任意一个节点时,进行以下操作:8. The method of claim 6, wherein when modifying any node in the underlying linked list, the following operations are performed:
    读取所述任意一个节点的next指针sp;Read the next pointer sp of any node;
    确定所述任意一个节点的next指针sp的脏位是否为第一值;Determine whether the dirty bit of the next pointer sp of any node is the first value;
    如果所述任意一个节点的next指针sp的脏位为第一值,则将所述任意一个节点的next指针sp的脏位设置为第二值并对所述任意一个节点的next指针sp执行flush操作,如果所述任意一个节点的next指针sp的脏位为第二值,则不对所述任意一个节点的next指针sp执行flush操作;If the dirty bit of the next pointer sp of any node is the first value, then the dirty bit of the next pointer sp of any node is set to the second value and the next pointer sp of any node is flushed. Operation, if the dirty bit of the next pointer sp of any node is the second value, the flush operation is not performed on the next pointer sp of any node;
    通过比较并交换CAS操作将所述任意一个节点的next指针sp修改为指向新地址。By comparing and exchanging CAS operations, the next pointer sp of any one of the nodes is modified to point to the new address.
  9. 如权利要求8所述的方法,其中,通过比较并交换CAS操作将第一指针sp修改为指向所述新地址的步骤包括:The method according to claim 8, wherein the step of modifying the first pointer sp to point to the new address by comparing and exchanging CAS operations comprises:
    创建具有第一格式的指针sp_old和指针sp_new;Create pointer sp_old and pointer sp_new with the first format;
    将指针sp_old指向所述任意一个节点的next指针sp的地址部分,并将指针sp_old的脏位设置为第二值;Pointing the pointer sp_old to the address part of the next pointer sp of any node, and setting the dirty bit of the pointer sp_old to the second value;
    将指针sp_new指向所述新地址,并将指针sp_new的脏位设置为第一值;Point the pointer sp_new to the new address, and set the dirty bit of the pointer sp_new to the first value;
    对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。The CAS operation is performed on the next pointer sp, the pointer sp_old, and the pointer sp_new of any one of the nodes.
  10. 如权利要求6所述的方法,其中,当修改所述持久化跳表中的除了所述底层链表之外的上层链表中的任意一个节点时,进行以下操作:The method according to claim 6, wherein when modifying any node in the upper-level linked list except the bottom-level linked list in the persistent jump list, the following operations are performed:
    读取所述任意一个节点的next指针sp;Read the next pointer sp of any node;
    创建具有第二格式的指针sp_old和指针sp_new;Create pointer sp_old and pointer sp_new with the second format;
    将指针sp_old指向所述任意一个节点的next指针sp;Point the pointer sp_old to the next pointer sp of any one of the nodes;
    将指针sp_new指向新地址;Point the pointer sp_new to the new address;
    对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。The CAS operation is performed on the next pointer sp, the pointer sp_old, and the pointer sp_new of any one of the nodes.
  11. 如权利要求6所述的方法,其中,当使用所述方法的装置上电时,通过在所述持久化存储装置中存储的所述底层链表的基础上重建所述持久化跳表中的具有第二格式的next指针来恢复所述持久化跳表。The method according to claim 6, wherein, when the device using the method is powered on, the persistent jump table is rebuilt on the basis of the underlying linked list stored in the persistent storage device. The next pointer in the second format is used to restore the persistent jump table.
  12. 如权利要求11所述的方法,其中,恢复所述持久化跳表的步骤包括:The method of claim 11, wherein the step of restoring the persistent skip table comprises:
    获得所述底层链表的头节点,并将所述头节点赋值给当前节点;Obtain the head node of the underlying linked list, and assign the head node to the current node;
    从所述头节点开始进行以下操作:如果所述底层链表中的当前节点的next指针未指向尾节点,则根据所述底层链表中的当前节点的高度,将每一个上层链表前一个节点的相应层链表的next指针修改为指向当前节点,如果所述底层链表中的当前节点的next指针指向所述尾节点,则将每一个上层链表的最后一个节点的next指针修改为指向所述尾节点。Starting from the head node, the following operations are performed: if the next pointer of the current node in the bottom-level linked list does not point to the tail node, then according to the height of the current node in the bottom-level linked list, the corresponding value of the previous node of each upper-level linked list is The next pointer of the layer linked list is modified to point to the current node. If the next pointer of the current node in the bottom linked list points to the tail node, the next pointer of the last node of each upper linked list is modified to point to the tail node.
  13. 一种管理持久化跳表的装置,所述装置包括:A device for managing a persistent jump table, the device comprising:
    处理单元,被配置为根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且The processing unit is configured to generate a persistent jump table according to the pointer with the first format and the pointer with the second format; and
    存储单元,被配置为将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,The storage unit is configured to store all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table in the persistent storage device,
    其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,Wherein, the first format includes at least an address part and a dirty bit, and the second format only includes an address part, and the dirty bit is used to determine whether to perform a flush operation on a pointer with the first format,
    其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。Wherein, the next pointer of each node in the bottom-level linked list in the persistent jump list has the first format, and the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list The next pointer has the second format.
  14. 一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行操作数据的方法的以下步骤:A system comprising at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the instructions cause the at least one computing device to perform the following steps of the method for operating data:
    读取具有特定格式的第一指针sp,其中,所述特定格式至少包括地址部分和脏位;Reading the first pointer sp with a specific format, where the specific format includes at least an address part and a dirty bit;
    根据第一指针sp的脏位确定是否对第一指针sp执行flush操作;Determine whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp;
    通过比较并交换CAS操作将第一指针sp修改为指向新地址。The first pointer sp is modified to point to the new address by comparing and exchanging CAS operations.
  15. 如权利要求14所述的***,其中,根据第一指针sp的脏位确定是否对第一指针sp执行flush操作的步骤包括:The system according to claim 14, wherein the step of determining whether to perform a flush operation on the first pointer sp according to the dirty bit of the first pointer sp comprises:
    确定第一指针sp的脏位是否为第一值;Determine whether the dirty bit of the first pointer sp is the first value;
    如果第一指针sp的脏位为第一值,则将第一指针sp的脏位设置为第二值并对第一指针sp执行flush操作,如果第一指针sp的脏位为第二值,则不对第一指针sp执行flush操作。If the dirty bit of the first pointer sp is the first value, set the dirty bit of the first pointer sp to the second value and perform a flush operation on the first pointer sp. If the dirty bit of the first pointer sp is the second value, Then the flush operation is not performed on the first pointer sp.
  16. 如权利要求14所述的***,其中,所述特定格式中的脏位是指针的最低的3个位中的至少一位。The system according to claim 14, wherein the dirty bit in the specific format is at least one of the lowest 3 bits of the pointer.
  17. 如权利要求15所述的***,其中,通过比较并交换CAS操作将第一指针sp修改为指向所述新地址的步骤包括:The system according to claim 15, wherein the step of modifying the first pointer sp to point to the new address by comparing and exchanging CAS operations comprises:
    创建具有所述特定格式的第二指针sp_old和第三指针sp_new;Creating a second pointer sp_old and a third pointer sp_new with the specific format;
    将第二指针sp_old指向第一指针sp的地址部分,并将第二指针sp_old的脏位设置为第二值;Point the second pointer sp_old to the address part of the first pointer sp, and set the dirty bit of the second pointer sp_old to the second value;
    将第三指针sp_new指向所述新地址,并将第三指针sp_new的脏位设置为第一值;Point the third pointer sp_new to the new address, and set the dirty bit of the third pointer sp_new to the first value;
    对第一指针sp、第二指针sp_old和第三指针sp_new执行CAS操作。The CAS operation is performed on the first pointer sp, the second pointer sp_old, and the third pointer sp_new.
  18. 一种包括至少一个计算装置和存储指令的至少一个存储装置的***,其中,所述指令在被所述至少一个计算装置运行时,促使所述至少一个计算装置执行管理持久化跳表的方法的以下步骤:A system comprising at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one computing device causes the at least one computing device to execute the method of managing a persistent jump table The following steps:
    根据具有第一格式的指针和具有第二格式的指针来生成一个持久化跳表;并且Generate a persistent jump table according to the pointers with the first format and the pointers with the second format; and
    将所述持久化跳表中的所有具有第一格式的指针以及所有节点的键值对和高度存储在持久化存储装置中,Storing all the pointers with the first format and the key-value pairs and heights of all nodes in the persistent jump table in a persistent storage device,
    其中,第一格式至少包括地址部分和脏位,第二格式仅包括地址部分,所述脏位用于确定是否对具有第一格式的指针执行flush操作,Wherein, the first format includes at least an address part and a dirty bit, and the second format only includes an address part, and the dirty bit is used to determine whether to perform a flush operation on a pointer with the first format,
    其中,所述持久化跳表中的底层链表中的每个节点的next指针具有第一格式,并且所述持久化跳表中的除了所述底层链表之外的上层链表中的每个节点的next指针具有第二格式。Wherein, the next pointer of each node in the bottom-level linked list in the persistent jump list has the first format, and the next pointer of each node in the upper-level linked list except the bottom-level linked list in the persistent jump list The next pointer has the second format.
  19. 如权利要求18所述的***,其中,第一格式中的脏位是指针的最低的3个位中的至少一位。The system of claim 18, wherein the dirty bit in the first format is at least one of the lowest 3 bits of the pointer.
  20. 如权利要求18所述的***,其中,当修改所述底层链表中的任意一个节点时,进行以下操作:The system according to claim 18, wherein when modifying any node in the bottom-level linked list, the following operations are performed:
    读取所述任意一个节点的next指针sp;Read the next pointer sp of any node;
    确定所述任意一个节点的next指针sp的脏位是否为第一值;Determine whether the dirty bit of the next pointer sp of any node is the first value;
    如果所述任意一个节点的next指针sp的脏位为第一值,则将所述任意一个节点的next指针sp的脏位设置为第二值并对所述任意一个节点的next指针sp执行flush操作,如果所述任意一个节点的next指针sp的脏位为第二值,则不对所述任意一个节点的next指针sp执行flush操作;If the dirty bit of the next pointer sp of any node is the first value, then the dirty bit of the next pointer sp of any node is set to the second value and the next pointer sp of any node is flushed. Operation, if the dirty bit of the next pointer sp of any node is the second value, the flush operation is not performed on the next pointer sp of any node;
    通过比较并交换CAS操作将所述任意一个节点的next指针sp修改为指向新地址。By comparing and exchanging CAS operations, the next pointer sp of any one of the nodes is modified to point to the new address.
  21. 如权利要求20所述的***,其中,通过比较并交换CAS操作将第一指针sp修改为指向所述新地址的步骤包括:The system according to claim 20, wherein the step of modifying the first pointer sp to point to the new address by comparing and exchanging CAS operations comprises:
    创建具有第一格式的指针sp_old和指针sp_new;Create pointer sp_old and pointer sp_new with the first format;
    将指针sp_old指向所述任意一个节点的next指针sp的地址部分,并将指针sp_old的脏位设置为第二值;Pointing the pointer sp_old to the address part of the next pointer sp of any node, and setting the dirty bit of the pointer sp_old to the second value;
    将指针sp_new指向所述新地址,并将指针sp_new的脏位设置为第一值;Point the pointer sp_new to the new address, and set the dirty bit of the pointer sp_new to the first value;
    对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。The CAS operation is performed on the next pointer sp, the pointer sp_old, and the pointer sp_new of any one of the nodes.
  22. 如权利要求18所述的***,其中,当修改所述持久化跳表中的除了所述底层链表之外的上层链表中的任意一个节点时,进行以下操作:The system according to claim 18, wherein when modifying any node in the upper-level linked list except the bottom-level linked list in the persistent jump list, the following operations are performed:
    读取所述任意一个节点的next指针sp;Read the next pointer sp of any node;
    创建具有第二格式的指针sp_old和指针sp_new;Create pointer sp_old and pointer sp_new with the second format;
    将指针sp_old指向所述任意一个节点的next指针sp;Point the pointer sp_old to the next pointer sp of any one of the nodes;
    将指针sp_new指向新地址;Point the pointer sp_new to the new address;
    对所述任意一个节点的next指针sp、指针sp_old和指针sp_new执行CAS操作。The CAS operation is performed on the next pointer sp, the pointer sp_old, and the pointer sp_new of any one of the nodes.
  23. 如权利要求18所述的***,其中,当使用所述方法的装置上电时,通过在所述持久化存储装置中存储的所述底层链表的基础上重建所述持久化跳表中的具有第二格式的next指针来恢复所述持久化跳表。The system according to claim 18, wherein, when the device using the method is powered on, the persistent jump table is rebuilt on the basis of the underlying linked list stored in the persistent storage device. The next pointer in the second format is used to restore the persistent jump table.
  24. 如权利要求24所述的***,其中,恢复所述持久化跳表的步骤包括:The system of claim 24, wherein the step of restoring the persistent skip table comprises:
    获得所述底层链表的头节点,并将所述头节点赋值给当前节点;Obtain the head node of the underlying linked list, and assign the head node to the current node;
    从所述头节点开始进行以下操作:如果所述底层链表中的当前节点的next指针未指向尾节点,则根据所述底层链表中的当前节点的高度,将每一个上层链表前一个节点的相应层链表的next指针修改为指向当前节点,如果所述底层链表中的当前节点的next指针指向所述尾节点,则将每一个上层链表的最后一个节点的next指针修改为指向所述尾节点。Starting from the head node, the following operations are performed: if the next pointer of the current node in the bottom-level linked list does not point to the tail node, then according to the height of the current node in the bottom-level linked list, the corresponding value of the previous node of each upper-level linked list is The next pointer of the layer linked list is modified to point to the current node. If the next pointer of the current node in the bottom linked list points to the tail node, the next pointer of the last node of each upper linked list is modified to point to the tail node.
  25. 一种存储指令的计算机可读存储介质,其中,当所述指令被至少一个计算装置运行时,促使所述至少一个计算装置执行如权利要求1-4和6-12中的任意一项所述的方法。A computer-readable storage medium storing instructions, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute any one of claims 1-4 and 6-12 Methods.
PCT/CN2021/086966 2020-05-12 2021-04-13 Method and device for operating data, and method and device for managing persistent skip list WO2021227747A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010398318.5 2020-05-12
CN202010398318.5A CN111597076B (en) 2020-05-12 2020-05-12 Method and device for operating data and method and device for managing persistent jump table

Publications (1)

Publication Number Publication Date
WO2021227747A1 true WO2021227747A1 (en) 2021-11-18

Family

ID=72185271

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/086966 WO2021227747A1 (en) 2020-05-12 2021-04-13 Method and device for operating data, and method and device for managing persistent skip list

Country Status (2)

Country Link
CN (1) CN111597076B (en)
WO (1) WO2021227747A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597076B (en) * 2020-05-12 2024-04-16 第四范式(北京)技术有限公司 Method and device for operating data and method and device for managing persistent jump table

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8245209B2 (en) * 2007-05-29 2012-08-14 International Business Machines Corporation Detecting dangling pointers and memory leaks within software
CN103246482A (en) * 2012-02-06 2013-08-14 三星电子株式会社 Apparatus and method for memory overlay
CN106486167A (en) * 2015-08-24 2017-03-08 Hgst荷兰公司 Improve the method and system that flash memory is removed
CN110795370A (en) * 2018-08-03 2020-02-14 三星电子株式会社 Semiconductor memory module including nonvolatile memory device
CN111597076A (en) * 2020-05-12 2020-08-28 第四范式(北京)技术有限公司 Method and device for operating data and method and device for managing persistent skip list

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8516220B2 (en) * 2010-05-11 2013-08-20 Intel Corporation Recording dirty information in software distributed shared memory systems
US10599485B2 (en) * 2018-01-31 2020-03-24 Microsoft Technology Licensing, Llc Index structure using atomic multiword update operations
CN110704194A (en) * 2018-07-06 2020-01-17 第四范式(北京)技术有限公司 Method and system for managing memory data and maintaining data in memory

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8245209B2 (en) * 2007-05-29 2012-08-14 International Business Machines Corporation Detecting dangling pointers and memory leaks within software
CN103246482A (en) * 2012-02-06 2013-08-14 三星电子株式会社 Apparatus and method for memory overlay
CN106486167A (en) * 2015-08-24 2017-03-08 Hgst荷兰公司 Improve the method and system that flash memory is removed
CN110795370A (en) * 2018-08-03 2020-02-14 三星电子株式会社 Semiconductor memory module including nonvolatile memory device
CN111597076A (en) * 2020-05-12 2020-08-28 第四范式(北京)技术有限公司 Method and device for operating data and method and device for managing persistent skip list

Also Published As

Publication number Publication date
CN111597076A (en) 2020-08-28
CN111597076B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
KR101805948B1 (en) Checkpoints for a file system
TWI590046B (en) Apparatuses and methods for modifying memory content
US8825946B2 (en) Memory system and data writing method
US20140297935A1 (en) Mount-time reconciliation of data availability
TWI417724B (en) Computer-implemented method, apparatus, and computer program product for managing dma write page faults using a pool of substitute pages
JP2017194959A (en) METHOD, HOST COMPUTER SYSTEM AND NON-TRANSITORY, COMPUTER-READABLE STORAGE MEDIUM FOR ENABLING SIMULTANEOUS KERNEL MODE ACCESS AND USER MODE ACCESS TO NVMe DEVICE
US20140310447A1 (en) Half block management for flash storage devices
US11354192B2 (en) Data storage devices and methods for firmware failure prevention
US10019331B2 (en) Memory allocation and recovery strategies for byte-addressable non-volatile RAM (NVRAM)
JP2013513862A (en) Consistency without order dependencies
US10152278B2 (en) Logical to physical sector size adapter
WO2021227747A1 (en) Method and device for operating data, and method and device for managing persistent skip list
CN115934102B (en) Dynamic allocation method and device for general registers, computer equipment and storage medium
CN109313593A (en) Storage system
CN112214162A (en) Storage device and control method
US20210181977A1 (en) Optimizing atomic writes to a storage device
US8082402B2 (en) System and method for using virtual memory for redirecting auxiliary memory operations
US7234039B1 (en) Method, system, and apparatus for determining the physical memory address of an allocated and locked memory buffer
US10846023B2 (en) Storage device and storage area management method for reducing garbage collection processing
Pfähler et al. Crash-safe refinement for a verified flash file system
US20070150624A1 (en) Pipelined I/O execution
US7159094B1 (en) Kernel memory defragmentation method and apparatus
WO2015162717A1 (en) Computer
JPWO2019008715A1 (en) Data load program, data load method and data load device
US8237725B1 (en) Vertex cache map mode for per-vertex state changes

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21803267

Country of ref document: EP

Kind code of ref document: A1