Cache-Conscious Concurrency Control of Main-Memory Indexes on Shared-Memory Multiprocessor Systems

Similar documents
Advance Operating Systems (CS202) Locks Discussion

Hazard Pointers. Safe Resource Reclamation for Optimistic Concurrency

Deukyeon Hwang UNIST. Wook-Hee Kim UNIST. Beomseok Nam UNIST. Hanyang Univ.

Foster B-Trees. Lucas Lersch. M. Sc. Caetano Sauer Advisor

CSCI 4717 Computer Architecture

A Practical Scalable Distributed B-Tree

Heckaton. SQL Server's Memory Optimized OLTP Engine

Cost of Concurrency in Hybrid Transactional Memory. Trevor Brown (University of Toronto) Srivatsan Ravi (Purdue University)

Chapter 18 Parallel Processing

Hazard Pointers. Safe Resource Reclamation for Optimistic Concurrency

AST: scalable synchronization Supervisors guide 2002

Goldibear and the 3 Locks. Programming With Locks Is Tricky. More Lock Madness. And To Make It Worse. Transactional Memory: The Big Idea

Organisasi Sistem Komputer

Bw-Tree. Josef Schmeißer. January 9, Josef Schmeißer Bw-Tree January 9, / 25

Speculative Synchronization: Applying Thread Level Speculation to Parallel Applications. University of Illinois

Introduction. New latch modes

CMSC Computer Architecture Lecture 15: Memory Consistency and Synchronization. Prof. Yanjing Li University of Chicago

Synchronizing Data Structures

Computer Organization. Chapter 16

Background: disk access vs. main memory access (1/2)

416 Distributed Systems. Distributed File Systems 4 Jan 23, 2017

Claude TADONKI. MINES ParisTech PSL Research University Centre de Recherche Informatique

