1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter:

Slides:



Advertisements
Similar presentations
Maurice Herlihy (DEC), J. Eliot & B. Moss (UMass)
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Chapter 6: Process Synchronization
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Transactional Memory: Architectural Support for Lock- Free Data Structures Herlihy & Moss Presented by Robert T. Bauer.
Chapter 6 Limited Direct Execution
PARALLEL PROGRAMMING with TRANSACTIONAL MEMORY Pratibha Kona.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
Transactional Memory Yujia Jin. Lock and Problems Lock is commonly used with shared data Priority Inversion –Lower priority process hold a lock needed.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Computer Organization and Architecture The CPU Structure.
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
Selfishness in Transactional Memory Raphael Eidenbenz, Roger Wattenhofer Distributed Computing Group Game Theory meets Multicore Architecture.
Processes 1 CS502 Spring 2006 Processes Week 2 – CS 502.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
TxLinux: Using and Managing Hardware Transactional Memory in an Operating System Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan,
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan, Aditya Bhandari, and Emmett Witchel - Presentation By Sathish P.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Chapter 11 Operating Systems
Unbounded Transactional Memory Paper by Ananian et al. of MIT CSAIL Presented by Daniel.
1 Concurrency: Deadlock and Starvation Chapter 6.
Interrupt Mechanisms in the 74xx PowerPC Architecture Porting Plan 9 to the PowerPC Architecture Ajay Surie Adam Wolbach.
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
Introduction to Embedded Systems
80386DX.
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Solution to Dining Philosophers. Each philosopher I invokes the operations pickup() and putdown() in the following sequence: dp.pickup(i) EAT dp.putdown(i)
The Linux Kernel: A Challenging Workload for Transactional Memory Hany E. Ramadan Christopher J. Rossbach Emmett Witchel Operating Systems & Architecture.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
The Stack This is a special data structure: –The first item to be placed into the stack will be the last item taken out. Two basic operations: –Push: Places.
CSE 451: Operating Systems Section 5 Midterm review.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
ECGR-6185 µC/OS II Nayana Rao University of North Carolina at Charlotte.
CS510 Concurrent Systems Why the Grass May Not Be Greener on the Other Side: A Comparison of Locking and Transactional Memory.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Implementing Precise Interrupts in Pipelined Processors James E. Smith Andrew R.Pleszkun Presented By: Shrikant G.
Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University.
Architectural Features of Transactional Memory Designs for an Operating System Chris Rossbach, Hany Ramadan, Don Porter Advanced Computer Architecture.
April 6, 2016ASPLOS 2016Atlanta, Georgia. Yaron Weinsberg IBM Research Idit Keidar Technion Hagar Porat Technion Eran Harpaz Technion Noam Shalev Technion.
December 1, 2006©2006 Craig Zilles1 Threads & Atomic Operations in Hardware  Previously, we introduced multi-core parallelism & cache coherence —Today.
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
Virtual Memory - Part II
PHyTM: Persistent Hybrid Transactional Memory
University of Texas at Austin
Atomic Operations in Hardware
Advanced Operating Systems - Fall 2009 Lecture 8 – Wednesday February 4, 2009 Dan C. Marinescu Office: HEC 439 B. Office hours: M,
Challenges in Concurrent Computing
Professor, No school name
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E
Lecture 2 Part 2 Process Synchronization
Architectural Support for OS
Hybrid Transactional Memory
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
CS333 Intro to Operating Systems
Outline Operating System Organization Operating System Examples
Architectural Support for OS
Controlled Interleaving for Transactions
CSE 542: Operating Systems
Presentation transcript:

1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter: Zhong Zhou CSE Department University of Connecticut

2 Outline Introduction & Background Architectural Model Interrupts and Transactions Stack memory and Transactions Modifying Linux to use HTM Evaluation Conclusions

3 Introduction What is Transaction? A finite sequence of machine instructions, executed by a single process, satisfying the following two conditions Serializability: transactions appear to execute serially, the steps of one transaction never appear to be interleaved with the steps of another. Atomicity: each transaction makes a sequence of changes to shared memory, when it completes, it either commits, make all changes visible to others, or it abort, causing its changes to be discarded.

4 Transactional memory A multiprocessor architecture for memory access synchronization as conventional mutual exclusion technique Basic instruction for manipulating transaction status Commit Abort Validate Basic primitive instruction for accessing memory Load transactional Load transactional-exclusive Store transactional

5 Why Transaction memory? Problem with Lock-based code Deadlock Convoying Priority inversion Transaction memory: Reduce programming complexity without sacrificing performance STM: software transaction memory HTM: hardware transaction memory

6 Main Contribution Examination of the architectural support necessary for an operation system to use HTM Creation of a transactional operating system Examination of the characteristics of transactions in TxLinux

7 Architecture Model Transaction semantics

8 Managing multiple transactions Stack based: independent transaction model XPUSH: Suspend the current transaction, saving its current state. XPOP: Restore the previously xpushed transaction. Allowing the suspended transaction to resume

9 Contention management Many content manage strategies have been implemented Polite, Karma, Eruption, et al. A new policy (size matters) Favors the transaction that has the large number of unique bytes read or written in its transaction working set

10 Backoff If conflict occurs between transactions, with high probability, it will happen again if immediate restart these transactions. Backoff mechanism is needed here Exponential backoff Linear backoff Random backoff

11 Interrupts and Transactions Interrupt handling background The top-half interrupt handler Disable all interrupt with equal and lower priorities Relatively short execution time, push as much work as possible to bottom-half The bottom-half interrupt handler

12 Observations for Interrupt handling Observations Transaction length: usually large Interrupt frequency: relative high Interrupt routing limitations: less flexible

13 Interrupt handling in TxLinux Start with XPUSH to suspend the currently running transaction Interrupt handler is allowed to start new, independent transaction Interrupt return path ends with an XPOP instruction

14 Stack memory and Transaction Stack memory is shared between thread in the Linux kernel On the X86 architecture, Linux thread share their kernel stack with interrupt handlers. The sharing of kernel stack address requires stack addresses to be part of transaction working sets to ensure isolation

15 Transactions that span activation frames Support independent Xbegin and Xend instruction. Xbegin and Xend can be called in different stack frame Example:

16 Live stack overwrite problem(1) One example:

17 Live stack overwrite problem(2) This problem stems from Calls to xbegin and xend occur in different stack frame The x86 trap architecture reuses the current stack on interrupt that does not change privilege level A transaction that is suspended can restart Solutions Change the interrupt handler stack to avoid the overwrite problem.

18 Transactional dead stack problem(1) One example:

19 Transactional dead stack problem(1) Solution Stack-based early release: During an active transaction, any time the stack pointer is incremented, if the new value of the stack pointer is on a different cache line from the old one, then, the processor releases the old cache lines from the transactional line

20 Modifying Linux to use HTM Spinlocks Lock->Xbegin, Unlock->Xend Atomic instructions Seqlocks Regions protected by seqlock loops are protected by a transaction in TxLinux Read-copy-update

21 Performance evaluation Simulation settings Split instruction\data L1 cache: 16KB, 4- way associative, 64-byte cache line Unified L2 cache: 4MB, 8-way associative, 64-byte cache line Main memory: 1GB IPC:1 instruction per cycle

22 Cache miss rates

23 System time

24 Contention management

25 Backoff policy

26 Conclusions HTM has the potential to greatly simplify the operating system synchronization while retaining a high degree of concurrency Examine several aspect of HTM implementation and policies Polka contention management policy is effective Backoff policy is important, both linear and exponential backoff work well

27 Thank You! Q & A?