Non-Volatile Memory (NVM) technology has emerged and is now available in the market. With this technology, in-memory systems replace their persistent storage to NVM and support data availability and durability. Since NVM has characteristics of both memory and storage, the granularity of data to be durable and persistent is shifting from the coarse-grain one (e.g., block I/O) to the fine-grain one (e.g., instruction). As the data become durable with fine-granularity, applications can reduce write amplification and remove block I/O overheads. Furthermore, it enables instant restart on system reboot and snapshots in very short windows. However, per-instruction durability requires cache-flush and store-fence operations for every store instruction. Therefore, this model brings
substantial performance overheads and also is poor in terms of usability.
Programmer-defined failure-atomic sections (e.g., FASEs) are introduced to provide better performance and usability. Instructions in FASEs can execute without cache-flush and store-fence except at the end of FASEs, so that improves both performance and usability. FASE-based programming becomes prominent in persistent data structures. This resembles database transactions in terms of needs for supporting transactional semantics such as atomicity, consistency, isolation, and durability. However, guaranteeing full ACID properties in NVM is challenging.
In this dissertation, we define two requirements for supporting FASE-based transactions in persistent memory. First, updates to NVM need to be atomic and durable. Traditionally, the volatile-persistent boundary was lying between DRAM and HDD (or SSD), and data durability and atomic updates are responsible for filesystems in the OS. However, NVM blurs this boundary. As a result, partial updates leave data inconsistent states, and applications are responsible for guaranteeing atomic and durable updates. Supporting atomic durability in emerging persistent memory requires data consistency across potential system failures. For atomic durability support in the nonvolatile memory, the traditional write-ahead log (WAL) technique has been employed to guarantee the persistence of logs before actual data updates. Based on the WAL mechanism, recent studies proposed HW-assisted logging techniques with undo, redo, or undo+redo principles. The HW log manager accelerates atomic durable updates by allowing the overlapping of log writing and transaction execution as long as the atomicity invariant can be satisfied. Although both log and data write must be optimized, the prior studies exhibit trade-offs in performance under various access patterns. The undo approach experiences performance degradation due to synchronous in-place data updates since the log contains only the old values. On the other hand, the undo+redo approach stores both old and new values, and does not require synchronous in-place data updates. However, the larger log size increases the amount of log writes, which diminishes the benefits of asynchronous data updates. The prior redo approach demands extra NVM read bandwidth to fetch NVM log entries for indirectly updating in-place data. To overcome the limitations of the previous approaches, this paper proposes novel redo-based logging (ReDU), which performs direct and asynchronous in-place data update to NVM. The use of DRAM not only improves the throughput of FASE-based transactions but also reduces the complexity of HW-assisted logging. ReDU exploits a small region of DRAM as a write-cache to remove NVM writes from the critical path. The experimental results show that the proposed logging mechanism provides the best performance under a variety of write patterns compared to the previous undo, redo, and undo+redo approaches.
The second requirement of supporting transactions in NVM is to guarantee serializability. Although hardware transactional memory (HTM) is a promising solution for concurrency control, it has the fundamental limitation, which bounds the transaction in the on-chip cache. HTM is known to be only efficient for small transactions, in which footprints fit in the transaction boundary (e.g., the private L1 cache). Once the transaction exceeds beyond the limitation, which we referred to as capacity overflows, it should abort and restart since transactional systems no longer can function correctly. Furthermore, it is recommended to handle overflowed transactions by serializing execution, instead of retrying, which substantially degrades the concurrency. To this end, we propose Unbounded and Persistent hardware Transactional Memory (UP-TM) that supports unlimited sizes of transactions without overflows. UP-TM, first, detects conflicts among transactions beyond LLC and for both DRAM and NVM. Conflict detection is based on cache-coherence protocol but extended with signatures that successfully detect all conflicts even cache blocks are not present in on-chip caches. In addition, UP-TM supports atomic durable ReDU for buffering speculative data within transactions and uses the undo-based log for non-persistent (DRAM) data for short commit latency. The evaluation with the hybrid key-value store as well as persistent or volatile transactions, UP-TM outperforms the LLC-bounded HTM that serializes execution if a transaction has overflowed from LLC.
인-메모리 시스템이 비휘발성 메모리를 저장장치로 활용하기 시작하면서, 기존의 데이터 입출력(I/O)의 패러다임이 변화하고 있다. 블락(block) 크기에서 명령어(instruction)로 단위가 매우 세분화되면서, 단위가 커서 불필요하게 입출력했던 부분이 사라지고 입출력 오버헤드를 줄일 수 있다. 하지만 명령어 단위로 데이터를 저장하려면 메모리 쓰기(store) 명령어마다 매번 CPU 캐쉬를 비우고, 쓰기 명령어 완료될 때까지 FENCE 명령어로 기다려야 하는 단점이 있다. 그 결과, 응용 프로그램의 성능이 나빠지고, 개발하기 어려워 진다. 이러한 단점을 보완하여 비휘발성 메모리 기술의 장점을 살리기 위해서, failure-atomic sections, 즉, FASEs 단위로 프로그래밍을 하면 CPU 캐쉬 flush와 FENCE 명령어의 갯수를 획기적으로 줄일 수 있다. FASE에 기반한 프로그래밍은 다양한 자료 구조를 구성하는데 자주 사용하고 있으며, 기존 데이터베이스 시스템의 트랜잭션(transaction)과 요구사항이 비슷하다. FASE 기반 프로그래밍과 데이터베이스 트랜잭션 모두 ACID라고 불리는 원자성(Atomicity), 일관성(Consistency), 독립성(Isolation), 지속성(Durability)를 필요로 한다.
본 학위 논문에서는 비휘발성 메모리 상의 FASE 기반 프로그래밍에서 ACID 특성을 제공하는 기술을 두 가지로 나누어 다루고 있다. 첫 번째는 비휘발성 메모리에 데이터를 쓸 때는, 원자성(Atomicity)과 지속성(Durability)이 필요하다. 이 특성을 제공하기 위해서 운영체제의 파일시스템에서 사용하던 로그선행기입(Write-ahead Logging) 기법을 활용한다. 소프트웨어 명령어로 로그선행기입 기법을 수행하는 것은 비효율적이기 때문에 본 학위 논문은 하드웨어의 지원을 받아서 비휘발성 메모리에서 로그선행기입 기법을 가속화하는 기술을 제안한다. 이 기법은 같은 시스템에 존재하는 DRAM 의 일부분을 사용하여 비휘발성 메모리의 대역폭 사용량을 줄여주고, 로그선행기입 기법의 지속시간(latency)도 최소화한다. 해당 기법은 기존 연구들에서 제안하였던 하드웨어 지원 기법들 보다 뛰어난 성능을 보여준다.
FASE 프로그래밍의 두 번째 요구사항은 메모리 쓰기의 독립성(Isolation)이다. 하드웨어 트랜잭셔널 메모리(HTM)을 사용하면 메모리 쓰기 간 독립성을 보장할 수 있다. 하지만 HTM은 트랜잭션의 크기를 CPU 캐쉬 크기로 제한을 하기 때문에
그 보다 큰 크기를 갖는 트랜잭션은 효율적으로 실행할 수 없다. 즉, 하드웨어의 범위를 넘어서기 때문에 트랜잭션의 정확성을 보장할 수 없기 때문에 트랜잭션을 종료하고 재시작해야 한다. 이 때, 동시에 실행하고 있는 트랜잭션을 멈추고, 하나씩 하나씩 실행하여 프로그램의 진행을 보장한다. 이러한 현상을 용량 초과(capacity overflow)라고 부르고, HTM의 효율을 매우 악화시킨다. 따라서, 본 학위 논문에서는 HTM의 트랜잭션 크기 제한을 없앨 수 있는 하드웨어 지원 기법을 제안한다. 해당 기법은 CPU 캐쉬를 넘어서는 데이터에 대해서는 시그니쳐(signature)라는 자료 구조를 사용해서 트랜잭션을 지속적으로 제공할 수 있도록 한다.