OPERATING SYSTEMS SHOULD PROVIDE TRANSACTIONS Donald E. Porter and Emmett Witchel The University of Texas at Austin.

Slides:



Advertisements
Similar presentations
Implementing Domain Decompositions Intel Software College Introduction to Parallel Programming – Part 3.
Advertisements

Using T4Eclipse tool to Analyze Eclipse UI For t4eclipse version Ben Xu July 17,2010.
Managing Multi-User Databases (1) IS 240 – Database Management Lecture #18 – Prof. M. E. Kabay, PhD, CISSP Norwich University
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 38.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Chapter 1 Image Slides Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Building a Fast, Virtualized Data Plane with Programmable Hardware Bilal Anwer Nick Feamster.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
1 Episode III in our multiprocessing miniseries. Relaxed memory models. What I really wanted here was an elephant with sunglasses relaxing On a beach,
17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Data recovery 1. 2 Recovery - introduction recovery restoring a system, after an error or failure, to a state that was previously known as correct have.
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
Making the System Operational
ZMQS ZMQS
TOCTTOU Attacks Don Porter CS 380S
Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
Debugging operating systems with time-traveling virtual machines Sam King George Dunlap Peter Chen CoVirt Project, University of Michigan.
Managing Web server performance with AutoTune agents by Y. Diao, J. L. Hellerstein, S. Parekh, J. P. Bigu Jangwon Han Seongwon Park
Content Overview Virtual Disk Port to Intel platform
Chapter 4 Memory Management Basic memory management Swapping
ABC Technology Project
1 of 27 DA1241 Archive Companies Last updated: March-2004 DA1241 Archive Companies.
State of Connecticut Core-CT Project Query 8 hrs Updated 6/06/2006.
Chapter 10: Virtual Memory
Operating Systems Operating Systems - Winter 2011 Dr. Melanie Rieback Design and Implementation.
Operating Systems Operating Systems - Winter 2012 Dr. Melanie Rieback Design and Implementation.
More on File Management
Squares and Square Root WALK. Solve each problem REVIEW:
Database Concurrency Control and Recovery
Lecture plan Transaction processing Concurrency control
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Operating System Transactions
OPERATING SYSTEM TRANSACTIONS Donald E. Porter, Owen S. Hofmann, Christopher J. Rossbach, Alexander Benn, and Emmett Witchel The University of Texas at.
Restartability Manage- ment in the Cisco Core Router CRS/NG Stefan Schaeckeler (Cisco Systems, Inc.) Ashwin Narasimha Murthy (Google, Inc.)
Indra Budi Transaction Indra Budi
Chapter 5 Test Review Sections 5-1 through 5-4.
Addition 1’s to 20.
25 seconds left…...
Håkan Sundell, Chalmers University of Technology 1 Evaluating the performance of wait-free snapshots in real-time systems Björn Allvin.
Week 1.
We will resume in: 25 Minutes.
1 Unit 1 Kinematics Chapter 1 Day
Copyright 2013 – Noah Mendelsohn Compiling C Programs Noah Mendelsohn Tufts University Web:
14-1 © Prentice Hall, 2004 Chapter 14: OOSAD Implementation and Operation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh.
Chapter 16: Recovery System
Software & Services Group PinPlay: A Framework for Deterministic Replay and Reproducible Analysis of Parallel Programs Harish Patil, Cristiano Pereira,
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
InkTag: Secure Applications on an Untrusted Operating system
Transaction Management Chapter 9. What is a Transaction? A logical unit of work on a database A logical unit of work on a database An entire program An.
Sangman Kim, Michael Z. Lee, Alan M. Dunn, Owen S. Hofmann, Xuan Wang, Emmett Witchel, Donald E. Porter 1.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Concurrency Control. Objectives Management of Databases Concurrency Control Database Recovery Database Security Database Administration.
Geoffrey Trujillo CSE 430.  POSIX system calls do not handle concurrency well  Only one system call can be guaranteed to execute atomically  System.
Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University.
Free Transactions with Rio Vista Landon Cox April 15, 2016.
Free Transactions with Rio Vista
Google Filesystem Some slides taken from Alan Sussman.
Transaction Properties
Lecture 6: Transactions
Free Transactions with Rio Vista
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Presentation transcript:

OPERATING SYSTEMS SHOULD PROVIDE TRANSACTIONS Donald E. Porter and Emmett Witchel The University of Texas at Austin

