Persistent B + -Trees in Non-Volatile Main Memory论文阅读

2.1 NVMM

2.2 B+ Tree in NVMM

在这里插入图片描述

Compared to disk-based B + -Trees, the node size of main-
memory B + -Trees is typically a few cache lines large (e.g., 2–8
64-byte cache lines)

Moreover, nodes store pointers instead of page IDs for
fast accesses

In this paper, we choose prefetching B + -Trees
as our baseline main memory B + -Trees. The basic idea is to is-
sue CPU cache prefetch instructions for all cache lines of a node
before accessing the node. The multiple prefetches will retrieve
multiple lines from main memory in parallel, thereby overlapping
a large portion of the cache miss latencies for all but the first line
in the node
预取指令(CACHE) 来减少开销,大概就是把这个原理应用到他们的B+

在这里插入图片描述

A PCM-friendly B + -Tree consists of sorted non-leaf
nodes and unsorted leaf nodes. The former maintains good search
performance, while the latter reduces PCM writes for updates.
非叶子是 sorted 叶子是unsorted

2.3 Data Structure Inconsistency Problem

在这里插入图片描述

因为数据会从cache乱序输出到memory。
1.VM不会出现这种问题,因为 断电数据都消失了,无所谓乱不乱序了
2. disk-base数据库也不会这种问题,因为不能从CACHE直接到DISK

Compared to the memory buffer pool of disk-based database
systems, we do not have the same level of control for CPU caches

3.NVMM 会出现是因为可以永久保存,如果你flush cache 到NVMM 会永久保存, 例如F3图那样, 你存入的NODE 就是一个乱序的了.那么指针就乱指,就不能指向正确的数据块

2.4Clflush and Mfence Instructions

Clflush :

为了确保每个cache line flush 有序,必须一个clflush 一个mfence

clfush();
mfence();

图F4 不加CLF 就是只读
在这里插入图片描述
从图中看出,减少MFENCE的使用很重要

From the figure, we see that clflush significantly slows down
sequential writes, because clflush forces dirty cache lines to be
written back. This disrupts the CPU and the memory controller’s
optimizations for sequential memory accesses (e.g., combining mul-
tiple accesses to the same open memory row). In comparison, since
random writes are not amenable to such optimizations, clflush
has neglegible impact on random writes. Moreover, inserting an
mfence after every clflush incurs significant overhead for both
sequential and random writes, because the mfence waits for the
previous clflush to complete. This overhead is reduced as the
number of clflush -ed records between two mfence s increases.
Therefore, it is important to reduce the relative frequency of mfence .

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值