Using RDMA for Lock Management

Similar documents
High Performance Distributed Lock Management Services using Network-based Remote Atomic Operations

High Performance Distributed Lock Management Services using Network-based Remote Atomic Operations

Advance Operating Systems (CS202) Locks Discussion

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Designing Next Generation Data-Centers with Advanced Communication Protocols and Systems Services

Concurrency: a crash course

AST: scalable synchronization Supervisors guide 2002

Multiprocessors II: CC-NUMA DSM. CC-NUMA for Large Systems

HIGH-PERFORMANCE NETWORKING :: USER-LEVEL NETWORKING :: REMOTE DIRECT MEMORY ACCESS

FaRM: Fast Remote Memory

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

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8.

Efficient and Truly Passive MPI-3 RMA Synchronization Using InfiniBand Atomics

Advanced Computer Networks. End Host Optimization

Multiprocessor Systems. COMP s1

Reliable Stream Analysis on the Internet of Things

Heckaton. SQL Server's Memory Optimized OLTP Engine

CSE Traditional Operating Systems deal with typical system software designed to be:

Chapter 18: Database System Architectures.! Centralized Systems! Client--Server Systems! Parallel Systems! Distributed Systems!

IT 540 Operating Systems ECE519 Advanced Operating Systems

Background: I/O Concurrency

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Performance Optimizations via Connect-IB and Dynamically Connected Transport Service for Maximum Performance on LS-DYNA

Advanced RDMA-based Admission Control for Modern Data-Centers

Distributed Systems COMP 212. Revision 2 Othon Michail

IsoStack Highly Efficient Network Processing on Dedicated Cores

Main Points of the Computer Organization and System Software Module

Introduction to Real-Time Operating Systems

S. Narravula, P. Balaji, K. Vaidyanathan, H.-W. Jin and D. K. Panda. The Ohio State University

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

Performance Analysis and Evaluation of Mellanox ConnectX InfiniBand Architecture with Multi-Core Platforms

FaSST: Fast, Scalable, and Simple Distributed Transactions with Two-Sided (RDMA) Datagram RPCs

Multiprocessor Systems. Chapter 8, 8.1

Adaptive Lock. Madhav Iyengar < >, Nathaniel Jeffries < >

Dealing with Issues for Interprocess Communication

arxiv: v2 [cs.db] 21 Nov 2016

Intel Thread Building Blocks, Part IV

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

Performance Evaluation of InfiniBand with PCI Express

Bull. HACMP 4.4 Programming Locking Applications AIX ORDER REFERENCE 86 A2 59KX 02

Threads Tuesday, September 28, :37 AM

Process- Concept &Process Scheduling OPERATING SYSTEMS

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Chapter 20: Database System Architectures

G52CON: Concepts of Concurrency

CSE 486/586 Distributed Systems

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

Multiprocessors and Locking

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Lecture 5: Synchronization w/locks

Deconstructing RDMA-enabled Distributed Transaction Processing: Hybrid is Better!

CSE 451: Operating Systems Winter Lecture 7 Synchronization. Steve Gribble. Synchronization. Threads cooperate in multithreaded programs

Concurrent Preliminaries

Multifunction Networking Adapters

Mutex Implementation

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory

Lock Management with RDMA: Decentralization without Starvation.

Synchronization COMPSCI 386

High-Performance Key-Value Store on OpenSHMEM

CMSC421: Principles of Operating Systems

OPERATING SYSTEMS. Prescribed Text Book. Operating System Principles, Seventh Edition. Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

Process Synchronisation (contd.) Operating Systems. Autumn CS4023

Deconstructing RDMA-enabled Distributed Transactions: Hybrid is Better!

The End of a Myth: Distributed Transactions Can Scale

An Evaluation of Distributed Concurrency Control. Harding, Aken, Pavlo and Stonebraker Presented by: Thamir Qadah For CS590-BDS

COMP 300E Operating Systems Fall Semester 2011 Midterm Examination SAMPLE. Name: Student ID:

QUESTION BANK UNIT I

Process Synchroniztion Mutual Exclusion & Election Algorithms

Resource management. Real-Time Systems. Resource management. Resource management

Process Synchronisation (contd.) Deadlock. Operating Systems. Spring CS5212

Designing Efficient Systems Services and Primitives for Next-Generation Data-Centers

Lecture 23 Database System Architectures

Multiprocessor Cache Coherence. Chapter 5. Memory System is Coherent If... From ILP to TLP. Enforcing Cache Coherence. Multiprocessor Types

SoftRDMA: Rekindling High Performance Software RDMA over Commodity Ethernet

CS 31: Introduction to Computer Systems : Threads & Synchronization April 16-18, 2019

Operating Systems. Lecture 4 - Concurrency and Synchronization. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Midterm 1, CSE 451, Winter 2001 (Prof. Steve Gribble)

