Nested Transactional Memory: Model and Preliminary Architecture Sketches J. Eliot B. Moss Antony L. Hosking.

Slides:



Advertisements
Similar presentations
Copyright 2008 Sun Microsystems, Inc Better Expressiveness for HTM using Split Hardware Transactions Yossi Lev Brown University & Sun Microsystems Laboratories.
Advertisements

Chapter 4: Trees Part II - AVL Tree
The Linux Kernel: Memory Management
Advanced Database Discussion B Trees. Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if.
1 TRANSACTION & CONCURRENCY CONTROL Huỳnh Văn Quốc Phương Thái Thị Thu Thủy
Distributed Systems Fall 2010 Transactions and concurrency control.
Chapter 4 - Self-Stabilizing Algorithms for Model Conservation4-1 Chapter 4: roadmap 4.1 Token Passing: Converting a Central Daemon to read/write 4.2 Data-Link.
Memory Management (II)
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
Tutorial 6 & 7 Symbol Table
1 Lecture 8: Transactional Memory – TCC Topics: “lazy” implementation (TCC)
1 Lecture 24: Transactional Memory Topics: transactional memory implementations.
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
Hash Tables1 Part E Hash Tables  
Unbounded Transactional Memory Paper by Ananian et al. of MIT CSAIL Presented by Daniel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Multiprocessor Cache Coherency
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Distributed Deadlocks and Transaction Recovery.
Chapter 4. INTERNAL REPRESENTATION OF FILES
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Distributed Transactions
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
Multiprocessor cache coherence. Caching: terms and definitions cache line, line size, cache size degree of associativity –direct-mapped, set and fully.
CSCI-383 Object-Oriented Programming & Design Lecture 18.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Hardware.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Processes and Virtual Memory
CS307 Operating Systems Virtual Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
CPSC 252 Hashing Page 1 Hashing We have already seen that we can search for a key item in an array using either linear or binary search. It would be better.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5: Looping.
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
1 CSE 480: Database Systems Lecture 24: Concurrency Control.
1 Algorithms Queues, Stacks and Records stored in Linked Lists or Arrays.
Indexing Database Management Systems. Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files File Organization 2.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
Chapter Looping 5. The Increment and Decrement Operators 5.1.
Data Structures Evolution of algorithms for an array-based stack, queue, and linked-list. Evolved data structures used to evolve solutions to problems.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
Chapter Looping 5. The Increment and Decrement Operators 5.1.
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
CHAPTER 51 LINKED LISTS. Introduction link list is a linear array collection of data elements called nodes, where the linear order is given by means of.
Chapter 5 Ranking with Indexes. Indexes and Ranking n Indexes are designed to support search  Faster response time, supports updates n Text search engines.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
Translation Lookaside Buffer
Lecture 20: Consistency Models, TM
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Data Structure Interview Question and Answers
Virtualizing Transactional Memory
Multiprocessor Cache Coherency
B+ Tree.
Arithmetic using a stack
Two Ideas of This Paper Using Permissions-only Cache to deduce the rate at which less-efficient overflow handling mechanisms are invoked. When the overflow.
Lecture 6: Transactions
15-740/ Computer Architecture Lecture 5: Precise Exceptions
Section 18.8 : Concurrency Control – Timestamps -CS 257, Rahul Dalal - SJSUID: Edited by: Sri Alluri (313)
Lecture 21: Transactional Memory
Virtual Memory Hardware
Translation Lookaside Buffer
Lecture 22: Consistency Models, TM
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Transactions in Distributed Systems
Lecture 23: Transactional Memory
Lecture 21: Transactional Memory
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Lecture: Transactional Memory
Structure of Processes
Presentation transcript:

Nested Transactional Memory: Model and Preliminary Architecture Sketches J. Eliot B. Moss Antony L. Hosking

MOTIVATION Composition of Code – Possible Solution - Grouping all nested actions within their enclosing top-level action. Problems - Large monolithic actions increase the volume of work that must be done if a transaction needs to be rolled back. – Possible Solutions – Closed Transactions. – Allows each new portion of work to be attempted, and possibly to fail, without necessarily aborting work already accomplished Limit Concurreny

