A Simulation Framework for Evaluating Location Consistency Based Cache

Total Page:16

File Type:pdf, Size:1020Kb

A Simulation Framework for Evaluating Location Consistency Based Cache LC-SIM: A SIMULATION FRAMEWORK FOR EVALUATING LOCATION CONSISTENCY BASED CACHE PROTOCOLS by Pouya Fotouhi A thesis submitted to the Faculty of the University of Delaware in partial fulfillment of the requirements for the degree of Master of Science in Computer Engineering Spring 2017 c 2017 Pouya Fotouhi All Rights Reserved LC-SIM: A SIMULATION FRAMEWORK FOR EVALUATING LOCATION CONSISTENCY BASED CACHE PROTOCOLS by Pouya Fotouhi Approved: Guang R. Gao,Ph.D. Professor in charge of thesis on behalf of the Advisory Committee Approved: Kenneth E. Barner, Ph.D. Chair of the Department of Electrical and Computer Engineering Approved: Babatunde A. Ogunnaike, Ph.D. Dean of the College of Engineering Approved: Ann L. Ardis, Ph.D. Senior Vice Provost for Graduate and Professional Education ACKNOWLEDGMENTS I would like to thank Professor Gao for giving me the opportunity of joining CAPSL and multi-dimensional learning experience. With special thanks to Dr. St´ephaneZuckerman for guiding me step by step over the research, and my colleague Jose Monsalve Diaz for deep discussions and his technical help. Very special thanks to my wife Elnaz , and also my parents for their support and love. iii TABLE OF CONTENTS LIST OF FIGURES ::::::::::::::::::::::::::::::: vi ABSTRACT ::::::::::::::::::::::::::::::::::: ix Chapter 1 INTRODUCTION :::::::::::::::::::::::::::::: 1 2 BACKGROUND ::::::::::::::::::::::::::::::: 4 2.1 An Introduction to Memory Consistency Models :::::::::::: 5 2.1.1 Uniform Memory Consistency Models :::::::::::::: 6 2.1.1.1 Sequential Consistency ::::::::::::::::: 7 2.1.1.2 Total Store Ordering :::::::::::::::::: 8 2.1.1.3 Coherence :::::::::::::::::::::::: 10 2.1.2 Hybrid Memory Consistency Models :::::::::::::: 10 2.1.2.1 Weak Ordering (Weak Consistency) :::::::::: 11 2.1.2.2 Release Consistency :::::::::::::::::: 11 2.1.2.3 Location Consistency :::::::::::::::::: 12 2.2 Cache Coherence ::::::::::::::::::::::::::::: 14 2.2.1 MSI :::::::::::::::::::::::::::::::: 16 2.2.2 MESI ::::::::::::::::::::::::::::::: 17 2.2.3 MOESI :::::::::::::::::::::::::::::: 18 3 THE PROBLEM WITH COHERENCE :::::::::::::::: 22 iv 4 LC-CACHE: TOWARD A SCALABLE CACHE PROTOCOL FOR EXASCALE SYSTEMS ::::::::::::::::::::::: 23 4.1 LC-Cache Protocol :::::::::::::::::::::::::::: 23 4.2 Weaknesses of LC Cache ::::::::::::::::::::::::: 29 5 LCCSIM: A SIMULATION FRAMEWORK TO COMPARE CACHE PROTOCOLS ::::::::::::::::::::::::::: 32 5.1 Implementation details :::::::::::::::::::::::::: 32 5.2 Simulator features ::::::::::::::::::::::::::::: 33 5.3 Limitations of LCCSim :::::::::::::::::::::::::: 39 6 EXPERIMENTAL RESULTS ::::::::::::::::::::::: 41 6.1 Private Accesses :::::::::::::::::::::::::::::: 42 6.2 Shared accesses - Non-synchronizing ::::::::::::::::::: 45 6.3 Shared accesses - Synchronizing ::::::::::::::::::::: 49 6.4 Combined accesses :::::::::::::::::::::::::::: 52 7 RELATED WORK ::::::::::::::::::::::::::::: 55 8 CONCLUSION AND FUTURE WORK :::::::::::::::: 57 REFERENCES :::::::::::::::::::::::::::::::::: 58 v LIST OF FIGURES 2.1 Motivating example for memory consistency models ::::::::: 5 2.2 One possible execution trace of the example presented in fig 2.1 :: 6 2.3 A simple example for uniform consistency models. The question is to see if a model allows both r1 and r2 to be equal to 0. :::::::: 8 2.4 One possible order of accesses in a system using TSO :::::::: 9 2.5 A valid trace of accesses under coherence ::::::::::::::: 10 2.6 State diagram for MSI cache coherence protocol ::::::::::: 17 2.7 Operation of MSI protocol ::::::::::::::::::::::: 17 2.8 State diagram for MESI cache coherence protocol :::::::::: 19 2.9 Operation of MESI protocol :::::::::::::::::::::: 19 2.10 State diagram for MOESI cache coherence protocol ::::::::: 20 2.11 Operation of MOESI protocol ::::::::::::::::::::: 21 4.1 State transitions - LC cache protocol ::::::::::::::::: 24 4.2 Atomic increments on shared location x ::::::::::::::: 26 4.3 Single producer with multiple asynchronous consumers ::::::: 27 4.4 An example to highlight the difference between LC and RC :::: 29 4.5 State transitions and values after each instruction in figure 4.4. LP 1 = 1(D) means the value of location L in processor P1 is equal to 1 and is in state D. LMM refers to the value of location L in main memory. ::::::::::::::::::::::::::::::::: 31 vi 5.1 Transitions in MSI protocol :::::::::::::::::::::: 34 5.2 Transitions in MESI protocol ::::::::::::::::::::: 35 5.3 Transitions in MOESI protocol :::::::::::::::::::: 36 5.4 Transitions in MOESI protocol - Cont'd ::::::::::::::: 37 5.5 Control messages in LCCSim ::::::::::::::::::::: 39 6.1 Experiment details ::::::::::::::::::::::::::: 41 6.2 Private accesses - Total access latency over number of cores :::: 42 6.3 Private accesses - Traffic on-chip over number of cores ::::::: 43 6.4 Private accesses - Total access latency over ratio of write operations 43 6.5 Private accesses - Traffic on-chip over ratio of write operations ::: 43 6.6 Private accesses - Total access latency over number of locations :: 44 6.7 Private accesses - Traffic on-chip over number of locations ::::: 44 6.8 Non-synchronizing shared accesses - Total access latency over number of cores ::::::::::::::::::::::::::::::::: 45 6.9 Non-synchronizing shared accesses - Traffic on-chip over number of cores ::::::::::::::::::::::::::::::::::: 46 6.10 Non-synchronizing shared accesses - Total access latency over ratio of write operations ::::::::::::::::::::::::::::: 47 6.11 Non-synchronizing shared accesses - Traffic on-chip over ratio of write operations :::::::::::::::::::::::::::::::: 47 6.12 Non-synchronizing shared accesses - Total access latency over number of locations ::::::::::::::::::::::::::::::: 48 6.13 Non-synchronizing shared accesses - Traffic on-chip over number of locations ::::::::::::::::::::::::::::::::: 48 vii 6.14 Non-synchronizing shared accesses - Total access latency for 256 locations ::::::::::::::::::::::::::::::::: 49 6.15 Synchronizing shared accesses - Total access latency over number of cores ::::::::::::::::::::::::::::::::::: 49 6.16 Synchronizing shared accesses - Traffic on-chip over number of cores 50 6.17 Synchronizing shared accesses - Total access latency over ratio of write operations ::::::::::::::::::::::::::::: 50 6.18 Synchronizing shared accesses - Traffic on-chip over ratio of write operations :::::::::::::::::::::::::::::::: 51 6.19 Synchronizing shared accesses - Total access latency over number of locations ::::::::::::::::::::::::::::::::: 51 6.20 Synchronizing shared accesses - Traffic on-chip over number of locations ::::::::::::::::::::::::::::::::: 52 6.21 Combined accesses - Total access latency over number of cores ::: 53 6.22 Combined accesses - Traffic on-chip over number of cores :::::: 53 6.23 Combined accesses - Total access latency over ratio of write operations :::::::::::::::::::::::::::::::: 54 6.24 Combined accesses - Traffic on-chip over ratio of write operations : 54 viii ABSTRACT New high-performance processors tend to shift from multi to many cores. More- over, shared memory has turned to dominant paradigm for mainstream multicore pro- cessors. As memory wall issue loomed over architecture design, most modern computer systems have several layers in their memory hierarchy. Among many, caches has be- come everlasting components of memory hierarchies as they significantly reduce access time by taking the advantage of locality. Major processor vendors usually rely on cache coherence, and implement a vari- ant of MESI, e.g., MOESI for AMD, to help reduce inter-chip traffic on the fast in- terconnection network. Supposedly, maintaining coherence should help with keeping parallel and concurrent programmers happy, all the while providing them with a well- known cache behavior for shared memory. This thesis challenge the assumption that Coherence is well-suited for large-scale many core processors. Seeking an alternative for coherence, LC cache protocol is extensively investigated. LC-Cache is a cache protocol weaker than Coherence, but which preserves causality. It relies on the Location Consistency (LC) model. The basic philosophy behind LC is to maintain a unique view of memory only if there is a reason to. Other ordinary memory accesses may be observed in any order by the other processors of the computer system. The motivation to stand against cache coherence, relies on underestimated lim- itations implied on system design by coherence. Observations presented in this thesis, demonstrates that coherence eliminates the possibility of having a directory based pro- tocol in practice since size of such directory grows linearly with number of cores. In addition, coherence adds implicit latency in many cases to the protocol. ix This thesis presents LCCSim, a simulation framework to compare cache proto- col based on location consistency against cache coherence protocols. A comparative analysis between the MESI and MOESI coherence protocols is provided, and pit them against LC-Cache. Both MESI and MOESI consistently generate more on-chip traffic compared to LC cache since transitions in LC cache are done locally. However, LC cache degrades total latency of accesses as it does not take the advantage of cache to cache forwarding. Additionally, LC cache cannot be considered a true implementation based on LC since it does not behave according to the memory model. The following summarizes the contributions of this thesis: • Detailed specification of LC cache protocol, covering the missing aspects in the original paper. • A simulation framework to compare cache protocols
Recommended publications
  • Directed Test Generation for Validation of Cache Coherence Protocols Yangdi Lyu, Xiaoke Qin, Mingsong Chen, Member, IEEE and Prabhat Mishra, Senior Member, IEEE
    IEEE TRANSACTIONS ON COMPUTER-AIDED DESIGN OF INTEGRATED CIRCUITS AND SYSTEMS, VOL. XX, NO. NN, MMM YYYY 1 Directed Test Generation for Validation of Cache Coherence Protocols Yangdi Lyu, Xiaoke Qin, Mingsong Chen, Member, IEEE and Prabhat Mishra, Senior Member, IEEE Abstract—Computing systems utilize multi-core processors Since all possible behaviors of the cache blocks in a system with complex cache coherence protocols to meet the increasing with n cores can be defined by a global finite state machine need for performance and energy improvement. It is a major (FSM), the entire state space is the product of n cache block challenge to verify the correctness of a cache coherence protocol since the number of reachable states grows exponentially with level FSMs. Although the FSM of each cache controller is the number of cores. In this paper, we propose an efficient test easy to understand, the structure of the product FSM for generation technique, which can be used to achieve full state modern cache coherence protocols usually have quite obscure and transition coverage in simulation based verification for a structures that are hard to analyze. Clearly, it is inefficient to wide variety of cache coherence protocols. Based on effective use breadth-first search (BFS) on this product FSM to achieve analysis of the state space structure, our method can generate more efficient test sequences (50% shorter) on-the-fly compared full state or transition coverage, because a large number of with tests generated by breadth-first search. While our on-the- transitions may be unnecessarily repeated, if they are on the fly method can reduce the numbers of required tests by half, it shortest path to many other states.
    [Show full text]
  • Page 1 Cache Coherence in More Detail
    What is (Hardware) Shared Memory? • Take multiple microprocessors ECE 259 / CPS 221 Advanced Computer Architecture II (Parallel Computer Architecture) • Implement a memory system with a single global physical address space (usually) Shared Memory MPs – Coherence & Snooping – Communication assist HW does the “magic” of cache coherence Copyright 2006 Daniel J. Sorin • Goal 1: Minimize memory latency Duke University – Use co-location & caches Slides are derived from work by • Goal 2: Maximize memory bandwidth Sarita Adve (Illinois), Babak Falsafi (CMU), – Use parallelism & caches Mark Hill (Wisconsin), Alvy Lebeck (Duke), Steve Reinhardt (Michigan), and J. P. Singh (Princeton). Thanks! (C) 2006 Daniel J. Sorin from Adve, Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221 3 Outline Some Memory System Options • Motivation for Cache-Coherent Shared Memory P1 Pn Switch P P1 n (Interleaved) First-level $ • Snooping Cache Coherence (Chapter 5) $ $ – Basic systems Bus (Interleaved) – Design tradeoffs Main memory Mem I/O devices • Implementing Snooping Systems (Chapter 6) (a) Shared cache (b) Bus-based shared memory P1 Pn P • Advanced Snooping Systems P1 n $ $ $ $ Mem Mem Interconnection network Interconnection network Mem Mem (c) Dancehall (d) Distributed-memory (C) 2006 Daniel J. Sorin from Adve, (C) 2006 Daniel J. Sorin from Adve, Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221 2 Falsafi, Hill, Lebeck, Reinhardt, Singh ECE 259 / CPS 221 4 Page 1 Cache Coherence In More Detail • According to Webster’s dictionary … • Efficient
    [Show full text]
  • Tightly-Coupled and Fault-Tolerant Communication in Parallel Systems
    Tightly-Coupled and Fault-Tolerant Communication in Parallel Systems Inauguraldissertation zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften der Universität Mannheim vorgelegt von Dipl.-Inf. David Christoph Slogsnat aus Heidelberg Mannheim, 2008 Dekan: Prof. Dr. Matthias Krause, Universität Mannheim Referent: Prof. Dr. Ulrich Brüning, Universität Heidelberg Koreferent: Prof. Dr. Reinhard Männer, Universität Heidelberg Tag der mündlichen Prüfung: 4. August 2008 Abstract The demand for processing power is increasing steadily. In the past, single processor archi- tectures clearly dominated the markets. As instruction level parallelism is limited in most applications, significant performance can only be achieved in the future by exploiting par- allelism at the higher levels of thread or process parallelism. As a consequence, modern “processors” incorporate multiple processor cores that form a single shared memory multi- processor. In such systems, high performance devices like network interface controllers are connected to processors and memory like every other input/output device over a hierarchy of periph- eral interconnects. Thus, one target must be to couple coprocessors physically closer to main memory and to the processors of a computing node. This removes the overhead of today’s peripheral interconnect structures. Such a step is the direct connection of Hyper- Transport (HT) devices to Opteron processors, which is presented in this thesis. Also, this work analyzes how communication from a device to processors can be optimized on the protocol level. As today’s computing nodes are shared memory systems, the cache coherence protocol is the central protocol for data exchange between processors and devices. Consequently, the analysis extends to classes of devices that are cache coherence protocol aware.
    [Show full text]
  • Verification of Hierarchical Cache Coherence Protocols for Future Processors
    VERIFICATION OF HIERARCHICAL CACHE COHERENCE PROTOCOLS FOR FUTURE PROCESSORS by Xiaofang Chen A dissertation submitted to the faculty of The University of Utah in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science School of Computing The University of Utah May 2008 Copyright c Xiaofang Chen 2008 All Rights Reserved THE UNIVERSITY OF UTAH GRADUATE SCHOOL SUPERVISORY COMMITTEE APPROVAL of a dissertation submitted by Xiaofang Chen This dissertation has been read by each member of the following supervisory committee and by majority vote has been found to be satisfactory. Chair: Ganesh L. Gopalakrishnan Steven M. German Ching-Tsun Chou John B. Carter Rajeev Balasubramonian THE UNIVERSITY OF UTAH GRADUATE SCHOOL FINAL READING APPROVAL To the Graduate Council of the University of Utah: I have read the dissertation of Xiaofang Chen in its final form and have found that (1) its format, citations, and bibliographic style are consistent and acceptable; (2) its illustrative materials including figures, tables, and charts are in place; and (3) the final manuscript is satisfactory to the Supervisory Committee and is ready for submission to The Graduate School. Date Ganesh L. Gopalakrishnan Chair: Supervisory Committee Approved for the Major Department Martin Berzins Chair/Director Approved for the Graduate Council David S. Chapman Dean of The Graduate School ABSTRACT The advancement of technology promises to make chip multiprocessors or multicores ubiquitous. With multicores, there naturally exists a memory hierarchy across which caches have to be kept coherent. Currently, large (hierarchical) cache coherence proto- cols are verified at either the high (specification) level or at the low (RTL implementation) level.
    [Show full text]
  • Study and Performance Analysis of Cache-Coherence Protocols in Shared-Memory Multiprocessors
    Study and performance analysis of cache-coherence protocols in shared-memory multiprocessors Dissertation presented by Anthony GÉGO for obtaining the Master’s degree in Electrical Engineering Supervisor(s) Jean-Didier LEGAT Reader(s) Olivier BONAVENTURE, Ludovic MOREAU, Guillaume MAUDOUX Academic year 2015-2016 Abstract Cache coherence is one of the main challenges to tackle when designing a shared-memory mul- tiprocessors system. Incoherence may happen when multiple actors in a system are working on the same pieces of data without any coordination. This coordination is brought by the coher- ence protocol : a set of finite states machines, managing the caches and memory and keeping the coherence invariants true. This master’s thesis aims at introducing cache coherence in details and providing a high- level performance analysis of some state-of-the art protocols. First, shared-memory multipro- cessors are briefly introduced. Then, a substantial bibliographical summary of cache coherence protocol design is proposed. Afterwards, gem5, an architectural simulator, and the way co- herence protocols are designed into it are introduced. A simulation framework adapted to the problematic is then designed to run on the simulator. Eventually, several coherence protocols and their associated memory hierarchies are simulated and analysed to highlight the perfor- mance impact of finer-designed protocols and their reaction faced to qualitative and quantita- tive changes into the hierarchy. Résumé La cohérence des caches est un des principaux défis auxquels il faut faire face lors de la concep- tion d’un système multiprocesseur à mémoire partagée. Une incohérence peut se produire lorsque plusieurs acteurs manipulent le même jeu de données sans aucune coordination.
    [Show full text]
  • Models for Addressing Cache Coherence Problems 9 INTERNATIONAL JOURNAL of NATURAL and APPLIED SCIENCES (IJNAS), VOL
    Models for addressing cache coherence problems 9 INTERNATIONAL JOURNAL OF NATURAL AND APPLIED SCIENCES (IJNAS), VOL. 12, Special Edition (2019); P. 9 – 14, 1 TABLE, 4 FIG. Models for addressing cache coherence problems in multilevel caches: A review paper * I. I. Arikpo and A. T. Okoro ABSTRACT The computational tasks of the 21st century require systems with high processing speed. This can be achieved by having, among other system specifications, a high capacity microprocessor and large cache size in a single processor system. The cache prevents round-trips to RAM for every memory access. Nevertheless, dependence on a single cache for both data and instructions limits the performance of the system regardless of the capacity of the processor and cache size. Multilevel cache is a technological advancement that has made it possible for a multi-core processor system to have more than one cache. The introduction of multilevel cache technology no doubt speeds up system operations and enhances performance, but is also not without limitations. Cache coherence issues are common problems inherent in this design. Different protocols have been designed to ameliorate the issues surrounding cache coherence. The aim of this paper is to discuss the efficiency of these protocols in addressing cache coherence problems in multilevel cache technologies. INTRODUCTION instructions and data over a short period of time (Stallings, 2013). With the ever-increasing rate of processor speed, an equivalent Computer hardware consists of many components including the increase in cache memory is necessary to ensure that data is timely memory unit, which is primarily used for information storage.
    [Show full text]
  • A Primer on Memory Consistency and CACHE COHERENCE CONSISTENCY on MEMORY a PRIMER and Cache Coherence Consistency and Daniel J
    Series ISSN: 1935-3235 SORINWOOD •HILL • SYNTHESIS LECTURES ON M Morgan& Claypool Publishers COMPUTER ARCHITECTURE &C Series Editor: Mark D. Hill, University of Wisconsin A Primer on Memory A Primer on Memory Consistency A PRIMER ON MEMORY CONSISTENCY AND CACHE COHERENCE and Cache Coherence Consistency and Daniel J. Sorin, Duke University Mark D. Hill and David A. Wood, University of Wisconsin, Madison Cache Coherence Many modern computer systems and most multicore chips (chip multiprocessors) support shared memory in hardware. In a shared memory system, each of the processor cores may read and write to a single shared address space. For a shared memory machine, the memory consistency model defines the architecturally visible behavior of its memory system. Consistency definitions provide rules about loads and stores (or memory reads and writes) and how they act upon memory. As part of supporting a memory consistency model, many machines also provide cache coherence proto-cols that ensure that multiple cached copies of data are kept up-to-date. The goal of this primer is to provide readers with a basic understanding of consistency and coherence. This understanding includes both the issues that Daniel J. Sorin must be solved as well as a variety of solutions. We present both high-level concepts as well as specific, concrete examples from real-world systems. Mark D. Hill David A. Wood About SYNTHESIs This volume is a printed version of a work that appears in the Synthesis MORGAN Digital Library of Engineering and Computer Science. Synthesis Lectures provide concise, original presentations of important research and development topics, published quickly, in digital and print formats.
    [Show full text]
  • Cache Coherence Protocols
    Computer Architecture(EECC551) Cache Coherence Protocols Presentation By: Sundararaman Nakshatra Cache Coherence Protocols Overview ¾Multiple processor system System which has two or more processors working simultaneously Advantages ¾Multiple Processor Hardware Types based on memory (Distributed, Shared and Distributed Shared Memory) ¾Need for CACHE Functions and Advantages ¾Problem when using cache for Multiprocessor System ¾Cache Coherence Problem (assuming write back cache) ¾Cache Coherence Solution ¾Bus Snooping Cache Coherence Protocol ¾Write Invalidate Bus Snooping Protocol For write through For write back Problems with write invalidate ¾Write Update or Write Invalidate? A Comparison ¾Some other Cache Coherence Protocols ¾Enhancements in Cache Coherence Protocols ¾References Multiple Processor System A computer system which has two or more processors working simultaneously and sharing the same hard disk, memory and other memory devices. Advantages: • Reduced Cost: Multiple processors share the same resources (like power supply and mother board). • Increased Reliability: The failure of one processor does not affect the other processors though it will slow down the machine provided there is no master and slave processor. • Increased Throughput: An increase in the number of processes completes the work in less time. Multiple Processor Hardware Bus-based multiprocessors Why do we need cache? Cache Memory : “A computer memory with very short access time used for storage of frequently used instructions or data” – webster.com Cache memory
    [Show full text]
  • Cache Coherence and Mesi Protocol
    Cache Coherence And Mesi Protocol Multijugate and Cairene Ernest inwrapped her handstands superstructs painstakingly or shent overnight, is Kelvin lily-white? Unstooping and undissociated Carlton undercoats her photocells voyageurs plume and rebounds cagily. Maneuverable and radiophonic Rusty secludes while semipalmate Hodge overtopping her Kenny unmeritedly and menace therefrom. Disadvantage of coherence and other cached copies of its cache coherence transactions caused by intel does not need to cache. Fill in portable table this with the states of the cache lines at your step. PDF Teaching the cache memory coherence with the MESI. Coherence and the shared bus of the SMP system only looks at the types of. Two processors P1 and P2 and uniform memory are connected to a shared bus which implements the MESI cache coherency protocol. Protokoll wurde zuerst von forschern der caches and cache coherency protocol is cached content and more. And vent are many. This makes directories smaller and disgrace can be clocked faster. What chance a Cache Coherence Problem? NoC-Based Support of Heterogeneous Cache-Coherence. When next to a shared location the related coherent cache line is invalidated in grey other caches. Write-invalidate protocols Based on the assumption that shared data as likely always remain shared Basic protocol similar to MESI but. MOESI protocol is slower than MESI protocol as it handles lesser number of requests in the same perk as compared to MESI protocol, which is caused by that fact that MOESI takes more cycles to input a group or write transaction. Controller and mesi protocol to cache coherence issue in a previous write cache discards a vigenere matrix? The universe present possess the cache is a cucumber data.
    [Show full text]