Monitors; Software Transactional Memory

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

10-Gigabit iwarp Ethernet: Comparative Performance Analysis with InfiniBand and Myrinet-10G

Concurrency. Glossary

CS 153 Design of Operating Systems Winter 2016

Concurrency: Deadlock and Starvation

PROJECT 6: PINTOS FILE SYSTEM. CS124 Operating Systems Winter , Lecture 25

UNIT:2. Process Management

CS 333 Introduction to Operating Systems. Class 4 Concurrent Programming and Synchronization Primitives

CS 153 Design of Operating Systems Winter 2016

Tasks. Task Implementation and management

SSC - Concurrency and Multi-threading Advanced topics about liveness

Implementing Mutual Exclusion. Sarah Diesburg Operating Systems CS 3430

Operating System Design Issues. I/O Management

Chapter 8 Fault Tolerance

Synchronising Threads

Intra-MIC MPI Communication using MVAPICH2: Early Experience

University of Waterloo Midterm Examination Model Solution CS350 Operating Systems

EPOS: an Object-Oriented Operating System

CS370 Operating Systems

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Unit 2 : Computer and Operating System Structure

An Implementation of the Homa Transport Protocol in RAMCloud. Yilong Li, Behnam Montazeri, John Ousterhout

Transcription:

Using RDMA for Lock Management Yeounoh Chung Erfan Zamanian {yeounoh, erfanz}@cs.brown.edu Supervised by: John Meehan Stan Zdonik {john, sbz}@cs.brown.edu Abstract arxiv:1507.03274v2 [cs.dc] 20 Jul 2015 In this work, we aim to evaluate different Distributed Lock Management service designs with Remote Direct Memory Access (RDMA). In specific, we implement and evaluate the centralized and the RDMA-enabled lock manager designs for fast network settings. Experimental results confirms a couple of hypotheses. First, in the traditional centralized lock manager design, CPU is the bottleneck and bypassing CPU on client-to-server communication using RDMA results in better lock service perofrmance. Second, different lock manager designs with RDMA in consideration result in even better performance; we need to re-design lock management system for RDMA and fast networks. 1. Introduction Lock management is a critical component of many distributed systems, such as databases and file systems, in which shared resources are accessed by many applications across the network. A lock manager provides advisory locking services to these higher level applications and therefore is used to ensure serialization of access to shared resources (for example databases need this property to ensure the isolation between concurrent transactions). In a single-sited lock managers, clients have to contact the centralized lock service before accessing or moving any data item. In such systems, reasoning about starvation and deadlocks is relatively straightforward, and is handled by the central lock server. They are rarely used in distributed systems, however, due to two main reasons. First, as all requests have to be handled by a single machine, the central lock manager becomes the bottleneck and therefore such systems do not scale with the number of clients. Second, loosely-coupled distributed systems are usually deployed on commodity clusters, where failures are quite common. A failure or delay in the central lock manager could bring the entire system down. In this work, we aim to evaluate different Distributed Lock Management service designs with Remote Direct Memory Access (RDMA). In specific, we implement and evaluate the centralized and the RDMA-enabled lock manager designs for fast network settings. Our hypothesis is that the centralized lock manager is the bottleneck and bypassing CPU on client-to-server communication using RDMA results in better lock service performance; furthermore, different lock manager designs with RDMA in consideration result in even better performance. The key idea is to have clients take part in lock management via RDMA, and our experimental results show that the new lock manager designs along this line can outperform the traditional centralized lock manager by an order of magnitude. In the following sections, we first describe RDMA features and basics, describe different lock manager designs and their performances over a fast network. Finally, we highlight the comparison results in section 5. And we discuss any related work to this project in section 6 and conclude in section 7. 2. Remote Direct Memory Access Remote Direct Memory Access (RDMA) is an emerging technology in computer networks which allows machines send or receive messages directly to each other s memory. Invoking this process does not involve any system call and context switch from the user space 1

