• Tidak ada hasil yang ditemukan

NVB-tree: Failure-Atomic B+-tree for Persistent Memory

N/A
N/A
Protected

Academic year: 2023

Membagikan "NVB-tree: Failure-Atomic B+-tree for Persistent Memory"

Copied!
40
0
0

Teks penuh

Emerging non-volatile memory has opened new opportunities to redesign the entire system software stack and is expected to break the boundaries between memory and storage devices to enable storageless systems. However, B-tree is optimized for disk-based systems that read and write large blocks of data. When byte-addressable non-volatile memory replaces the block device storage systems, the byte-addressability of NVRAM makes it a challenge to enforce the failure atomicity of B-tree nodes.

In this work, we present the NVB-tree that addresses this challenge, reducing the cache line load and avoiding expensive registration methods. The NVB-tree is a hybrid tree that combines the binary search tree and the B+ tree, i.e., the keys at each node of the NVB tree are stored as a binary search tree so that it can take advantage of the byte addressability of binary search trees . We also present a writeless split/merge scheme that guarantees fail-atomicity with 8-byte memory writes.

Our performance study shows that NVB-tree outperforms the state-of-the-art persistent index - wB+-tree by a wide margin.

Introduction

However, wB+ tree still calls at least four cache line flushes per insert, which we believe is sub-optimal. In this work, we design and implement NVB tree, which is a variant of persistent B-tree that minimizes the number of memory writes and cache line flush operations. To guarantee failure atomicity and consistency with byte-addressable NVRAM, NVB-tree uses a binary search tree as an internal tree node format.

By managing entries as a binary search tree, we can add, update, or delete entries with a failed 8-byte atomic update operation. In addition to the atomic updates for a single tree node, NVB-tree eliminates the need for expensive logging for updates to multiple tree nodes, i.e. a node split and a node merge. However, we propose to use a sister pointer to make each memory write of a node split or a node merge process atomic and consistent.

For such non-volatile memory devices, we design and implement NVB-tree - a hybrid indexing structure that combines the advantages of binary search trees and B-trees, that is, NVB-tree takes advantage of the error atomicity and byte addressability of an in- memory index and the durability, cache line awareness, and balanced tree height of a disk-based index. Second, we propose a log-less atomic split and merge algorithm for the NVB tree, which eliminates the redundancy caused by logging or journaling. Our NVB tree virtually combines multiple tree nodes and makes them behave as if they were a single node.

Despite an extensive performance study, we show that our NVB-tree consistently outperforms the wB+-tree by a large margin in terms of insertion time, seek time, eviction time, cache line flushes, cache line accesses, and LLC misses. NVB-tree also shows comparable performance to FPtree, which is designed for the hybrid NVRAM+DRAM memory environment. Although NVB-tree outperforms FPtree in terms of insertion performance, because NVB-tree stores all tree nodes in NVRAM, NVB-tree does not require recovery when a system crashes, because every memory write in NVB-tree is an atomic error.

In section 4, we evaluate the performance of NVB-tree against the latest B+-tree variants for NVRAM.

RELATED WORK

To reduce the number of cache line flushes, they developed an optimized scheme, slot-only wB+-tree, which requires only two cache line flushes - one for the record update and the other for bitmap update. Although the optimized slot-only wB+ tree reduces the number of cache line flushes down to two, which is optimal, the slot-only wB+ tree limits the number of entries in a tree node to no more than eight. The small node degree makes the height of the one-slot wB+ tree higher, and its performance is no better than the bitmap wB+ tree.

In addition, wB+-tree performs logging for node splits, which significantly increases the number of cache line flushes. As a result, the performance gain achieved by optimal cache line flushing is masked by the high division overhead. Additionally, the bitmap and slot array add a level of indirection to key pointer access, which also hurts search performance.

FAILURE-ATOMIC NVB-TREE

Design Rationale

With sibling pointers and 8-byte error atomicity writing, the NVB tree achieves error atomicity for node splits and node mergers, i.e. The NVB tree is atomically transformed from one consistent state to another consistent state even if a system crashes. NVB tree is a hybrid indexing structure that contains a binary search tree (BST) inside each B-tree node. We refer to a node in a binary search tree as a BST entry to distinguish it from an NVB tree node.

Each BST entry has a key, a pointer to its child NVB tree node, two offsets - one for the left child BST entry and the other for the right child BST entry. In the header we have an offset field pointing to the root BST entry, a field indicating whether the node is an internal node or a leaf node, a sibling pointer, and a pointer to the leftmost child NVB tree node. The pointer to the leftmost child NVB tree node is only used if the node is a leaf node.

However, all NVB tree nodes need a sibling pointer to enable a virtual node, which is required to guarantee failover-atomicity.

Failure-Atomic NVB-tree Node Update

Therefore, inserting into an NVB-tree node fails atomically as long as writing an offset fails atomically. In the first phase, we traverse the BST nodes of the NVB tree to find the entry we want to delete (m) and follow its parent entry (p). This step requires a single flush of the cache line, which ensures atomicity of the NVB tree node failure.

This step also requires a single flush of the cache line, and guarantees node failover-atomicity of the NVB tree. This can be done atomically by replacing the pointer to the tree node ID mapping table, which we describe in Section 3.4.2. Note that we store child IDs instead of child pointers to tree nodes because we need a level of indirection to access each node of the NVB tree for fail-atomicity.

