Developing Software for Persistent Memory

Similar documents
SOFORT: A Hybrid SCM-DRAM Storage Engine for Fast Data Recovery

The Case for Rack Scale Architecture

Intel Media SDK Library Distribution and Dispatching Process

Specification Update. January 2014

Intel X38 Express Chipset Memory Technology and Configuration Guide

Intel HTML5 Development Environment. Tutorial Test & Submit a Microsoft Windows Phone 8* App (BETA)

Intel Data Direct I/O Technology (Intel DDIO): A Primer >

Intel Q35/Q33, G35/G33/G31, P35/P31 Express Chipset Memory Technology and Configuration Guide

Partition Alignment of Intel SSDs for Achieving Maximum Performance and Endurance Technical Brief February 2014

A Study of Application Performance with Non-Volatile Main Memory

Intel HTML5 Development Environment. Article - Native Application Facebook* Integration

COSBench: A benchmark Tool for Cloud Object Storage Services. Jiangang.Duan@intel.com

Intel HTML5 Development Environment. Tutorial Building an Apple ios* Application Binary

Intel 965 Express Chipset Family Memory Technology and Configuration Guide

VNF & Performance: A practical approach

Hetero Streams Library 1.0

Intel Ethernet and Configuring Single Root I/O Virtualization (SR-IOV) on Microsoft* Windows* Server 2012 Hyper-V. Technical Brief v1.

Intel Service Assurance Administrator. Product Overview

Accelerating Business Intelligence with Large-Scale System Memory

Intel Retail Client Manager

Software Solutions for Multi-Display Setups

Accelerating Business Intelligence with Large-Scale System Memory

Intel SSD 520 Series Specification Update

iscsi Quick-Connect Guide for Red Hat Linux

2013 Intel Corporation

Intel Technical Advisory

MCA Enhancements in Future Intel Xeon Processors June 2013

Customizing Boot Media for Linux* Direct Boot

Intel Desktop Board DP55WB

Intel Retail Client Manager Audience Analytics

Intel Data Migration Software

New Dimensions in Configurable Computing at runtime simultaneously allows Big Data and fine Grain HPC

Intel Matrix Storage Console

Intel HTML5 Development Environment Article Using the App Dev Center

Power Benefits Using Intel Quick Sync Video H.264 Codec With Sorenson Squeeze

Intel Core TM i3 Processor Series Embedded Application Power Guideline Addendum

Accomplish Optimal I/O Performance on SAS 9.3 with

Make A Right Choice -NAND Flash As Cache And Beyond

This guide explains how to install an Intel Solid-State Drive (Intel SSD) in a SATA-based desktop or notebook computer.

Intel Solid-State Drive 320 Series

Intel Core i5 processor 520E CPU Embedded Application Power Guideline Addendum January 2011

User Experience Reference Design

System Event Log (SEL) Viewer User Guide

Intel Atom Processor E3800 Product Family

Intel Desktop Board D945GCPE Specification Update

Intel Media Server Studio - Metrics Monitor (v1.1.0) Reference Manual

Intel Desktop Board D945GCPE

Creating Overlay Networks Using Intel Ethernet Converged Network Adapters

Benefits of Intel Matrix Storage Technology

The Transition to PCI Express* for Client SSDs

NV-DIMM: Fastest Tier in Your Storage Strategy

Intel Solid-State Drive Pro 2500 Series Opal* Compatibility Guide

Scaling Networking Solutions for IoT Challenges and Opportunities

Instant Recovery for Main-Memory Databases

Intel RAID RS25 Series Performance

Best Practices for Optimizing SQL Server Database Performance with the LSI WarpDrive Acceleration Card

Intel Desktop Board DP43BF

Intel Cloud Builder Guide: Cloud Design and Deployment on Intel Platforms

Three Paths to Faster Simulations Using ANSYS Mechanical 16.0 and Intel Architecture

COLO: COarse-grain LOck-stepping Virtual Machine for Non-stop Service

Intel RAID Controllers

Intel Desktop Board DG41TY

Intel Desktop Board DG31PR

Intel EP80579 Software for Security Applications on Intel QuickAssist Technology Cryptographic API Reference

Intel Desktop Board DG41WV