to the kernel space. Besides, throughout the process, kernel of either side is not involved. As most operating systems impose high overheads for interrupt processing, network protocol stacks, and context switching, avoiding them significantly helps decrease the latency. RDMA programming model is based on the concept of verbs, which allows for two communication models: one-sided communication and two-sided communication. One-sided, or memory semantic verbs, are those verbs which are performed without any knowledge of the remote side. RDMA READ, WRITE, and atomic operations, such as Compare and Swap (CS), and Fetch and Add (FA) are one-sided operations. The active side submits the verb, while the passive side is completely unaware of the process. Both active and passive sides must register the memory region to be able to access it via RDMA. The passive side s RNIC directly writes/fetches the desired data using an DMA operation from local memory. Two-sided, or channel semantic verbs, such as SEND and RECEIVE, require both sites to involve in the communication process. The payload of the SEND is written to the memory region specified by a corresponding RECEIVE which must be posted by the receiver before the sender actually sends its request. Therefore, the sender s RNIC does not have to register the remote memory region before performing the operation. While two-sided verbs are workflow-wise similar to socket programming semantics, namely read() and write(), leveraging the onesided verbs, such as READ and WRITE, requires a dramatic change in the programming model. RDMA uses the concept of queue pairs for connections. Application posts verbs to the send queue, which has a corresponding receive queue on the receive side, so the name queue pair. Once RNIC performs the requested memory access at the remote side, it pushes a completion event on a corresponding completion queue, which can notify the sender about the completion of the task. All queues are maintained inside RNIC. 3. Server Centric Design Centralized lock management is one of the simplest design for a lock service that we often encounter in textbooks. This traditional approach can be easily implemented by allowing a single thread to access a shared memory region or a code section, which effectively serialize concurrent requests from multiple clients. In this section, we first describe the architecture and some important implementation details; next we discuss the performance characteristics of the centralized lock manager over a fast Network (i.e., InfiniBand) using TCP/IP sockets and RDMA send/receive verbs. A centralized lock manager spawns a thread for each incoming client connection; each thread is responsible for the communication between the server and a connecting client. Messaging via TCP/IP sockets incurs context switching overheads and much of CPU cycles are spent on message handling in kernel. In our experiment with 40 clients, each sending 100,000 lock request and release requests, more than 90% of server CPU cycles were spent on message handling in kernel. Any requests received by the server are first registered to an array of FIFO queues; each queue holds lock requests for a specific data item. Any access to a queue within the array is protected by a mutex, and clients will block each other only if they are trying to access the same item. When a lock release request is received by a lock holding client, then the corresponding request is popped from the queue after the server acknowledges the release request; the next requests in the queue is granted the lock. Subsequent shared lock requests can be granted together if no client is holding the same lock in the exclusive mode. TCP/IP blocking read and write are costly, but the burden can be offloaded to network hardware using RDMA send/receive verbs and the saved CPU cycles can be used to process more lock requests; hence, making the lock manager more scalable. In Figure 1(a), the throughput of the traditional design can be improved using RDMA send/receive verbs (S/R) and scales with the increasing number of clients. On the other hand, the throughput of the system using 2

(a) vs. number of client (b) vs. contention rate Figure 1: Throughput of centralized lock manager with RDMA send/receive verbs TCP/IP socket (TCP) tampers off quickly as the server s CPU is overloaded. With 100 lock items being shared among multiple clients, the server with RDMA tops around at 1.4M locks per second, whereas the one with TCP/IP yields only about 40880 locks per second. Processing a message takes about 10 4 CPU cycles and assuming forty 3GHz cores, a loose upper bound for the lock throughput is roughly 30M locks per second. Figure 1(b) shows how the throughput changes as we vary the contention rate: CR = 1 N item /N client, where N item is the number of items and N client is the number of clients. Assuming a uniform access pattern for each client, the more clients there are relative to the number of items indicates the higher contention among the clients. Here, the number of clients is fixed at 40. 4. Pure Client Centric Design One problem with server centric designs is that server could become the bottleneck as the number of clients grows. In order to support concurrent requests, servers are usually implemented as a multi-threaded program. In such cases, accessing or modifying the state of locks requires using mutexes, semaphores or other similar concurrency control mechanisms, which is expensive. Given that the logic of a lock manager is relatively simple (lock and unlock an item), RDMA could be leveraged to allow the clients directly participate in lock management. We started out with an extreme design, where RDMA is leveraged as much as possible. The basic idea here is that server is completely oblivious of lock requests, and serves merely as the lock holder, while clients directly compete for lock acquisition. As such, clients try to register themselves as the shared or exclusive owner of the lock by issuing RDMA atomic operations. In the following, we will explain the details of our algorithm. Lock states are kept inside the lock table, which resides in the main memory, whose structure is shown in Figure 2. Entry i of this table represents the status of lock i as a 64-bit memory region, and is divided to two 32-bit parts. the most significant 32 bits represent the client ID which is currently owning the exclusive lock. The least significant 32 bits represent the number of requests for the shared lock. In the following subsections, we outline the procedure for acquiring and releasing locks. 4.1. Exclusive Lock Acquisition As a client can only acquire exclusive lock when nobody else is holding the lock (neither in shared mode nor exclusive), the procedure must be only successful if these requirements are fulfilled. Therefore, the client submits an atomic Compare-and-Swap to the server with the following parameters: (0 0) as the expected value, and (client_id 0) as the swap value. The first number of each tuple is the most significant 32 bits, and the second one is the least significant one. Note that atomic operations always return the old value of the asked memory regions, regardless of whether or not they succeeded. Therefore, the client can know whether its CAS request was successful or not, by comparing the return value to (0 0). Any value other than this means 3