Example: browser plug-in upgrade 2 write new plug-in binary start browser, old config, old plug-in arguments corrupt data files exec post-install script (updates browser config)  API can’t ensure consistent updates to OS resources  Concurrency and crashes cause subtle inconsistencies

System Transactions  Express consistency requirements to OS  Transaction wraps group of system calls  Results isolated until commit  Interfering operations automatically serialized  Long-overdue OS feature  Natural abstraction  Solves important problems  Practical implementation 3

Transactional Software Install sys_xbegin(); apt-get upgrade sys_xend();  A failed install is automatically rolled back  Concurrent operations are not  System crash: reboot to entire upgrade or none  Concurrent apps see consistent state 4

System Transactions 5  Operating systems should provide them  Operating systems can provide them

The POSIX API is broken 6  System resources have long-standing race conditions  Time-of-check-to-time-of-use (TOCTTOU)  Temporary file creation  Signal handling  Correct, concurrent apps need system-level isolation  Multi-core chips raise importance of concurrency

System-level races if(access(“foo”)) { fd = open(“foo”); … } (root) symlink(“secret”, “foo”); 7 foo == secret

Complex work-arounds  TOCTTOU: users write their own directory traversal  openat(), fstatat(), etc.  User re-implements filename translation  Race between open/fcntl  Add CLOSE_ON_EXEC flags to 15 system calls  Temporary file creation libraries  mkstemp,tmpfile, etc. 8

Work-arounds don’t work 9  Complex APIs do not yield secure programs  Experts can’t even agree  mkstemp man page: “Don’t use this function, use tmpfile(3) instead.”  - VOID FI039-C: “It is thus recommended that… mkstemp() be used [instead of tmpfile() ]”  Transactions can fix the problem

TOCTTOU redux sys_xbegin(); if(access(“foo”)) { fd = open(“foo”); read(fd,…); … } sys_xend(); (root) symlink(“secret”, “foo”); 10

Transactions solve important problems 11  Applications  Replace databases for simple synchronization  Support system calls in transactional memory apps  Tolerate faults in untrusted software modules  Atomically update file contents and access control list  Easier to write OS extensions  System Tx + Journal = Tx Filesystem

Hasn’t this already been done? man transaction No manual entry for transaction 12

Related Systems 13  Similar interface, different implementation  QuickSilver [SOSP ‘91], TABS [SOSP ‘85] Weaker guarantees  TxF, Valor [FAST ‘09] Only file system transactions  Different interface, similar implementation  Speculator [SOSP ’05, OSDI ‘06]  Terms “transaction” and “OS” appear in paper title  TxLinux [SOSP ’07, ASPLOS ‘09]

Can OSes provide transactions?  TxOS: Extends Linux to support transactions  Runs on commodity hardware  Rest of talk:  Approach  Validation 14

Version Management 15  How to keep old and new data?  Need old data to roll back  TxOS approach:  Transactions operate on private copies of data  Replace old data structures at commit  Example: kernel data structures

TxOS Version Management Transaction sys_xbegin(); if(access(“foo”)){ fd = open(“foo”); write(fd, “Hi”); } sys_xend(); File “foo” 16 Hi

Object versioning in TxOS  Deadlock-free  Transactions do not hold kernel locks across syscalls  Follows existing locking discipline  Previous work used 2-phase locking, undo log  Prone to deadlock  Efficient – a pointer swap per committed object  Copy-on-write optimizations 17

Serializing Tx with No-Tx 18  Important property for intuitive semantics  Supports incremental adoption  Serialize TOCTTOU attacker  Attacker will not use transactions  Hard to support in software systems  Not provided by historical OSes, many STMs

Validation 19  Is implementation tractable?  Is performance acceptable?

Tractable, challenging implementation  Transactions:  Add 8,600 LOC to Linux  Minor modifications to 14,000 LOC  Simple API, not a simple implementation  Hard to write concurrent programs  Developers need good abstractions  Transactions are worth the effort 20

Acceptable Performance 21  Speedup compared to unmodified Linux LFS Large File Phase %Slowdown % Speedup  40% overhead for dpkg install

OSes can support transactions 22  Tractable Implementation  Acceptable Performance

OSes should provide transactions  Solve long-standing problems  Replace ad hoc solutions  Broad range of applications  Acceptable cost 23