Intel Small Business Advantage (Intel SBA) Release Notes for OEMs

Intel Extreme Memory Profile (Intel XMP) DDR3 Technology

DDR2 x16 Hardware Implementation Utilizing the Intel EP80579 Integrated Processor Product Line

Intel System Event Log (SEL) Viewer Utility

Intel Desktop Board DG41BI

The Evolving Role of Flash in Memory Subsystems. Greg Komoto Intel Corporation Flash Memory Group

Intel Desktop Board DG43RK

Intel Internet of Things (IoT) Developer Kit

Maximize Performance and Scalability of RADIOSS* Structural Analysis Software on Intel Xeon Processor E7 v2 Family-Based Platforms

COLO: COarse-grain LOck-stepping Virtual Machine for Non-stop Service. Eddie Dong, Tao Hong, Xiaowei Yang

with PKI Use Case Guide

Intel 810 and 815 Chipset Family Dynamic Video Memory Technology

Next-Gen Big Data Analytics using the Spark stack

System Image Recovery* Training Foils

How to Configure Intel Ethernet Converged Network Adapter-Enabled Virtual Functions on VMware* ESXi* 5.1

Intel RAID Volume Recovery Procedures

BSP for Windows* Embedded Compact* 7 and Windows* Embedded Compact 2013 for Mobile Intel 4th Generation Core TM Processors and Intel 8 Series Chipset

SQL Server 2014 Optimization with Intel SSDs

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Intel Rapid Storage Technology

USB 3.0* Radio Frequency Interference Impact on 2.4 GHz Wireless Devices

Preparing Applications for Persistent Memory Doug Voigt Hewlett Packard (Enterprise)

Intel Solid-State Drives Increase Productivity of Product Design and Simulation

Cloud based Holdfast Electronic Sports Game Platform

Intel Network Builders: Lanner and Intel Building the Best Network Security Platforms

Intel Desktop Board DQ35JO

Accelerate SQL Server 2014 AlwaysOn Availability Groups with Seagate. Nytro Flash Accelerator Cards

Intel Desktop Board D945GCL

Bandwidth Calculations for SA-1100 Processor LCD Displays

Douglas Fisher Vice President General Manager, Software and Services Group Intel Corporation

Intel Retail Client Manager

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Computer Engineering and Systems Group Electrical and Computer Engineering SCMFS: A File System for Storage Class Memory

Measuring Cache and Memory Latency and CPU to Memory Bandwidth

Intel Desktop Board DG33TL

Transcription:

Developing Software for Persistent Memory Thomas Willhalm, Karthik Kumar Intel Corporation

Disclaimer By using this document, in addition to any agreements you have with Intel, you accept the terms set forth below. You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel a nonexclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein. INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. This document contains information on products in the design phase of development. The information here is subject to change without notice. Do not finalize a design with this information. Results have been estimated based on internal Intel analysis and are provided for informational purposes only. Any difference in system hardware or software design or configuration may affect actual performance. Intel, the Intel logo, are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries. Copyright 2015 Intel Corporation. All rights reserved *Other brands and names may be claimed as the property of others. 2

Intel 3D XPoint Technology https://youtu.be/oaajlyptoye

Key Messages at the Announcement Intel and Micron begin production on a new class of non-volatile memory, creating the first new memory category in more than 25 years since the introduction of NAND Flash memory in 1989 Up to 1000 times faster 1 than NAND Up to 1000 times greater endurance 2 than NAND 10 times denser than conventional memory 3 Built from the ground up, 3D XPoint technology uses an innovative, transistor-less memory cell architecture creating a three-dimensional checkerboard with perpendicular wires connecting submicroscopic columns. Each memory cell sits at the intersection of a word line and a bit line and can be addressed individually by selecting its top and bottom wire 1 Performance difference based on comparison between 3D XPoint technology and other industry NAND 2 Endurance difference based on comparison between 3D XPoint technology and other industry NAND 3 Density difference based on comparison between 3D XPoint technology and other industry DRAM

Agenda Technology Differentiators Benefits and caveats to persisting data structures Why programming to persistent memory is different Case study: Design of a Persistent Memory Enabled Database Design decisions Evaluation methodology 5

