SlideShare a Scribd company logo
Usha Upadhyayula & Piotr Balcer
Intel Data Center Group
SPDK, PMDK & Vtune™ Summit
Agenda
• Why Use Persistent Memory as Volatile
• How to Create Volatile Region over
Persistent Memory
▪ libmemkind
▪ libvmemcache
2
SPDK, PMDK & Intel® VTune™ Amplifier Summit 3
ModesataGlance
• Memory Mode (volatile Memory)
• Data Placement
• Application does not have control
over data placement between
DRAM and Intel Persistent
Memory
• Ease of adoption: No Code Changes
• Performance slower than DRAM
• App Direct Mode (persistent memory)
• Data Placement
• Application has control over data
placement between DRAM and Intel
Persistent Memory
• Ease of Adoption: Need to Re-architect
Application
• Performance at Native hardware latencies
APPLICATION
VOLATILE MEMORY POOL
O P T A N E P E R S I S T E N T M E M O R Y
D R A M A S C A C H E
APPLICATION
OPTANE PERSISTENT
MEMORY
DRAM
SPDK, PMDK & Intel® VTune™ Amplifier Summit 4
Motivation
• Application Controlled Data Placement
• Has Different Tiers of Data
• Opportunity to use Bigger and Cheaper Volatile Memory than DRAM
• Persistence not Required
• Reduce Development Effort
SPDK, PMDK & Vtune™ Summit 5
Whatislibmemkind
DRAM
Unified Memory Management
High BW
Memory
Intel® Optane™ DC
Persistent Memory
Distros
Allocator Familiar API
stdlib like API
Availability
https://github.com/memkindJeMalloc 5.0
SPDK, PMDK & Intel® VTune™ Amplifier Summit 6
HowDoesitWORK
• pmem kind is file-backed
• Temp file created on DAX-enabled
filesystem
• Temp file is memory mapped into
application virtual address space
• Temp file deleted when application
terminates
• Jemalloc manages memory allocation from
this address space
libmemkind is a Wrapper; Jemalloc Manages Heap
SPDK, PMDK & Intel® VTune™ Amplifier Summit 7
MemkindAPI
Heap Management API
• void *memkind_malloc(memkind_t kind, size_t size )
• void *memkind_calloc(memkind_t kind, size_t num, size_t size )
• void *memkind_realloc(memkind_t kind, void *ptr, size_t size )
• void memkind_free(memkind_t kind, void *ptr )
• memkind_t memkind_detect_kind(void *ptr )
Persistent Memory API
• int memkind_create_pmem(const char *dir , size_t max_size , memkind_t *kind
• int memkind_destroy_kind(memkind_t kind )
SPDK, PMDK & Intel® VTune™ Amplifier Summit 8
int main(int argc, char *argv[])
{
struct memkind *pmem_kind = NULL;
memkind_create_pmem(“/mnt/pmem”, 0, &pmem_kind);
char * ptr_default = (char *)memkind_malloc(MEMKIND_DEFAULT, size); //allocate in DRAM
char * ptr_pmem = (char *)memkind_malloc(pmem_kind, size); //allocate in PMEM
memkind_free(MEMKIND_DEFAULT, ptr_default);
memkind_free(pmem_kind, ptr_pmem);
memkind_destroy_kind(pmem_kind);
return 0;
}
Example-allocationtoDRAMandPMEM
SPDK, PMDK & Intel® VTune™ Amplifier Summit 9
• Manage Fragmentation with Memory Usage Policy
• void memkind_config_set_memory_usage_policy(struct memkind_config *cfg,
memkind_mem_usage_policy policy )
• MEMKIND_MEM_USAGE_POLICY_DEFAULT – default memory usage policy
• MEMKIND_MEM_USAGE_POLICY_CONSERVATIVE – prioritize memory usage at cost of
performance
ManagingFragmentation
Trade off between Memory Usage vs CPU Utilization
SPDK, PMDK & Intel® VTune™ Amplifier Summit 10
Fragmentation
0.5
2.5
4.5
6.5
8.5
10.5
12.5
14.5
1
4…
9…
1…
1…
2…
2…
3…
3…
4…
4…
5…
5…
6…
6…
7…
7…
8…
8…
9…
9…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
1…
Fragmentationpercentage
Number of allocations
Fragmentation
MEMKIND_MEM_USAGE_POLICY_DEFAULT MEMKIND_MEM_USAGE_POLICY_CONSERVATIVE
SPDK, PMDK & Intel® VTune™ Amplifier Summit 11
Summary
• libmemkind Provides
• Unified memory management across different “kinds of memory”
• Familiar API to manage different kinds of memory
• Tutorial and Code Samples
• https://software.intel.com/en-us/articles/use-memkind-to-manage-volatile-
memory-on-intel-optane-persistent-memory
• https://github.com/memkind/memkind/tree/master/examples
https://github.com/memkind
libvmemcachePiotr Balcer
<piotr.balcer@intel.com>
Intel® Data Center Group
SPDK, PMDK & Vtune™ Summit
Problemstatement
Local LRU cache
Support for large capacities available with persistent memory (many terabytes per server)
Lightweight, efficient and embeddable
In-memory
Scalable
13
SPDK, PMDK & Vtune™ Summit
Existingsolutions
In-memory databases tend to rely on malloc() in some form for allocating memory for
entries
▪ Which means allocating anonymous memory
Persistent Memory is exposed by the operating system through normal file-system
operations
▪ Which means allocating byte-addressable PMEM needs to use file memory mapping
(fsdax).
We could modify the allocator of an existing in-memory database and be done with it,
right? ☺
14
SPDK, PMDK & Vtune™ Summit 15
Fragmentation
Manual dynamic memory management a’la
dlmalloc/jemalloc/tcmalloc/palloc causes
fragmentation
Applications with substantial expected
runtime durations need a way to combat this
problem
▪ Compacting GC (Java, .NET)
▪ Defragmentation (Redis, Apache Ignite)
▪ Slab allocation (memcached)
Especially so if there’s substantial expected
variety in allocated sizes
SPDK, PMDK & Vtune™ Summit 16
Extentallocation
If fragmentation is unavoidable, and
defragmentation/compacting is CPU and
memory bandwidth intensive, let’s embrace it!
Usually only done in relatively large blocks in
file-systems.
But on PMEM, we are no longer restricted by
large transfer units (sectors, pages etc)
SPDK, PMDK & Vtune™ Summit 17
Scalablereplacementpolicy
Performance of libvmemcache was
bottlenecked by naïve implementation of
LRU based on a doubly-linked list.
With 100st of threads, most of the time of
any request was spent
waiting on a list lock…
Locking per-node doesn’t solve the
problem…
SPDK, PMDK & Vtune™ Summit 18
BufferedLRU
Our solution was quite simple.
We’ve added a non-blocking ring-buffer
which buffers the list-move operations
This way, the list only needs to get locked
during eviction or when the ring-buffer is
full.
SPDK, PMDK & Vtune™ Summit
Lightweight,embeddable,in-memorycaching
https://github.com/pmem/vmemcache
VMEMcache *cache = vmemcache_new("/tmp", VMEMCACHE_MIN_POOL,
VMEMCACHE_MIN_EXTENT, VMEMCACHE_REPLACEMENT_LRU);
const char *key = "foo";
vmemcache_put(cache, key, strlen(key), "bar", sizeof("bar"));
char buf[128];
ssize_t len = vmemcache_get(cache, key, strlen(key),
buf, sizeof(buf), 0, NULL);
vmemcache_delete(cache);
libvmemcache has normal get/put APIs, optional replacement policy, and configurable extent
size. Works with terabyte-sized in-memory workloads without a sweat, with very high space
utilization. Also works on regular DRAM.
19
Volatile Uses for Persistent Memory

More Related Content

PDF
Persistent Memory Programming with Java*
PDF
Provision Intel® Optane™ DC Persistent Memory in Linux*
PDF
A Key-Value Store for Data Acquisition Systems
PDF
Debugging Tools & Techniques for Persistent Memory Programming
PDF
Disrupt the Storage & Memory Hierarchy
PDF
Persistent Memory Development Kit (PMDK): State of the Project
PDF
Persistent Memory Programming with Pmemkv
PDF
Persistent Memory Development Kit (PMDK) Essentials: Part 2
Persistent Memory Programming with Java*
Provision Intel® Optane™ DC Persistent Memory in Linux*
A Key-Value Store for Data Acquisition Systems
Debugging Tools & Techniques for Persistent Memory Programming
Disrupt the Storage & Memory Hierarchy
Persistent Memory Development Kit (PMDK): State of the Project
Persistent Memory Programming with Pmemkv
Persistent Memory Development Kit (PMDK) Essentials: Part 2

What's hot (18)

PDF
Create C++ Applications with the Persistent Memory Development Kit
PDF
Ceph Day Beijing - SPDK for Ceph
PDF
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
PPTX
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
PDF
Ceph Day Beijing - Ceph All-Flash Array Design Based on NUMA Architecture
PDF
IMCSummit 2015 - Day 1 Developer Session - The Science and Engineering Behind...
PPTX
Revisiting CephFS MDS and mClock QoS Scheduler
PDF
Ceph Day Beijing - Ceph RDMA Update
PPTX
MySQL Head-to-Head
ODP
Ceph Day Melbourne - Troubleshooting Ceph
PDF
Ceph Day Shanghai - Recovery Erasure Coding and Cache Tiering
PPTX
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
PDF
Out of the box replication in postgres 9.4
PDF
Accelerating Cassandra Workloads on Ceph with All-Flash PCIE SSDS
PPTX
JetStor portfolio update final_2020-2021
PDF
optimizing_ceph_flash
PDF
Linux internals for Database administrators at Linux Piter 2016
PPT
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Create C++ Applications with the Persistent Memory Development Kit
Ceph Day Beijing - SPDK for Ceph
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Ceph Day Beijing - Ceph All-Flash Array Design Based on NUMA Architecture
IMCSummit 2015 - Day 1 Developer Session - The Science and Engineering Behind...
Revisiting CephFS MDS and mClock QoS Scheduler
Ceph Day Beijing - Ceph RDMA Update
MySQL Head-to-Head
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Shanghai - Recovery Erasure Coding and Cache Tiering
Using Recently Published Ceph Reference Architectures to Select Your Ceph Con...
Out of the box replication in postgres 9.4
Accelerating Cassandra Workloads on Ceph with All-Flash PCIE SSDS
JetStor portfolio update final_2020-2021
optimizing_ceph_flash
Linux internals for Database administrators at Linux Piter 2016
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Ad

Similar to Volatile Uses for Persistent Memory (20)

PDF
AMD EPYC™ Microprocessor Architecture
 
PDF
Accelerating Apache Spark Shuffle for Data Analytics on the Cloud with Remote...
PDF
C++ Programming and the Persistent Memory Developers Kit
PDF
SanDisk: Persistent Memory and Cassandra
PPTX
eMMC Embedded Multimedia Card overview
PDF
Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
PDF
Towards Software Defined Persistent Memory
PPTX
Live Data: For When Data is Greater than Memory
PPSX
Coa presentation3
PDF
Five cool ways the JVM can run Apache Spark faster
PDF
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
PDF
SOUG_SDM_OracleDB_V3
PDF
Q4.11: Introduction to eMMC
PDF
Apache Spark At Scale in the Cloud
PDF
Apache Spark At Scale in the Cloud
DOCX
UNIT 3.docx
PDF
Virtualization for Emerging Memory Devices
PPT
computer system embedded system volume1.ppt
PDF
Accelerate and Scale Big Data Analytics with Disaggregated Compute and Storage
PPTX
Reimagining HPC Compute and Storage Architecture with Intel Optane Technology
AMD EPYC™ Microprocessor Architecture
 
Accelerating Apache Spark Shuffle for Data Analytics on the Cloud with Remote...
C++ Programming and the Persistent Memory Developers Kit
SanDisk: Persistent Memory and Cassandra
eMMC Embedded Multimedia Card overview
Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
Towards Software Defined Persistent Memory
Live Data: For When Data is Greater than Memory
Coa presentation3
Five cool ways the JVM can run Apache Spark faster
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
SOUG_SDM_OracleDB_V3
Q4.11: Introduction to eMMC
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
UNIT 3.docx
Virtualization for Emerging Memory Devices
computer system embedded system volume1.ppt
Accelerate and Scale Big Data Analytics with Disaggregated Compute and Storage
Reimagining HPC Compute and Storage Architecture with Intel Optane Technology
Ad

More from Intel® Software (20)

PPTX
AI for All: Biology is eating the world & AI is eating Biology
PPTX
Python Data Science and Machine Learning at Scale with Intel and Anaconda
PDF
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
PDF
AI for good: Scaling AI in science, healthcare, and more.
PDF
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
PPTX
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
PPTX
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
PPTX
AWS & Intel Webinar Series - Accelerating AI Research
PPTX
Intel Developer Program
PDF
Intel AIDC Houston Summit - Overview Slides
PDF
AIDC NY: BODO AI Presentation - 09.19.2019
PDF
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
PDF
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
PDF
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
PDF
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
PDF
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
PDF
AIDC India - AI on IA
PDF
AIDC India - Intel Movidius / Open Vino Slides
PDF
AIDC India - AI Vision Slides
PDF
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...
AI for All: Biology is eating the world & AI is eating Biology
Python Data Science and Machine Learning at Scale with Intel and Anaconda
Streamline End-to-End AI Pipelines with Intel, Databricks, and OmniSci
AI for good: Scaling AI in science, healthcare, and more.
Software AI Accelerators: The Next Frontier | Software for AI Optimization Su...
Advanced Techniques to Accelerate Model Tuning | Software for AI Optimization...
Reducing Deep Learning Integration Costs and Maximizing Compute Efficiency| S...
AWS & Intel Webinar Series - Accelerating AI Research
Intel Developer Program
Intel AIDC Houston Summit - Overview Slides
AIDC NY: BODO AI Presentation - 09.19.2019
AIDC NY: Applications of Intel AI by QuEST Global - 09.19.2019
Advanced Single Instruction Multiple Data (SIMD) Programming with Intel® Impl...
Build a Deep Learning Video Analytics Framework | SIGGRAPH 2019 Technical Ses...
Bring Intelligent Motion Using Reinforcement Learning Engines | SIGGRAPH 2019...
RenderMan*: The Role of Open Shading Language (OSL) with Intel® Advanced Vect...
AIDC India - AI on IA
AIDC India - Intel Movidius / Open Vino Slides
AIDC India - AI Vision Slides
Enhance and Accelerate Your AI and Machine Learning Solution | SIGGRAPH 2019 ...

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
sap open course for s4hana steps from ECC to s4
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology

Volatile Uses for Persistent Memory

  • 1. Usha Upadhyayula & Piotr Balcer Intel Data Center Group
  • 2. SPDK, PMDK & Vtune™ Summit Agenda • Why Use Persistent Memory as Volatile • How to Create Volatile Region over Persistent Memory ▪ libmemkind ▪ libvmemcache 2
  • 3. SPDK, PMDK & Intel® VTune™ Amplifier Summit 3 ModesataGlance • Memory Mode (volatile Memory) • Data Placement • Application does not have control over data placement between DRAM and Intel Persistent Memory • Ease of adoption: No Code Changes • Performance slower than DRAM • App Direct Mode (persistent memory) • Data Placement • Application has control over data placement between DRAM and Intel Persistent Memory • Ease of Adoption: Need to Re-architect Application • Performance at Native hardware latencies APPLICATION VOLATILE MEMORY POOL O P T A N E P E R S I S T E N T M E M O R Y D R A M A S C A C H E APPLICATION OPTANE PERSISTENT MEMORY DRAM
  • 4. SPDK, PMDK & Intel® VTune™ Amplifier Summit 4 Motivation • Application Controlled Data Placement • Has Different Tiers of Data • Opportunity to use Bigger and Cheaper Volatile Memory than DRAM • Persistence not Required • Reduce Development Effort
  • 5. SPDK, PMDK & Vtune™ Summit 5 Whatislibmemkind DRAM Unified Memory Management High BW Memory Intel® Optane™ DC Persistent Memory Distros Allocator Familiar API stdlib like API Availability https://github.com/memkindJeMalloc 5.0
  • 6. SPDK, PMDK & Intel® VTune™ Amplifier Summit 6 HowDoesitWORK • pmem kind is file-backed • Temp file created on DAX-enabled filesystem • Temp file is memory mapped into application virtual address space • Temp file deleted when application terminates • Jemalloc manages memory allocation from this address space libmemkind is a Wrapper; Jemalloc Manages Heap
  • 7. SPDK, PMDK & Intel® VTune™ Amplifier Summit 7 MemkindAPI Heap Management API • void *memkind_malloc(memkind_t kind, size_t size ) • void *memkind_calloc(memkind_t kind, size_t num, size_t size ) • void *memkind_realloc(memkind_t kind, void *ptr, size_t size ) • void memkind_free(memkind_t kind, void *ptr ) • memkind_t memkind_detect_kind(void *ptr ) Persistent Memory API • int memkind_create_pmem(const char *dir , size_t max_size , memkind_t *kind • int memkind_destroy_kind(memkind_t kind )
  • 8. SPDK, PMDK & Intel® VTune™ Amplifier Summit 8 int main(int argc, char *argv[]) { struct memkind *pmem_kind = NULL; memkind_create_pmem(“/mnt/pmem”, 0, &pmem_kind); char * ptr_default = (char *)memkind_malloc(MEMKIND_DEFAULT, size); //allocate in DRAM char * ptr_pmem = (char *)memkind_malloc(pmem_kind, size); //allocate in PMEM memkind_free(MEMKIND_DEFAULT, ptr_default); memkind_free(pmem_kind, ptr_pmem); memkind_destroy_kind(pmem_kind); return 0; } Example-allocationtoDRAMandPMEM
  • 9. SPDK, PMDK & Intel® VTune™ Amplifier Summit 9 • Manage Fragmentation with Memory Usage Policy • void memkind_config_set_memory_usage_policy(struct memkind_config *cfg, memkind_mem_usage_policy policy ) • MEMKIND_MEM_USAGE_POLICY_DEFAULT – default memory usage policy • MEMKIND_MEM_USAGE_POLICY_CONSERVATIVE – prioritize memory usage at cost of performance ManagingFragmentation Trade off between Memory Usage vs CPU Utilization
  • 10. SPDK, PMDK & Intel® VTune™ Amplifier Summit 10 Fragmentation 0.5 2.5 4.5 6.5 8.5 10.5 12.5 14.5 1 4… 9… 1… 1… 2… 2… 3… 3… 4… 4… 5… 5… 6… 6… 7… 7… 8… 8… 9… 9… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… 1… Fragmentationpercentage Number of allocations Fragmentation MEMKIND_MEM_USAGE_POLICY_DEFAULT MEMKIND_MEM_USAGE_POLICY_CONSERVATIVE
  • 11. SPDK, PMDK & Intel® VTune™ Amplifier Summit 11 Summary • libmemkind Provides • Unified memory management across different “kinds of memory” • Familiar API to manage different kinds of memory • Tutorial and Code Samples • https://software.intel.com/en-us/articles/use-memkind-to-manage-volatile- memory-on-intel-optane-persistent-memory • https://github.com/memkind/memkind/tree/master/examples https://github.com/memkind
  • 13. SPDK, PMDK & Vtune™ Summit Problemstatement Local LRU cache Support for large capacities available with persistent memory (many terabytes per server) Lightweight, efficient and embeddable In-memory Scalable 13
  • 14. SPDK, PMDK & Vtune™ Summit Existingsolutions In-memory databases tend to rely on malloc() in some form for allocating memory for entries ▪ Which means allocating anonymous memory Persistent Memory is exposed by the operating system through normal file-system operations ▪ Which means allocating byte-addressable PMEM needs to use file memory mapping (fsdax). We could modify the allocator of an existing in-memory database and be done with it, right? ☺ 14
  • 15. SPDK, PMDK & Vtune™ Summit 15 Fragmentation Manual dynamic memory management a’la dlmalloc/jemalloc/tcmalloc/palloc causes fragmentation Applications with substantial expected runtime durations need a way to combat this problem ▪ Compacting GC (Java, .NET) ▪ Defragmentation (Redis, Apache Ignite) ▪ Slab allocation (memcached) Especially so if there’s substantial expected variety in allocated sizes
  • 16. SPDK, PMDK & Vtune™ Summit 16 Extentallocation If fragmentation is unavoidable, and defragmentation/compacting is CPU and memory bandwidth intensive, let’s embrace it! Usually only done in relatively large blocks in file-systems. But on PMEM, we are no longer restricted by large transfer units (sectors, pages etc)
  • 17. SPDK, PMDK & Vtune™ Summit 17 Scalablereplacementpolicy Performance of libvmemcache was bottlenecked by naïve implementation of LRU based on a doubly-linked list. With 100st of threads, most of the time of any request was spent waiting on a list lock… Locking per-node doesn’t solve the problem…
  • 18. SPDK, PMDK & Vtune™ Summit 18 BufferedLRU Our solution was quite simple. We’ve added a non-blocking ring-buffer which buffers the list-move operations This way, the list only needs to get locked during eviction or when the ring-buffer is full.
  • 19. SPDK, PMDK & Vtune™ Summit Lightweight,embeddable,in-memorycaching https://github.com/pmem/vmemcache VMEMcache *cache = vmemcache_new("/tmp", VMEMCACHE_MIN_POOL, VMEMCACHE_MIN_EXTENT, VMEMCACHE_REPLACEMENT_LRU); const char *key = "foo"; vmemcache_put(cache, key, strlen(key), "bar", sizeof("bar")); char buf[128]; ssize_t len = vmemcache_get(cache, key, strlen(key), buf, sizeof(buf), 0, NULL); vmemcache_delete(cache); libvmemcache has normal get/put APIs, optional replacement policy, and configurable extent size. Works with terabyte-sized in-memory workloads without a sweat, with very high space utilization. Also works on regular DRAM. 19