Monitoring Data Structures Using Hardware Transactional Memory Shakeel Butt 1, Vinod Ganapathy 1, Arati Baliga 2 and Mihai Christodorescu 3 1 Rutgers University,

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

Stacks, Queues, and Linked Lists
Privatization Techniques for Software Transactional Memory Michael F. Spear, Virendra J. Marathe, Luke Dalessandro, and Michael L. Scott University of.
Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
An Case for an Interleaving Constrained Shared-Memory Multi-Processor Jie Yu and Satish Narayanasamy University of Michigan.
Exploiting Distributed Version Concurrency in a Transactional Memory Cluster Kaloian Manassiev, Madalin Mihailescu and Cristiana Amza University of Toronto,
Code Generation and Optimization for Transactional Memory Construct in an Unmanaged Language Programming Systems Lab Microprocessor Technology Labs Intel.
Building a Database on S3 Matthias Brantner, Daniela Florescu, David Graf, Donald Kossmann, Tim Kraska Xiang Zhang
Enforcing Security Policies using Transactional Memory Introspection Vinod Ganapathy Rutgers University Arnar BirgissonMohan Dhawan Ulfar ErlingssonLiviu.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
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.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
Lock-free Cuckoo Hashing Nhan Nguyen & Philippas Tsigas ICDCS 2014 Distributed Computing and Systems Chalmers University of Technology Gothenburg, Sweden.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
University of Michigan Electrical Engineering and Computer Science 1 Parallelizing Sequential Applications on Commodity Hardware Using a Low-Cost Software.
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Transaction Management and Concurrency Control
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
LogTM: Log-Based Transactional Memory Kevin E. Moore, Jayaram Bobba, Michelle J. Moravan, Mark D. Hill, & David A. Wood Presented by Colleen Lewis.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
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.
Highly Available ACID Memory Vijayshankar Raman. Introduction §Why ACID memory? l non-database apps: want updates to critical data to be atomic and persistent.
Bigtable: A Distributed Storage System for Structured Data F. Chang, J. Dean, S. Ghemawat, W.C. Hsieh, D.A. Wallach M. Burrows, T. Chandra, A. Fikes, R.E.
1 Large-scale Incremental Processing Using Distributed Transactions and Notifications Written By Daniel Peng and Frank Dabek Presented By Michael Over.
1 CSE 480: Database Systems Lecture 23: Transaction Processing and Database Recovery.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Enforcing Security Policies using Transactional Memory Introspection Vinod Ganapathy Rutgers University Arnar BirgissonMohan Dhawan Ulfar ErlingssonLiviu.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
School of Information Technologies Michael Cahill 1, Uwe Röhm and Alan Fekete School of IT, University of Sydney {mjc, roehm, Serializable.
Reiser4 By Hans Reiser Owner/Architect Namesys Corporation.
Scaling Dynamic Content Applications through Data Replication - Opportunities for Compiler Optimizations Cristiana Amza UofT.
Colorama: Architectural Support for Data-Centric Synchronization Luis Ceze, Pablo Montesinos, Christoph von Praun, and Josep Torrellas, HPCA 2007 Shimin.
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
The Relational Model1 Transaction Processing Units of Work.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
1 MSRBot Web Crawler Dennis Fetterly Microsoft Research Silicon Valley Lab © Microsoft Corporation.
StealthTest: Low Overhead Online Software Testing Using Transactional Memory Jayaram Bobba, Weiwei Xiong*, Luke Yen †, Mark D. Hill, and David A. Wood.
Consistency Oblivious Programming Hillel Avni Tel Aviv University.
Transactions. Transaction: Informal Definition A transaction is a piece of code that accesses a shared database such that each transaction accesses shared.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Transaction Processing Concepts Muheet Ahmed Butt.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
 Introduction  Tripwire For Servers  Tripwire Manager  Tripwire For Network Devices  Working Of Tripwire  Advantages  Conclusion.
Bigtable: A Distributed Storage System for Structured Data
Read-Log-Update A Lightweight Synchronization Mechanism for Concurrent Programming Alexander Matveev (MIT) Nir Shavit (MIT and TAU) Pascal Felber (UNINE)
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 16 – Intro. to Transactions.
On Transactional Memory, Spinlocks and Database Transactions Khai Q. Tran Spyros Blanas Jeffrey F. Naughton (University of Wisconsin Madison)
Architectural Features of Transactional Memory Designs for an Operating System Chris Rossbach, Hany Ramadan, Don Porter Advanced Computer Architecture.
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
Transactional Flash V. Prabhakaran, T. L. Rodeheffer, L. Zhou (MSR, Silicon Valley), OSDI 2008 Shimin Chen Big Data Reading Group.
Bigtable A Distributed Storage System for Structured Data.
Domain Name System The Technology Context Presentation.
Constraint Framework, page 1 Collaborative learning for security and repair in application communities MIT site visit April 10, 2007 Constraints approach.
Maurice Herlihy and J. Eliot B. Moss,  ISCA '93
Managing Multi-User Databases
Speculative Lock Elision
Transaction Management and Concurrency Control
Minh, Trautmann, Chung, McDonald, Bronson, Casper, Kozyrakis, Olukotun
CSE-291 (Cloud Computing) Fall 2016
Isotope: Transactional Isolation for Block Storage
Faster Data Structures in Transactional Memory using Three Paths
HyperLoop: Group-Based NIC Offloading to Accelerate Replicated Transactions in Multi-tenant Storage Systems Daehyeok Kim Amirsaman Memaripour, Anirudh.
Lecture 6: Transactions
Chapter 10 Transaction Management and Concurrency Control
PLANNING A SECURE BASELINE INSTALLATION
Transactions in Distributed Systems
Concurrent Cache-Oblivious B-trees Using Transactional Memory
Presentation transcript:

Monitoring Data Structures Using Hardware Transactional Memory Shakeel Butt 1, Vinod Ganapathy 1, Arati Baliga 2 and Mihai Christodorescu 3 1 Rutgers University, 2 AT&T Security, 3 IBM Research

Data structure (DS) consistency Applications use data structures to store important information Data structures have consistency properties – e.g. circular linked list, balanced tree, sorted list 2 Inconsistent data structure can adversely affect the reliability and security of an application

Example: binary tree 3 Consistency constraint: parent(child(N)) = N N1N1 N1N1 N2N2 N2N2 N3N3 N3N3 N5N5 N5N5 N4N4 N4N4 N6N6 N6N6 N1N1 N1N1 N2N2 N2N2 N3N3 N3N3 N5N5 N5N5 N4N4 N4N4 M M N6N6 N6N6 M M insert

Example: linked lists Linux task list 4 task_list Consistency constraint: run_list is subset of task_list P1P1 P3P3 PnPn run_list P1P1 P3P3 PnPn P2P2 P2P2

DS monitoring infrastructure Low Overhead Can monitor complex data structure Extensible Applicable to low-level code 5

Naïve Solution Manually placing checks in code Problems – Infeasible for large software – High overhead – Keeping track of DS modifications 6

Our solution: TxMon Framework for online monitoring of data structures Uses hardware transactional memory (HTM) Features – Applicability to multi-threaded applications – Tolerable runtime overhead – No hardware modification 7 TxMon uses HTM to track data structure modifications

Outline Introduction TxMon TxMon API Hardware Transactional Memory TxMon Workflow Implementaion Results 8

Hardware transactional memory (HTM) Alternative to lock-based programming HTM provides atomicity and isolation HTM tracks all reads/writes 9 Acquire(S.lock) value = S.pop() Release(S.lock) transaction { value = S1.pop() }

Hardware transactional memory (HTM) Alternative to lock-based programming HTM provides atomicity and isolation HTM tracks all reads/writes 10 Acquire(S1.lock) Acquire(S2.lock) value = S1.pop() S2.push(value) Release(S2.lock) Release(S1.lock) transaction { value = S1.pop() S2.push(value) }

HTM internal mechanisms Conflict detection – read/write sets – cache based detection Version management – undo log 11

HTM workflow 12 Transaction Body Transaction Body Conflict Detection Conflict Detection Commit Logic Commit Logic Read/Write sets Abort Logic Abort Logic record accesses conflicting accesses retry no conflicts Undo log transaction completion

TxMon design 13 Transaction Body Transaction Body Conflict Detection Conflict Detection Commit Logic Commit Logic Read/Write sets Abort Logic Abort Logic record accesses conflicting accesses retry no conflicts Undo log transaction completion TxMon Monitor success failed check report violation No Changes to underlying HTM

Example: memcached Multithreaded key/value store Keeps 255 doubly linked lists 14 struct item { rel_time_t time; // last access time struct item *next, *prev; … } struct item *heads[255]; heads[i] item 1 item 2 item 3 item n void register_ds(void * ds, void * fp); Consistency constraint: heads[i] is sorted wrt time for(i = 0 ; i < 255 ; ++i) register_ds(&heads[i], check_sort);

Example: memcached 15 process_get_command (key) { struct item *it = search(key); if (it) { … it->time = curr_time; } … return it; } bool check_sort ( struct item * hd) { if( list not sorted wrt time) return false; return true; } transaction ( txmon_entry ) { }

TxMon implementation 16 Transaction {... tx_body... } Transaction {... tx_body... } Hardware Software Address mapsCallbacks Application TxMon’s data structure monitor TxMon is invoked at the end of transaction Use information from HTM to find modified data structures If checks satisfied, transfer control to HTM HTM

TxMon Implementation Address map Check Callbacks 17 txmon_entry (void) { accset = Get memory accesses from HTM for (addr in accset) for ( ds in registered data structures) if ( addr in address_map(ds) ) ret &= callback(ds) return ret; } bool check_sort ( struct item * hd) { // perform check // update address_map }

TxMon Internals Address map Check Callbacks 18 txmon_entry (void) { accset = Get memory accesses from HTM ds = Intersect(accset, address_map) callback(ds) } bool check_sort ( struct item * hd) { // perform check // update address_map }

TxMon implementation 19 Transaction {... tx_body... } Transaction {... tx_body... } Hardware Software Address mapsCallbacks Read/Write sets Application TxMon’s data structure monitor Space for undo logs Log for tx_body Log end Log begin TxMon is invoked at the end of transaction Taking intersection of Log and Address map to find modified data structures If checks satisfied, transfer control to HTM

Evaluation Goal of Evaluation: overhead of TxMon Two macro-benchmark (memcached, clamAV) Simics LogTM-SE is used as underlying HTM 20

Evaluation Goal of Evaluation: overhead of TxMon Two macro-benchmark (memcached, clamAV) Simics LogTM-SE is used as underlying HTM UltraSPARC-III-plus, 75MHz, 256 MB RAM 21

clamAV Single threaded anti-virus software. Workload: scan 356 files 22 VersionTime (sec) Unmodified (baseline)10.95 Ported to LogTM-SE (no TxMon)10.99 (1x) With TxMon enabled11.30 (1.03x)

memcached Distributed object caching server Workload: insert & query 100 key/value pairs 23 VersionOperations / sec Unmodified (baseline)7052 Ported to LogTM-SE (no TxMon)7066 (1x) With TxMon but without checks6615 (1.06x) With TxMon enabled5937 (1.18x)

Splash-2 24 BenchmarkTx-AddedTx-Executed Barnes3374 Radiosity44239,949 Raytrace1047,751

Splash-2 25 BenchmarkTx-AddedTx-Executed Barnes3374 Radiosity44239,949 Raytrace1047,751 Benchmark1248 Barnes7% 10%14% Radiosity11%18%17%20% Raytrace6% 7%6%

Conclusion TxMon – Monitors data structures using HTM – Does not require any changes in HTM – Can enforce arbitrary properties of data structures – Has reasonable overhead for online monitoring 26

Thanks Questions? 27