Technology Differentiators Differentiators for Persistent Memory Technologies Large capacity Persistence Higher latencies Higher density will allow larger DIMMs Data stored in PMem will remain in memory after reboot Latencies higher than DRAM (100ns) but much less than latest gen-pcie SSDs (10,000 ns) What value do these technology differentiators offer? 6

Opportunity: Persistence in Memory Tier Use-case where memory meets disk is a potential game changer for applications 7

Opportunity: Large Capacity Larger datasets in memory: Less paging, improved performance Scale-up vs. scale-out for in-memory solutions: Single coherent address space, avoid commit protocols for transactions Large capacity: avoid disk accesses, benefit in-memory computing 8

Opportunity: Why Restart Time Matters 9

Caveat: Higher Memory Latencies Why not hold all data in PMem: higher latencies What are considerations for moving a data structure to PMem? Data Layout and Size Can caching hide latency for data layout/size? Example: Arrays vs. linked lists Frequency of Access Are data references frequent & performance-critical? Example: cold vs. hot stores Pattern of Access Are data access patterns prefetch & cache friendly? Example: hash lookups vs column scans Need to identify application performance sensitivity for persisted data structures 10

Software Architecture: Persistent Memory Can the application benefit from larger memory capacity? no no yes DRAM Can the application benefit from persistence? Test latency tolerance of unmodified application high Persistent Memory for capacity benefit yes low Identify which data-structures should be in PMem Identify latency, bandwidth sensitive data-structures Prototype application based on PM/DRAM layout Quantify value proposition due to persistence/capacity Quantify performance impact (different latency/bandwidth) Decide if the tradeoff is acceptable yes Persistent Memory no Systematically identify which data structures can benefit from Persistent Memory 11

Application is Responsible for Durability Core Cache NV DIMM NV DIMM NV DIMM Core writes CL to cache CL evicted from cache CL persisted in PMem Need to regularly push stores out of processor caches to NVM Need to commit outstanding stores in volatile buffers to NVM New instructions needed for apps to explicitly commit stores to durability 12

Flushing Writes from Caches Instruction CLFLUSH addr CLFLUSHOPT addr CLWB addr Meaning Cache Line Flush: Available for a long time Optimized Cache Line Flush: New to allow concurrency Cache Line Write Back: Leave value in cache for performance of next access 13

Flushing Writes from Memory Controller Mechanism PCOMMIT Asynchronous DRAM Refresh Meaning Persistent Commit: Flush stores accepted by memory subsystem Flush outstanding writes on power failure Platform-Specific Feature 14

Persisting Data on the Fly: Example Int var = 0; Bool persisted = false; Before Cache PMem var 0 0 persisted False False Not flushed var = 1; MFENCE; Flush var; MFENCE; persisted = true; MFENCE; Flush persisted; MFENCE; After (incorrect) Cache PMem var 1 0 persisted True True After (correct) Cache PMem var 1 1 persisted True True New instructions CLFLUSHOPT and PCOMMIT required to make stores durable 15

Persistent Memory Aware Filesystems No buffering in DRAM on mmap direct access to PMem Examples are PMFS (research), or ext4 and xfs + new "dax" mount (4.0 kernel onward) Block File Memory User Space Application Standard File API Load, Store Kernel Space File System PMem Block Driver PMemaware FS MMU Mappings Block Cache Line NVM DIMM Byte addressable Access to PMem without kernel overhead for load/stores ATTEND: Planning for the Next Decade of NVM Programming (Andy Rudoff) 16

Persistent Memory Programming Intel has released a set of open source persistent memory libraries https://pmem.io/ Example: libpmemobj provides transactional object store, providing memory allocation, transactions, and general facilities for persistent memory programming. Website discusses library functions, caveats, suggestions on programming to Pmem ATTEND: Solving the Challenges of Persistent Memory Programming (Sarah Jelinek) 17

Agenda Technology Differentiators Benefits and caveats to persisting data structures Why programming to persistent memory is different Case study: Design of a Persistent Memory Enabled Database Design decisions Evaluation methodology 18

Instant Recovery for Main-Memory Databases Ismail Oukid*, Wolfgang Lehner*, Thomas Kissinger*, Peter Bumbulis, + and Thomas Willhalm + *TU Dresden SAP SE Intel GmbH CIDR 2015, California, USA, January 5, 2015