With the indirect access scheme, we can use copy-on-write to create a shadow copy and construct a balanced BST even when a tree node is referenced by multiple tree nodes. If an NVB tree node is split, half of its entries must be moved to a new sister node. In addition, splitting an NVB tree node will likely change almost the entire tree node, even if we perform an internal update.

However, we only perform this expensive rebalancing operation when a node of the NVB tree splits or two nodes merge so that the extra cache line overhead can be flushed because they need to be flushed anyway. Although the depth of leaf nodes in a BST is not the same, the number of BST entries in an NVB-tree node is limited by the size of an NVB-tree node. After splitting the node m, ii) we replace the memory address of m with the memory address of m1 in the node ID mapping table of the tree as shown in Figure 3(b).

But the number of accesses to the tree node ID mapping table per query is limited by the height of the NVB-tree, which is very small. Suppose the system crashes after swapping memory address m with memory address m1 in the tree node ID mapping table as shown in Figure 3(b). Then, iii) we atomically update the tree node ID mapping table with the memory address of the merged (or reallocated) tree node so that the left relative and the parent node point to the updated tree node.

Figure 2: Failure-Atomic Deletion in NVB-tree Node
Figure 2: Failure-Atomic Deletion in NVB-tree Node

EVALUATION

  • Experimental Setup
  • Node Size
  • Throughput
  • NVRAM Latency Effect

As we increase the node size, NVB-tree insertion performance improves slightly due to the shorter tree height and reduced number of splits. While the bitmap wB+ tree calls about eight clflush instructions, the NVB tree calls less than four clflush. As with insertion and search performance, NVB-tree deletion time is almost independent of node size.

Without the rebalancing optimization, the insert/seek/delete performance of the NVB tree degrades as we increase the node size. The number of LLC misses with NVB wood is also much less than that of wB+ wood as shown in Figure 7(c). This is because the NVB tree removes gaps in the BST entry array, and it calls a fewer number of clflush instructions that invalidate cache lines from the LLC.

In the experiments shown in Figure 8, we create indexes with different numbers of key-value pairs and measure the performance of NVB-tree against FPTree and wB+-tree. However, when the number of indexed data is small, the search throughput of FPTree is 3.7x lower than that of NVB-tree. If the read latency of NVRAM is the same as that of DRAM, NVB-tree and FPTree show comparable insertion performance and they consistently outperform wB+-tree.

As write latency increases, NVB-tree starts to show better performance than FPtree because NVB-tree calls a smaller number of cache line flushes than FPtree. Therefore, the performance of NVB-tree with two different workloads does not make a significant difference, as shown in Figure 10. Unless the read latency of NVRAM is 6x higher than that of DRAM, NVB-tree is faster than FPtree and wB+-tree in terms of query performance .

However, in terms of insertion and deletion performance, NVB-tree is slower than FPTree, although it is faster than wB+-tree.

Figure 5: Insertion Performance with Varying Node Sizes
Figure 5: Insertion Performance with Varying Node Sizes

CONCLUSION

In Proceedings of the 21st International Conference on Architectural Support for Programming Languages ​​and Operating Systems (ASPLOS), pp. A survey of software techniques for using non-volatile memory for storage and main memory systems.

Gambar

Figure 1: Node Structure of NVB-tree
Figure 2: Failure-Atomic Deletion in NVB-tree Node
Figure 3 illustrates the node split algorithm of NVB-tree. To guarantee consistency, we do not  consider  the  entry  that  caused  the  overflow  during  the  split  process
Figure 3: Failure-Atomic Node Split in NVB-tree Node
+7

Referensi

Dokumen terkait

LIST OF FIGURES Figure 1.1: Retail Key Facts in Malaysia from 2015 to 2019 2 Figure 1.2: Retail Key Facts by States in 2019 2 Figure 1.3: Summary of Research Approaches 6 Figure

xii LIST OF FIGURES Figure Page 1.1 Schematic arrangement of molecules in various phases 2 1.2 Structure of cholesteryl benzoate Dierking, 2003 4 1.3 Structure of

List of Figures and Tables INTRODUCTION page Figure 1 Structures of the Watson-Crick Base Pairs...2 Figure 2 Structure of B-form DNA ...3 Figure 3 X-ray Crystal Structures of

LIST OF FIGURES FIGURE 1 --- STRUCTURE OF AZ66 FIGURE 2 --- SEIZURE LATENCY OF SINGLE DOSE OF PTZ FIGURE 3 ---TOTAL SEIZURE FREQUENCY OF PTZ FIGURE 4 ---FREQUNCY OF MAJOR SEIZURES OF

List of Figures Figure.1.1 - Focus areas of School field Visit Figure.1.2 - Classroom space usages Figure.1.3 - Children’s movement flow in classroom Figure.1.4 - Use of existing

LIST OF FIGURES PAGE Figure 2.1 The relationship of nutrient standards, dietary goals, dietary guidelines 15 and food guides after Welsh 1996 Figure 4.1 Sampling procedure after

xv List of Figures Figure 2.1: Characteristics of Manufacturing Systems in Capacity- Functionality Coordinates [9] Figure 2.2: The Economic Goals of Various Manufacturing Paradigms

©Daffodil International University vii LIST OF FIGURES FIGURES PAGE NO Figure 2.1: In General Process 8 Figure 3.1: Flowchart of audio to spectrogram conversion algorithm 12