Figure 2: Server s memory layout for client centric design that the lock is not acquired. If it was successful, the client does not need to do anything else. If not, then it backs off for a pre-determined time, and try again with the same parameters. We found that the back-off should of 0 seconds gives the best result. 4.2. Shared Lock Acquisition Shared lock can be acquired when nobody is holding the lock, or if all the owners are also in shared mode. Therefore, the algorithm must make sure that the shared lock is not granted only when there is an exclusive owner. Therefore, the client sens an atomic Fetch-and-Add with increment value equals one to the server. Note that atomic FA is always successful and adds the specified value to the memory region. Again, the return value of this operation determines whether the lock is granted or not. If the exclusive part of returned value (the most significant 32 bits) is zero, then the client can go ahead with the shared lock. If not, then the lock must be exclusively owned by another client. In this case, similar to exclusive lock, the client backs off for a specific amount of time, and then retry. However, retrying is not be done by submitting another FA operation, since calling FA again will cause the lock status to get incremented once more. Therefore, the consequent retries will be done via RDMA READ of the exclusive part (only 32 bits). If the client finds that the lock is not in exclusive mode, it can proceed with the shared lock. 4.3. Exclusive Lock Release In order to release an exclusive lock, the client only needs to clear the exclusive part of the lock status. This can be easily done by RDMA WRITE. More specifically, the client WRITEs zero to the exclusive part of the lock. 4.4. Shared Lock Release As we have seen in Section 4.2, acquiring shared lock involves atomically incrementing the shared part of the lock status. Consequently, releasing the shared lock involves decrementing the same region by one. 5. Experiments We evalute the server centric (TCP, S/R) and the client centric (Backoff) designs for lock operation throughput. The evaluation is done with a small cluster of 7 machines, each equipped with 40-cosre processors. Figure 3 shows the throughput comparison results for server centric and client centric designs. RDMA let clients to bypass server CPU in requesting and receiving locks and the server can handle more lock requests with its limited resources; furthermore, the client centric design outperforms the server centric design, even with RDMA, by a huge margin. 6. Related Work Distributed lock management over the traditional network has been the topic of many research works [1, 4]. [2, 5] presented a detailed 4

(a) vs. number of client (b) vs. contention rate Figure 3: Throughput comparison results for different designs analysis of lock management in distributed systems. There are a few works which tried to leverage one-sided RDMA verbs to build a DLM [3, 6]. The authors in [3] proposed to use atomic operations to provide. The basic idea is to have the server only store the tail of the FIFO lists. Each client keeps track of its immediate subsequent node in the queue. Once a node is done with a lock, if it has a child, it notifies it by sending an RDMA message to that node. It is worth noting that their design only supports exclusive locks. Their techniques were augmented by Narravula et al. [6] to support shared locks. Both these papers have the problem of resulting too many connections between clients, and is not scalable with the number of clients. 7. conclusion We set out to remove the bottleneck of the traditional lock manager, which we speculated to be CPU. Using RDMA with the traditional lock manager, we were able to achieve just that; however, re-designing the lock manager and having the clients to partake in lock management can dramatically improve the system throughput. We believe that the proposed design is still not the right way to leverage RDMA for lock management. In the future, we would like to explore several design choices. References [1] M. Aldred, I. Gertner, and S. McKellar. A distributed lock manager on fault tolerant mpp. In System Sciences, 1995. Proceedings of the Twenty-Eighth Hawaii International Conference on, volume 1, pages 134 136. IEEE, 1995. [2] E. Born. Analytical performance modelling of lock management in distributed systems. Distributed Systems Engineering, 3(1):68, 1996. [3] A. Devulapalli and P. Wyckoff. Distributed queue-based locking using advanced network features. In Parallel Processing, 2005. ICPP 2005. International Conference on, pages 408 415. IEEE, 2005. [4] H. Kishida and H. Yamazaki. Ssdlm: architecture of a distributed lock manager with high degree of locality for clustered file systems. In Communications, Computers and signal Processing, 2003. PACRIM. 2003 IEEE Pacific Rim Conference on, volume 1, pages 9 12. IEEE, 2003. [5] W. J. Knottenbelt, S. Zertal, and P. G. Harrison. Performance analysis of three implementation strategies for distributed lock management. IEE Proceedings-Computers and Digital Techniques, 148(4):176 187, 2001. [6] S. Narravula, A. Mamidala, A. Vishnu, K. Vaidyanathan, and D. K. Panda. High performance distributed lock management services using network-based remote atomic operations. In Cluster Computing and the Grid, 2007. CCGRID 2007. Seventh IEEE International Symposium on, pages 583 590. IEEE, 2007. 5