CLOSED NESTING Transactions – Top-level – Nested (child or sub-transactions) – Accumulate read and write sets – Data are not updated until a top-level transaction commits – Value Read. Conflicts – At least one of the accesses is a write, and neither transaction is an ancestor of the other. Commits – Read and write sets are unioned with those of parent – For top level transactions commits become permanent Aborts – Read and Write Sets (and associated tentatively written values) Discarded.

OPEN NESTING Allows further increases in concurrency, by releasing concrete resources earlier and applying conflict detection (and roll back) at a higher level of abstraction Commit – Discards its read set, and commit its writes at “top level. – Removes the written data elements from the read and write sets of all other transactions. Aborts – Additional mechanisms handle recording of any necessary compensating actions. – Update a list of compensating actions held by the action’s parent which are applied in cast of an abort.

NESTED EXECUTION MODEL Transactions – Have unique IDs. – Start live, may later commit or abort – Every non-zero transaction has a unique parent transaction – Running Transaction : A transaction with no (live) children, allowed to (attempt to) issue memory reads and writes. Memory – Map from memory locations memory values. Consists of different locations each assigned a value. System States – Includes all the “globally committed” memory state, plus memory state (read and write sets) for each transaction currently live in the system. – Is defined by a series of entries – Each entry consisting of : Transaction, The memory location it writes to The value it contains A flag indicating whether the transaction has written to the location or not (read).

NESTED EXECUTION MODEL Read Set – Consists of all entries for that transaction that have flag to false Write Set – Consists of all entries that have flag set to true. Loc Set – Union of the above two Location Value

NESTED EXECUTION MODEL ALLOWED READ & WRITES – A transaction can read a location of all other entries for that location either belong to the transaction itself, belong to one of its ancestors or have write bit set to false. – A transaction can write if all entries for that location are either the transaction’s or one of its ancestors.

NESTED EXECUTION MODEL EFFECTS of READS & WRITES – State remains unchanged if an entry already exists. – If not new state consists of previous plus new entry for the read carried out. – Open nested reads – Set written bit if any ancestor has it set. Used for global commit. – Writes delete previous value for the entry and sets written flag.

NESTED EXECUTION MODEL SEMANTICS OF COMMIT AND ABORT – Allowed only if transaction has no children in state. COMMIT – Open Nested Action: Updates the globally committed state for words that it wrote and forces drops from all transaction states of every word written. (Global commit) – Closed Action: Parent “inherits” its state ABORT – Open Nested: Drop all entries associated with the aborting transaction

H/W SKETCH 1: USING CACHE Hardware and Memory Tables – Transaction Data Cache

Transaction Parent Cache Overflow Summary Table

HW SKETCH-1 Creating Transaction – Obtain a free Transaction Parent Cache entry and an unused transaction id. Reading a Word. – Return Data if Cache contains Entry else – Check Overflow summary table. – Determine Parent and probe parent. – If there is no entry then Obtain value from main memory. Create two new entries: One for transaction 0 and one for current transaction. Transaction 0 entry is marked valid and not dirty. Its reader count is set to 1. The reading transaction’s entry is set to valid and dirty. Set Written and Ancestor written to 0, reader count to 0 and obtained from to 0. – If entry for ancestor exists Pull it into cache. Create new entry Set new entry valid and dirty Set Ancestor written to 1 if either Written or Ancestor written are 1 in the ancestor. Set Written 1 if we just set Ancestor written and this is an open nested action. Otherwise, increment Reader count of the ancestor’s entry – Freeing Data Cache entries – Determining Conflicts with Reads

HW SKETCH-1 Writing a Word. – Return Data if Cache contains Entry else – If there is no entry then Obtain value from main memory. Create two new entries: One for transaction 0 and one for current transaction. Transaction 0 entry is marked valid and not dirty. Indicate current transaction as writing transaction. The writing transaction’s entry is set to valid and dirty. Set Written to 1 and Ancestor written to 0, reader count to 0 and obtained from to 0. – If entry for ancestor exists Pull it into cache. Create new entry Set new entry valid and dirty Set data filed to value written Set Ancestor writing transaction filed to current. Current s obtained from to ancestor – Find unwritten entry: Similar to second part of above. – Determining Conflicts with Writes