Chapter 12: Indexing and Hashing (Cnt(

Multiprocessor Support

Lock-Free and Practical Doubly Linked List-Based Deques using Single-Word Compare-And-Swap

Problem. Indexing with B-trees. Indexing. Primary Key Indexing. B-trees: Example. B-trees. primary key indexing

PERFORMANCE ANALYSIS AND OPTIMIZATION OF SKIP LISTS FOR MODERN MULTI-CORE ARCHITECTURES

Realistic and Efficient Multi-Channel Communications in WSN

Data Processing on Modern Hardware

Implementierungstechniken für Hauptspeicherdatenbanksysteme: The Bw-Tree

Lecture 19: Coherence and Synchronization. Topics: synchronization primitives (Sections )

Per-Thread Batch Queues For Multithreaded Programs

Multi-Processor / Parallel Processing

Designing Next-Generation Data- Centers with Advanced Communication Protocols and Systems Services. Presented by: Jitong Chen

Blocking Analysis of FIFO, Unordered, and Priority-Ordered Spin Locks

Abstraction, Reality Checks, and RCU

Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

Go Deep: Fixing Architectural Overheads of the Go Scheduler

DATA STRUCTURE AND ALGORITHM USING PYTHON

Lecture Notes on Advanced Garbage Collection

CSL373: Lecture 5 Deadlocks (no process runnable) + Scheduling (> 1 process runnable)

Lecture: Coherence and Synchronization. Topics: synchronization primitives, consistency models intro (Sections )

Multiprocessor Cache Coherency. What is Cache Coherence?

The dark powers on Intel processor boards

GLocks: Efficient Support for Highly- Contended Locks in Many-Core CMPs

Summary: Open Questions:

Parallel Processing. Computer Architecture. Computer Architecture. Outline. Multiple Processor Organization

CLOUD-SCALE FILE SYSTEMS

PrimeBase XT. A transactional engine for MySQL. Paul McCullagh SNAP Innovation GmbH

Array-based Cache Conscious Trees

The Adaptive Radix Tree

Transactional Memory: Architectural Support for Lock-Free Data Structures Maurice Herlihy and J. Eliot B. Moss ISCA 93

Portland State University ECE 588/688. Directory-Based Cache Coherence Protocols

MULTIPROCESSORS. Characteristics of Multiprocessors. Interconnection Structures. Interprocessor Arbitration

Scalable Concurrent Hash Tables via Relativistic Programming

CST-Trees: Cache Sensitive T-Trees

Chapter 6 Concurrency: Deadlock and Starvation

BzTree: A High-Performance Latch-free Range Index for Non-Volatile Memory

Lecture 8: Directory-Based Cache Coherence. Topics: scalable multiprocessor organizations, directory protocol design issues

Chapter 11: Indexing and Hashing

Concurrency, Thread. Dongkun Shin, SKKU

Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution

Lecture 12 Transactional Memory

Trees. Reading: Weiss, Chapter 4. Cpt S 223, Fall 2007 Copyright: Washington State University

Low Overhead Concurrency Control for Partitioned Main Memory Databases. Evan P. C. Jones Daniel J. Abadi Samuel Madden"

Parallel access to linked data structures

Memory Consistency and Multiprocessor Performance

Optimizing Replication, Communication, and Capacity Allocation in CMPs

Fall 2015 COMP Operating Systems. Lab #8

!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?

CA485 Ray Walshe Google File System

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

Index. ADEPT (tool for modelling proposed systerns),

TrafficDB: HERE s High Performance Shared-Memory Data Store Ricardo Fernandes, Piotr Zaczkowski, Bernd Göttler, Conor Ettinoffe, and Anis Moussa

CS4021/4521 INTRODUCTION

Lecture: Consistency Models, TM

A Concurrent Skip List Implementation with RTM and HLE

High Performance Transactions in Deuteronomy

(Preliminary Version 2 ) Jai-Hoon Kim Nitin H. Vaidya. Department of Computer Science. Texas A&M University. College Station, TX

15 418/618 Project Final Report Concurrent Lock free BST

Memory Consistency and Multiprocessor Performance. Adapted from UCB CS252 S01, Copyright 2001 USB

Concurrency Control. Chapter 17. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

The Google File System

Eunomia: Scaling Concurrent Search Trees under Contention Using HTM

Concurrency: Principles of Deadlock. Processes and resources. Concurrency and deadlocks. Operating Systems Fall Processes need resources to run

CS140 Operating Systems and Systems Programming Midterm Exam

Chapter 18. Parallel Processing. Yonsei University

Caches. Cache Memory. memory hierarchy. CPU memory request presented to first-level cache first

Lecture 21: Transactional Memory. Topics: Hardware TM basics, different implementations

Transactional Interference-less Balanced Tree

Lecture: Consistency Models, TM. Topics: consistency models, TM intro (Section 5.6)

Physical Level of Databases: B+-Trees

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

CS3600 SYSTEMS AND NETWORKS

Review: Creating a Parallel Program. Programming for Performance

Shared Cache Aware Task Mapping for WCRT Minimization

Chapter 11: Indexing and Hashing

Shared Memory and Distributed Multiprocessing. Bhanu Kapoor, Ph.D. The Saylor Foundation

Outline. Database Tuning. Ideal Transaction. Concurrency Tuning Goals. Concurrency Tuning. Nikolaus Augsten. Lock Tuning. Unit 8 WS 2013/2014

Chapter 11: Indexing and Hashing

Transcription:

Cache-Conscious Concurrency Control of Main-Memory Indexes on Shared-Memory Multiprocessor Systems Sang K. Cha, Sangyong Hwang, Kihong Kim, Keunjoo Kwon VLDB 2001 Presented by: Raluca Marcuta 1 / 31

1 Introduction Background and Motivation Objectives 2 Concurrency Control Approaches Physical Versioning Lock Coupling 3 Implementation Main Idea of OLFIT Node Operations Tree Operations 4 Experimental Evaluation Pure Search Performance Pure Update Performance Performance with Varying Update Ratio 5 Conclusions and Future Work 6 Related Work 7 Critique 2 / 31

Background and Motivation Cache-conscious index structures Approach : reduce cache misses by increasing index fanout Goal : improve search performance Examples : CSB+-tree (Cache Sensitive B+-tree) CR-tree (cache-conscious version of the R-tree) Concurrency control (CC) in shared-memory multiprocessors Crucial for real-world main memory database applications Concurrent updates and reads Approaches : physical versioning, lock coupling, tree-level latching 3 / 31

Objectives A new, more efficient CC scheme for main memory indexes OLFIT : Optimistic Latch-Free Index Traversal Customized for B+-trees and CSB+-trees Eliminates latching during index traversal Reduces latching during index update Goals Multiprocessor scalability of : index search update performance 4 / 31

Physical Versioning Approach Index readers do not interfere with updaters New version of the node for the updater Incorporation of new version : tree-level latching or node-level latching Advantages Latch-free traversal of indexes High concurrency for read transactions Disadvantages High cost for creating versions - memory allocation and write Index performance decreases with the increase of update ratio Poor scalability of update performance 5 / 31

Lock Coupling Approach Latching nodes during index traversal Hold latch on node until request granted for latch on child Disadvantages Poor scalability Heavy latching of the nodes Latching index nodes => coherence cache misses Coherence cache misses A processor s cached copy of a block is invalidated by another processor updating the cache block. 6 / 31

Coherence Cache Misses Caused by Latching Latches : placed inside the index node Latching operation Acquire/release latch Involves memory write : Invalidation of cache block regardless if the node updated 7 / 31

Coherence Cache Misses Caused by Latching (cont.) 8 / 31

Coherence Cache Misses Caused by Latching (cont.) 9 / 31

Coherence Cache Misses Caused by Latching (cont.) 10 / 31

Coherence Cache Misses Caused by Latching (cont.) 11 / 31

Coherence Cache Misses Caused by Latching (cont.) 12 / 31

Rationale Purpose of index CC Index readers reach the correct leaf without interfering with concurrent updaters Index updaters do not interfere with each other Criteria for a good CC scheme High degree of parallelism Problem Probability of coherence cache misses increases with the number of processors Save cache misses by Latch-free traversal during index search Latch-free traversal during index update 13 / 31

Latch-Free Index Search and Update Latch-free index search Condition = consistent node reads Consistency = no update between start and end of node read Latch-free index update Assumptions 1 Most node updates occur at the leaf level or near the leaf level 2 Number of leaf nodes > number of processors => probability of conflict = low Consequences 1 Latches on upper-level nodes are acquired too conservatively 2 Latches on leaf nodes are acquired too pessimistically 14 / 31

Main Idea of OLFIT 1 Traverse down the index optimistically without latching any nodes 2 Updaters acquire the latch of the leaf node to be updated 3 Latch acquisition proceeds upward if node split or deletion necessary Update operations on a node = serialized using a latch Read operations on a node = retried in case of inconsistency 15 / 31

Node Structure of B+-tree for OLFIT Two primitives : UpdateNode and ReadNode 16 / 31

Node Operations for OLFIT Algorithm UpdateNode U1. Acquire latch. U2. Update the content. U3. Increment version. U4. Release latch. Algorithm ReadNode R1. Copy the value of version into a register R. R2. Read the content of the node. R3. If latch is locked, go to R1. R4. If the current value of version is different from the copied value in R, go to R1. 17 / 31

Example of Concurrency Control 18 / 31

Example of Concurrency Control 19 / 31

Example of Concurrency Control 20 / 31

Example of Concurrency Control 21 / 31

Example of Concurrency Control 22 / 31

Tree Operations for OLFIT Dealing with node split Use high key and link pointer to the right neighbor Dealing with node deletion Remove links to node Register node to garbage collector Deallocate node when no operation reads the node 23 / 31

Experimental Evaluation Implementation of index CC schemes for B+-tree and CSB+-tree Lock coupling with node latches (LC) Tree-level locking with a tree latch (TL) Physical versioning with node latches (VN) Physical versioning with a tree latch (VT) OLFIT (OL) No concurrency control (NO) Experimental setting 8 CPUs, each with 8MB L2 cache, cache line of 64 bytes Workloads : 100% search, 100% insert, 50% insert + 50% delete + mixture of search, insert and delete Initial index : 10 million uniformly distributed 4-byte integers Size of index nodes : 128 bytes 24 / 31

Pure Search Performance for B+-tree OL, VN and VT - similar to NO TL - worse due to contention at the tree-latch LC - worst due to many coherence cache misses 25 / 31

Pure Update Performance for B+-tree and CSB+-tree OL - the only scalable one VN and VT - worse due to high cost of versioning VN and LC - slowly increase performance as number of threads increases VT and TL - worse due to contention at the tree-latch 26 / 31

Eight-Thread Performance with Varying Update Ratio OL, VN and VT - comparable for update ratio = 0 OL - better than other when update ratio increases 27 / 31

Conclusions and Future Work Conclusions The effect of latching in CC => coherence cache misses New optimistic index CC - OLFIT for B+-trees and CSB+-trees 1 No latching during index traversal 2 Latching for index update - only when necessary Performance comparison experiments Superior update and read scalability of OLFIT Future work Adaptation of OLFIT to other cache-conscious schemes, e.g. CR-tree Test OLFIT in real main memory database applications 28 / 31

Related Work Concurrency of Operations on B-Trees - 1977 Logical and Physical Versioning in Main Memory Databases - 1997 Presented paper - 2001 Indexing Moving Objects using Short-Lived Throwaway Indexes - 2009 Relation to own paper Concurrency control in main memory indexes Reduce latching to achieve greater performance - allow reading during updating 29 / 31

Critique Good aspects Relevant and various comparison experiments of five CC schemes : varying the number of threads on different workloads single thread and eight-thread varying the update ratio Good background Structured - easy to follow argument Could be improved More detailed proof that node splits are correctly handled (example) Generation of workloads is uniform - variation of insert/delete locality No related work section - included in the introduction instead Better formulation, e.g. parallel transact, we use the technique of using 30 / 31

Questions? 31 / 31