没有合适的资源?快使用搜索试试~ 我知道了~
首页Programming-Persistent-Memory-2020.pdf
Programming-Persistent-Memory-2020.pdf
需积分: 50 248 浏览量
更新于2023-05-25
评论
收藏 8.87MB PDF 举报
a book describing how to program for the latest storage hardware
资源详情
资源评论
资源推荐

Programming
Persistent
Memory
A Comprehensive Guide for Developers
—
Steve Scargall

Programming Persistent
Memory
A Comprehensive Guide for
Developers
SteveScargall

Programming Persistent Memory: A Comprehensive Guide for Developers
ISBN-13 (pbk): 978-1-4842-4931-4 ISBN-13 (electronic): 978-1-4842-4932-1
https://doi.org/10.1007/978-1-4842-4932-1
Copyright © 2020 by Intel
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction
on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic
adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Open Access This book is licensed under the terms of the Creative Commons Attribution 4.0
International License (http://creativecommons.org/licenses/by/4.0/), which permits use,
sharing, adaptation, distribution and reproduction in any medium or format, as long as you give
appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and
indicate if changes were made.
The images or other third party material in this book are included in the book’s Creative Commons license, unless
indicated otherwise in a credit line to the material. If material is not included in the book’s Creative Commons
license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need
to obtain permission directly from the copyright holder.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion
and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified
as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither
the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may
be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Susan McDermott
Development Editor: Laura Berendson
Coordinating Editor: Jessica Vakili
Distributed to the book trade worldwide by Springer Science+Business Media NewYork, 233 Spring Street,
6th Floor, NewYork, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com,
or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit http://www.apress.com/
rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses
are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at
http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to readers on
GitHub via the book's product page, located at www.apress.com/978-1-4842-4931-4. For more detailed
information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
SteveScargall
Santa Clara, CA, USA

iii
Chapter 1: Introduction to Persistent Memory Programming ���������������������������������� 1
A High-Level Example Program ���������������������������������������������������������������������������������������������������� 2
What’s Different? ��������������������������������������������������������������������������������������������������������������������� 5
The Performance Difference���������������������������������������������������������������������������������������������������� 6
Program Complexity ���������������������������������������������������������������������������������������������������������������� 7
How Does libpmemkv Work? ��������������������������������������������������������������������������������������������������� 8
What’s Next? ��������������������������������������������������������������������������������������������������������������������������������� 9
Summary��������������������������������������������������������������������������������������������������������������������������������������� 9
Chapter 2: Persistent Memory Architecture ����������������������������������������������������������� 11
Persistent Memory Characteristics ��������������������������������������������������������������������������������������������� 12
Platform Support for Persistent Memory ������������������������������������������������������������������������������������ 13
Cache Hierarchy �������������������������������������������������������������������������������������������������������������������������� 14
Power-Fail Protected Domains ���������������������������������������������������������������������������������������������������� 16
The Need for Flushing, Ordering, and Fencing ���������������������������������������������������������������������������� 19
Data Visibility ������������������������������������������������������������������������������������������������������������������������������ 23
Intel Machine Instructions for Persistent Memory ���������������������������������������������������������������������� 24
Detecting Platform Capabilities �������������������������������������������������������������������������������������������������� 25
Table of Contents
About the Author ��������������������������������������������������������������������������������������������������� xiii
About the Technical Reviewer ���������������������������������������������������������������������������������xv
About the Contributors ������������������������������������������������������������������������������������������xvii
Acknowledgments ��������������������������������������������������������������������������������������������������xxi
Preface �����������������������������������������������������������������������������������������������������������������xxiii

iv
Application Startup and Recovery ����������������������������������������������������������������������������������������������� 27
What’s Next? ������������������������������������������������������������������������������������������������������������������������������� 29
Summary������������������������������������������������������������������������������������������������������������������������������������� 29
Chapter 3: Operating System Support for Persistent Memory ������������������������������� 31
Operating System Support for Memory and Storage ������������������������������������������������������������������ 31
Persistent Memory As Block Storage ������������������������������������������������������������������������������������������ 33
Persistent Memory-Aware File Systems ������������������������������������������������������������������������������������� 34
Memory-Mapped Files ���������������������������������������������������������������������������������������������������������������� 35
Persistent Memory Direct Access (DAX) ������������������������������������������������������������������������������������� 43
Summary������������������������������������������������������������������������������������������������������������������������������������� 53
Chapter 4: Fundamental Concepts of Persistent Memory Programming ��������������� 55
What’s Different? ������������������������������������������������������������������������������������������������������������������������ 55
Atomic Updates ��������������������������������������������������������������������������������������������������������������������������� 56
Transactions �������������������������������������������������������������������������������������������������������������������������������� 57
Atomicity ������������������������������������������������������������������������������������������������������������������������������� 57
Consistency ��������������������������������������������������������������������������������������������������������������������������� 58
Isolation ��������������������������������������������������������������������������������������������������������������������������������� 58
Durability ������������������������������������������������������������������������������������������������������������������������������� 58
Flushing Is Not Transactional ������������������������������������������������������������������������������������������������������ 59
Start-Time Responsibilities ��������������������������������������������������������������������������������������������������������� 59
Tuning for Hardware Configurations ������������������������������������������������������������������������������������������� 60
Summary������������������������������������������������������������������������������������������������������������������������������������� 60
Chapter 5: Introducing the Persistent Memory Development Kit ��������������������������� 63
Background ��������������������������������������������������������������������������������������������������������������������������������� 63
Choosing the Right Semantics ���������������������������������������������������������������������������������������������������� 64
Volatile Libraries ������������������������������������������������������������������������������������������������������������������������� 65
libmemkind ���������������������������������������������������������������������������������������������������������������������������� 65
libvmemcache ����������������������������������������������������������������������������������������������������������������������� 66
libvmem ��������������������������������������������������������������������������������������������������������������������������������� 67
Table of ConTenTs
剩余456页未读,继续阅读


















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0