Design Considerations Take full advantage of PMem (SCM) to enable instant and point-in-time recovery Eliminate data copy from storage Directly modify data in persistent memory Eliminate log infrastructure Use concurrent and persistent data structures combined with concurrency scheme Dynamic decision making for secondary data structures Use performance considerations to place secondary data structures in DRAM or PMem (SCM) Three main design considerations for instant and point-in-time recovery 20

SOFORT: A PM-enabled architecture HDD DRAM PMem Traditional Architecture PM-enabled Architecture runtime data Transient Main Memory buffer pool log buffer Transient Main Memory database runtime data Moving the persistency bar Persistent Storage Database Database Log Log Non-Volatile Main Memory SOFORT is a single-level column-store, i.e., the working copy is the durable copy 21

Implementation Consideration: PMAllocator PMFS file = Memory page PMAllocator: Huge PMFS files as memory pages Pages cut into segments for allocation Persistent counter of memory pages Mapping from persistent memory to virtual memory Segment File name = Unique page ID New mechanisms for allocators required 22

Implementation Consideration: PMPtrs Regular pointers are bound to the program s address space Cannot be used for recovery We propose persistent memory pointers PMPtrs can be converted (swizzled) to regular pointers and stay valid across failures New mechanisms for handling pointers required 23

Implementation Consideration: Recovery Path New mechanisms required to handle recovery path 24

Evaluating Data Structure Latency Sensitivity Hardware-based PMem simulation based on DRAM: Special BIOS, tunable DRAM latency with means of a microcode patch Limitation: symmetric instead of asymmetric read/write latency Avoiding NUMA effects: benchmark run on a single socket DRAM Latency: 90ns, simulated PMem latency: 200ns 25

Evaluating Data Structure Latency Sensitivity SIMD-Scan performance on DRAM and PMem (SCM) 8% average slowdown 41% average slowdown Workloads with sequential memory access patterns perform well on PMem (SCM)

Evaluating Data Structure Latency Sensitivity Skip List performance on DRAM and PMem (SCM) 47% 49% Workloads with random memory access patterns do not perform well on SCM: We still need DRAM

Measuring the Value of Persistence Recovery Area Maximum number of transactions that could have been executed if the database had not failed Recovery response time Average query response time during the recovery process Recovery delta Time it takes to achieve the prefailure throughput New metrics to quantify how persistence helps database recovery

Improving Recovery Performance Synchronous Recovery Step 1: Recovery memory management Step 2: Recover primary data Step 3: Continue unfinished statements Step 4: Rebuild secondary data structures on DRAM Step 5: Start accepting user queries Primary data already loaded Restart time depends on the size of secondary data structures to be rebuilt Instant Recovery Idea 1: Use primary data to answer queries and rebuild secondary data structures asynchronously Instant responsiveness Idea 2: Persist part of or all secondary data structures in PMem (SCM) Instant recovery at peak performance Performance Penalty on throughput 29

Evaluation: Recovery Time Synchronous Recovery Instant Recovery 0% indexes in SCM 40% indexes in SCM 100% indexes in SCM First query accepted after ~8s, i.e., Recovery delta = 8s Throughput: -0% Recovery area: -16% Recovery delta: ~8s Throughput: -14% Recovery area: -82% Recovery delta: <2s Throughput: -30% Recovery area: -99,8% Recovery delta: <5ms Different type of tradeoffs possible between throughput and recovery metrics 30

Evaluation: Throughput Vs. Recovery Throughput drop limited to 30% Curves are not linear: secondary data structures are not equally important for TATP Taking advantage of a workload s characteristics leads to an optimal tradeoff 31

Takeaways Persistent Memory offers the game-changing ability to improve restart and recovery time, and improve capacity Design process involves deciding which data structures to persist Moving a data structure to PMem avoids the need to load from disk on restart altogether Tools, Libraries, Test platforms available

Evaluation: Average Response Time Max. avg. (over 100ms) Response time: 0% pers. indexes: 506µs 100% pers. indexes: 2µs Seek tradeoff depending on: throughput requirements, response time requirements, and desired recovery performance