Improving Worst-Case Cache Performance Through Selective Bypassing and Register-Indexed Cache

Improving Worst-Case Cache Performance Through Selective Bypassing and Register-Indexed Cache

Improving Worst-Case Cache Performance through Selective Bypassing and Register-Indexed Cache Mohamed Ismail, Daniel Lo, and G. Edward Suh Cornell University Ithaca, NY, USA {mii5, dl575, gs272}@cornell.edu ABSTRACT worst-case performance of the data cache. Worst-case execution time (WCET) analysis is a critical Although data cache analysis for WCET has been studied part of designing real-time systems that require strict timing [2, 3, 4, 5, 6, 7, 8, 9], existing techniques still result in overly guarantees. Data caches have traditionally been challenging conservative worst-case performance, in particular because to analyze in the context of WCET due to the unpredictabil- of their inefficiency in handling memory accesses whose ad- ity of memory access patterns. In this paper, we present a dresses cannot be predicted statically. Static cache analysis novel register-indexed cache structure that is designed to be methods need to be conservative and assume that an unpre- amenable to static analysis. This is based on the idea that dictable access can either evict any cache block or update absolute addresses may not be known, but by using rela- the recency (i.e., LRU) history of any set, which makes it tive addresses, analysis may be able to guarantee a number rather difficult to guarantee a hit on following accesses. Al- of hits in the cache. In addition, we observe that keeping ternatively, researchers have proposed to have unpredictable unpredictable memory accesses in caches can increase or de- memory accesses bypass caches. Yet, this approach can lead crease WCET depending on the application. Thus, we ex- to an excessive WCET estimate when there exists a large plore selectively bypassing caches in order to provide lower number of unpredictable accesses because all unpredictable WCET. Our experimental results show reductions in WCET accesses must pay the latency of accessing main memory. of up to 35% over the state-of-the-art static analysis. In this paper, we present a new approach to improve the worst-case performance guarantee for data caches by designing cache hardware and its worst-case static analy- 1. INTRODUCTION sis together. Given that today's WCET analysis cannot Real-time systems are becoming increasingly prevalent as effectively handle memory accesses with unpredictable ad- our physical world continues to become more computerized. dresses, we first propose a new auxiliary cache structure that One essential component to the design of real-time systems is specifically designed to enable worst-case analysis for un- is the analysis of the worst-case execution time (WCET) of predictable addresses. We call this new cache structure a tasks. WCET analysis is used in many real-time scheduling register-indexed cache. Intuitively, the cache and its analy- algorithms and is essential in providing timing guarantees. sis method exploit the observation that the spatial and tem- As a result, a large amount of work has looked into reduc- poral locality between nearby memory accesses can often be ing the WCET and providing accurate WCET estimates [1]. seen without knowing exact memory addresses. For exam- Low WCET allows for better utilization of the processor and ple, a program may access multiple elements in an array improved schedulability. using the same base address with different offsets. The new Data caches, which are widely used in modern comput- cache is indexed by a register number instead of a memory ing systems, introduce a particular challenge in providing a address, and allows static analysis of cache hits based on tight bound for the WCET. While caches often improve the temporal and spatial locality between memory accesses that average-case performance by exploiting spatial and tempo- use the same register as a base address, even when the base ral locality, they cannot improve the WCET estimate unless address is unknown. a cache access can be guaranteed to be a hit in all possi- In addition to the register-indexed cache, we also note that ble executions. As a result, the WCET analysis of caches using a fixed policy for unpredictable memory accesses to needs to consider all possible memory access patterns, and either bypass or use data caches is suboptimal; the effective- its effectiveness is heavily dependent on the ability to predict ness of bypassing a cache heavily depends on application memory access patterns. While accesses to the instruction memory access patterns and the cache configurations of a cache are relatively easy to predict, accesses to the data target system. For example, static analysis may be able to cache often depend on memory addresses that can only be guarantee cache hits for memory accesses to an array for resolved at run-time. This makes it difficult to predict the a large cache, but not for a small cache. For the lowest possible WCET guarantee, memory accesses need to be se- Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed lectively bypassed based on whether the accesses lead to an for profit or commercial advantage and that copies bear this notice and the full cita- improved static estimate of the worst-case performance for tion on the first page. Copyrights for components of this work owned by others than a given access pattern and cache configuration combination. ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re- We evaluated our selective bypassing technique on vari- publish, to post on servers or to redistribute to lists, requires prior specific permission ous benchmark programs and found that we can improve and/or a fee. Request permissions from [email protected]. the WCET by up to 24.3% over the state-of-the-art static DAC ’15 June 07 - 11 2015, San Francisco, CA, USA Copyright is held by the owner/author(s). Publication rights licensed to ACM. analysis. Additionally, experimental results show that we ACM 978-1-4503-3520-1/15/06 ... $15.00 can reduce the WCET by up to 35.3% by including both http://dx.doi.org/10.1145/2744769.2744855 1 selective bypassing and the register-indexed cache for un- Memory Instruction predictable memory accesses. This paper has the following main contributions: Is address known statically? • The paper presents a novel cache structure along with an analysis algorithm that can allow guaranteed cache Y N hits in static analysis even for memory accesses whose Is it a global variable Use traditional whose range fits in the addresses are considered statically unpredictable. cache cache? • The paper notes that, in order to reduce the WCET, Y N memory accesses should selectively bypass data caches Does keeping in cache Bypass to based on how they affect the static analysis results. improve worst-case register-indexed cache performance? cache • The paper evaluates the proposed schemes and shows Y N that they can significantly reduce the WCET guaran- Bypass to tee on certain applications. Use traditional register-indexed cache This paper is organized as follows. Section 2 presents cache related work. Section 3 presents details of the proposed Figure 1: Overview of selective cache usage and bypassing framework. Section 4 evaluates the proposed methodology based on memory access types. and Section 5 concludes the paper. 2. RELATED WORK quantified the effect of bypassing the cache on all unpre- To the best of our knowledge, there is no previous work dictable memory accesses [14]. However, these bypassed ac- that presents a cache structure that can be statically ana- cesses always suffer the full latency to main memory and lyzed to ensure hits on accesses with unpredictable memory can negatively impact the worst-case execution time in some addresses. Previous work has also only explored a fixed pol- cases. This paper proposes to bypass selectively and intro- icy for cache bypassing whereas we show that selective by- duces a new register-indexed cache that can reduce the num- passing depending on static analysis is important to achieve ber of worst-case cache misses for unpredictable accesses. low WCET guarantee. This section briefly summarizes pre- Cache locking [15, 11] has also been proposed as a way vious work on data caches in the context of WCET. to mitigate the effects of unpredictable memory accesses Hard real-time systems often use scratchpads [10, 1, 11, on worst-case cache performance. By locking certain cache 12] instead of data caches in order to have predictable mem- blocks, accesses to those blocks can easily be analyzed with- ory access time while utilizing low-latency on-chip memory. out considering unpredictable memory accesses. However, However, scratchpads require software to explicitly man- cache locking does not help memory accesses such as un- age data movement between on-chip and off-chip memory. predictable ones that are not explicitly locked, and requires These data movement instructions lead to additional over- explicit locking instructions that need to be inserted in a head that does not exist for caches, and also imply that program, which reduces the transparency of caches. programs need to be re-compiled for each system depend- ing on their scratchpad size. As a result, data caches that 3. WCET-AWARE CACHE DESIGN can be transparently used for many programs still represent an attractive option if their worst-case performance can be 3.1 Overview tightly bounded. In this section, we present our cache design that is tar- For the purposes of using caches in hard real-time systems, geted to provide a low WCET bound. While reducing the there has been extensive work on static analysis techniques WCET by itself is important, our main goal is to optimize that aim to predict memory addresses and model the worst- the worst-case performance that can be statically analyzed case cache performance.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us