XCalls: Safe I/O in Memory Transactions Haris Volos, Andres Jaan Tack, Neelam Goyal +, Michael Swift, Adam Welc § University of Wisconsin - Madison + §

Slides:



Advertisements
Similar presentations
Transactional Memory Challenges: Workloads, Execution Model, and Implementation Colin Blundell & Milo M. K. Martin University of Pennsylvania {blundell,
Advertisements

TRAMP Workshop Some Challenges Facing Transactional Memory Craig Zilles and Lee Baugh University of Illinois at Urbana-Champaign.
Transactional Memory Parag Dixit Bruno Vavala Computer Architecture Course, 2012.
IDA / ADIT Lecture 10: Database recovery Jose M. Peña
Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Rich Transactions on Reasonable Hardware J. Eliot B. Moss Univ. of Massachusetts,
1 Cheriton School of Computer Science 2 Department of Computer Science RemusDB: Transparent High Availability for Database Systems Umar Farooq Minhas 1,
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
Transactional Memory (TM) Evan Jolley EE 6633 December 7, 2012.
The ‘system-call’ ID-numbers How can Linux applications written in assembly language create and access files?
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Exceptions and side-effects in atomic blocks Tim Harris.
3.5 Interprocess Communication
Chapter 8 : Transaction Management. u Function and importance of transactions. u Properties of transactions. u Concurrency Control – Meaning of serializability.
Figure 1.1 Interaction between applications and the operating system.
Experience with K42, an open- source, Linux-compatible, scalable operation-system kernel IBM SYSTEM JOURNAL, VOL 44 NO 2, 2005 J. Appovoo 、 M. Auslander.
Transaction Management WXES 2103 Database. Content What is transaction Transaction properties Transaction management with SQL Transaction log DBMS Transaction.
TRANSACTION PROCESSING TECHNIQUES BY SON NGUYEN VIJAY RAO.
Highly Available ACID Memory Vijayshankar Raman. Introduction §Why ACID memory? l non-database apps: want updates to critical data to be atomic and persistent.
©2009 HP Confidential1 A Proposal to Incorporate Software Transactional Memory (STM) Support in the Open64 Compiler Dhruva R. Chakrabarti HP Labs, USA.
Copyright 2007 Sun Microsystems, Inc SNZI: Scalable Non-Zero Indicator Yossi Lev (Brown University & Sun Microsystems Laboratories) Joint work with: Faith.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Integrating and Optimizing Transactional Memory in a Data Mining Middleware Vignesh Ravi and Gagan Agrawal Department of ComputerScience and Engg. The.
Condition Variables and Transactional Memory: Problem or Opportunity? Polina Dudnik and Michael Swift University of Wisconsin, Madison.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Low-Overhead Software Transactional Memory with Progress Guarantees and Strong Semantics Minjia Zhang, 1 Jipeng Huang, Man Cao, Michael D. Bond.
Source: Operating System Concepts by Silberschatz, Galvin and Gagne.
Hybrid Transactional Memory Sanjeev Kumar, Michael Chu, Christopher Hughes, Partha Kundu, Anthony Nguyen, Intel Labs University of Michigan Intel Labs.
The Relational Model1 Transaction Processing Units of Work.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
Thread Implementations; MUTEX Reference on thread implementation –text: Tanenbaum ch. 2.2 Reference on mutual exclusion (MUTEX) –text: Tanenbaum ch
The ATOMOS Transactional Programming Language Mehdi Amirijoo Linköpings universitet.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Storage Systems CSE 598d, Spring 2007 Rethink the Sync April 3, 2007 Mark Johnson.
StealthTest: Low Overhead Online Software Testing Using Transactional Memory Jayaram Bobba, Weiwei Xiong*, Luke Yen †, Mark D. Hill, and David A. Wood.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
© 2008 Multifacet ProjectUniversity of Wisconsin-Madison Pathological Interaction of Locks with Transactional Memory Haris Volos, Neelam Goyal, Michael.
CoreDet: A Compiler and Runtime System for Deterministic Multithreaded Execution Tom Bergan Owen Anderson, Joe Devietti, Luis Ceze, Dan Grossman To appear.
AtomCaml: First-class Atomicity via Rollback Michael F. Ringenburg and Dan Grossman University of Washington International Conference on Functional Programming.
Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University.
Improving the Reliability of Commodity Operating Systems Michael M. Swift, Brian N. Bershad, Henry M. Levy Presented by Ya-Yun Lo EECS 582 – W161.
OS Labs 2/25/08 Frans Kaashoek MIT
Synchronization in Distributed File Systems Advanced Operating System Zhuoli Lin Professor Zhang.
OS interface: file and I/O system calls File operations in C/C++? –fopen(), fread(), fwrite(), fclose(), fseek() in C f.open(…), f.close(…) in C++ I/O.
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
File table: a list of opened files Each entry contains: – Index: file descriptors – Pointer to the file in memory – Access mode File descriptor is a positive.
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Part 4: Managing File System State Dr. Xiao Qin Auburn University.
Chapter 3: Windows7 Part 5.
Hathi: Durable Transactions for Memory using Flash
Speculative Lock Elision
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Transactional Memory : Hardware Proposals Overview
Threads Cannot Be Implemented As a Library
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory By McKenney, Michael, Triplett and Walpole.
Faster Data Structures in Transactional Memory using Three Paths
Chapter 3: Windows7 Part 5.
Lecture 6: Transactions
Thread Implementations; MUTEX
2/25/08 Frans Kaashoek MIT OS abstractions 2/25/08 Frans Kaashoek MIT
File I/O (1) Prof. Ikjun Yeom TA – Mugyo
Lecture 22: Consistency Models, TM
Software Transactional Memory Should Not be Obstruction-Free
Thread Implementations; MUTEX
Low-Level I/O – the POSIX Layer CSE 333 Winter 2019
Dynamic Performance Tuning of Word-Based Software Transactional Memory
Controlled Interleaving for Transactions
Presentation transcript:

xCalls: Safe I/O in Memory Transactions Haris Volos, Andres Jaan Tack, Neelam Goyal +, Michael Swift, Adam Welc § University of Wisconsin - Madison + §

CMP leads to more concurrency within programs Synchronizing access to shared data via locks is hard atomic construct simplifies synchronizing access to shared data atomic { x = x - c; y = y + c; } LOCK(L) x = x - c; y = y + c; UNLOCK(L) store(A) store(B) store(A) Transactional Memory (TM) Thread 1 atomic { A = A – 20; B = B + 20; } atomic { B = B – 10; A = A + 10; } Thread 2 Atomicity: PERFORM both updates to A and B or none Isolation: OBSERVE both red transaction’s updates to A and B or none ABORT conflicting transactions Abort blue Conflict 2

A challenging world… Real world programs frequently take actions outside of their own memory – Firefox: ~1% critical sections do system call [Baugh TRANSACT ’07] Most TM systems apply only to user-level memory Thread 1 atomic { item = procItem(queue); write (file, principal); write (file, item->header); } atomic { item = procItem(queue); write (file, principal); write (file, item->header); } memoryfile Thread 2 1a 2b 1a Abort Interleaved writes File writes not dropped Memory updates dropped 3 1a 1b 2a 2b

State of the art Defer Undo Global Lock Ignore failures Stop the world 4 atomic { item = procItem(queue); write (file, principal); write (file, item->header); send (socket, item->body); } LAN Internet NAS COMMIT Perform send Defer

Contribution 5 xCall programming interface – Exposes transactional semantics to programmer – Enables I/O within transactions w/o stopping the world – Exposes all failures to the program Transactional Program Transaction-unaware kernel System call interface xCall Library Legacy calls xCalls Runs in user mode

Outline Motivation xCall Design & Implementation Evaluation Conclusion 6

Design overview Principles 1.As early as possible but not earlier 2.Expose all failures Components – Atomic execution – Isolation – Error handling 7

Atomic execution Provide abort semantics for kernel data and I/O  Expose to programmer when action is performed 8 atomic { item = procItem(queue); x_write (file, principal); x_write (file, item->header); } file Abort buffers Can reverse action?Need result?ExecutionExample NoYesGlobal lock ioctl() No Defer x_write_pipe() Yes--In-place x_write()

Isolation Prevent conflicting changes to kernel data made within a transaction  Sentinels – Revocable user-level locks – Lock logical kernel state visible through system calls Thread 1 atomic { item = procItem(queue); x_write (file, principal); x_write (file, item->header); } atomic { item = procItem(queue); x_write (file, principal); x_write (file, item->header); } memoryfile Thread 2 Conflict 9

atomic { item = procItem(queue); x_write (file, principal, &err1); x_write (file, item->header, &err2); x_send (socket, item->body, &err3); } if (err1 || err2 || err3) { /* CLEANUP */ } Error handling Some errors might not happen until transaction commits or aborts  Inform programmer when failures happen – Handle errors after transaction completes LAN Internet Defer Deferred send: FAILED err3 = error COMMIT Perform send Handle error here 10

ssize_t x_write (int fd, void *buf, ssize_t nbytes ) { void *localbuf; ssize_t bytes; get_sentinel(fd); localbuf = alloc_local_buf(nbytes); read(fd, localbuf, nbytes); bytes = write(fd, buf, nbytes); if (bytes != -1) compensate(x_undo_write, fd, localbuf, bytes, result); } int x_undo_write (int fd, void *buf, ssize_t nbytes, int *result){ off_t ret1, ret2; lseek(fd, -nbytes, SEEK_CUR); if (ret1) pwrite(fd, buf, nbytes, ret1); if (ret1 == -1 || ret2 == -1) *result = errno; return (ret1 == -1 || ret2 == -1); } Example: file write, int *result Atomic execution Isolation Error handling ret2 = 11 ret1 =

Summary xCall API exposes transactional semantics – Atomicity – Isolation – Error handling Prototype implementation – Executes as user-mode library – Relies on Intel STM for transactional memory – Provides 27 xCalls including file handling, communication, threading 12

Outline Motivation xCall Design & Implementation Evaluation – Benefit of xCalls over global lock – Benefit of TM over locks Conclusion 13

Evaluation platform Transactified three large multithreaded apps – Berkeley DB – BIND – XMMS Configurations – Native: locks + system calls – STM: transactions + system calls + global lock – xCalls: transactions + xCalls Run on 4 quad-core 2 GHz AMD Barcelona 14

Performance: Berkeley DB (1/2) 15 xCalls scales better than STM with global lock TM worse than locks due to STM overhead Workload: TPC-C

Performance: Berkeley DB (2/2) 16 xCalls improve concurrency over coarse grain lock Global lock kills optimistic concurrency Workload: Lockscale

Performance: BIND 17 Transactions scale better than coarse grain locks xCalls enable additional concurrency Workload: QueryPerf

Performance summary 18 xCalls benefit programs with I/O concurrency TM benefits programs with contended but not conflicting critical sections

Conclusion xCall programming interface – Brings common OS services to TM programs – Requires no kernel modifications – Improves scalability over state of the art 19 Questions?