HW SKETCH-1 Aborting Transaction – For each unwritten entry of the transaction, decrement the Obtained-from transaction’s Reader count for this entry. – For each written entry of the transaction, set the Obtained-from transaction’s Reader count to 0. – Invalidate all entries of the aborting transaction – If the transaction overflowed, process its overflowed entries, updating Reader counts. – If the parent cache entry is not dirty, then remove it from the memory tables. Drop the transaction from the parent cache.

HW SKETCH-1 Committing a top-level transaction For each written entry, restore the transaction 0 entry (if necessary), and update its value. Mark the entry dirty and written, and set its Reader count to 0. If the transaction has overflow entries, process them then delete them. Delete the transaction’s parent cache entry, including memory copy (if any). Committing a closed nested transaction: Merge Committing an open nested transaction: Drop

SKETCH 2: TAGGING ANCESTORS Ancestor bit, which indicates that this entry is for an ancestor of the current transaction (or the current transaction itself)

SKETCH 2: TAGGING ANCESTORS Reading a word: – Conflict if there is any entry for the same address where a non-ancestor has written the word – Easy to check: address match, Ancestor bit 0,Written bit 1 Writing a word: – The write conflicts if there is any entry for the same word for a non-ancestor, easy to check with associative matching on this address. Aborting a transaction: – Simply invalidate all Transaction Data Cache entries for the transaction. Committing a top-level transaction: – Drop unwritten entries of this transaction, and merge written ones with the transaction 0 entry. Committing a closed nested transaction: – For each entry of the committing transaction, if the parent has an entry, merge entries. – If the parent has no entry, just change the transaction id to that of the parent. – All Ancestor bits for the parent remain 1. Committing an open nested transaction: – drop all (non-0) transaction entries for Written data. Switching transactions – Set all ancestor bit younger than common one to 0.

SKETCH 3: FAST COMMIT Watched Transaction – Indicates a transaction to watch. If it commits, then take special action. For abort clear field.

SKETCH 3: FAST COMMIT Reading a word: – A closed nested transaction is inherited by its parent on commit. – For a read by an open nested action that results in an unwritten entry, set the Obtained-from field to 0. Writing a word: – set theWatched transaction field of the youngest ancestor – If the transaction is open nested, we set the Watched field of all ancestors Committing a transaction: – Broadcast across the cache the committing transaction’s id and its parent’s id. – For open nested actions, drop unwritten entries and mutate written entries to transaction 0 – For closed nested actions, mutate unwritten entries to the parent, unless the parent matches the Obtainedfrom field, in which case drop the entry. – For written entries always mutate them to the parent. Aborting a transaction: – In addition to invalidating the transaction’s own entries, set to 0 any Watched transaction field that matches the aborting transaction

LINEAR NESTING Disallow concurrency within a transaction, permitting only a single leaf transaction for each top-level transaction Live tree under each top-level transaction is linear, consisting of a single branch Optimization: if an ancestor holds a value for a given address (read or written), a descendant reading that address does not need to add the address to its read set. Nest Values. Nested Write Stack (NWS), which is an array indicating which higher nesting levels hold a write for this address

Conflicts: – Conflicting entries are simply those whose Tid is different and whose mode (read/write) conflicts with the action to perform. Reading a word – Will be in the entry having the same Tid and Address, and an empty NWS (i.e., it has no descendant entries and thus is topmost) Writing a word – Push the writing Nest value on each ancestor’s NWS. If the oldest ancestor’s NWS overflows, write it to memory. Aborting a transaction: – Invalidate all entries for the Tid and Nest level. – If the Nest value matches the top of an entry’s NWS, that entry pops its NWS, discarding the NWS entry for the aborted transaction. – In the case of an entry with Nest value 0 (which is really a transaction 0 value), we reset the Tid to 0 Committing a transaction: – If the committing transaction is closed and not top-level, its entries, both read and write, decrement their Nest value – If an entry’s NWS top value equals the committing transaction’s Nest value, then it is an ancestor entry. – The ancestor decrements its top NWS value