HWP: Hardware Support to Reconcile Cache Energy, Complexity, Performance and WCET Estimates in Multicore Real-Time Systems

Pedro Benedicte, Carles Hernández, Jaume Abella, Francisco J. Cazorla

TL;DR

This paper introduces the Hybrid Write Policy (HWP), a novel hardware mechanism for multicore real-time systems that aims to balance the trade-offs between performance, energy consumption, complexity, and Worst-Case Execution Time (WCET) estimates. HWP achieves this by intelligently classifying memory pages as either shared or private, applying different write policies accordingly, and significantly improving upon existing write-through (WT) and write-back (WB) approaches.

What Problem Does This Paper Address?

Modern real-time systems are increasingly relying on multicore processors with multilevel caches (MLCs) to meet growing computational demands. A critical component of MLCs is the write policy, which dictates how data updates are handled. Traditional write policies, like write-through (WT) and write-back (WB), present a dilemma: WT simplifies cache coherence and reliability design but suffers from performance and WCET penalties due to network traffic. WB offers better performance and energy efficiency but introduces significant complexity in coherence protocols. This paper addresses the challenge of finding a write policy that offers the best of both worlds, particularly for the stringent requirements of real-time systems where guaranteed performance (WCET) and reliability are paramount.

Methods

The authors propose a Hybrid Write Policy (HWP) that leverages a hardware mechanism to classify memory pages as either "shared" or "private." This classification is performed at the page granularity, a common and efficient approach.

  • Shared Pages: Writes to these pages are handled using a write-through (WT) approach, meaning data is written to both the lower-level cache (L1) and the higher-level cache (L2) and potentially the main memory. This ensures cache coherence for data that is accessed by multiple cores.
  • Private Pages: Writes to these pages are handled using a write-back (WB) approach. Data is written only to the L1 cache, and updates to higher levels are deferred until the cache line is evicted. This significantly reduces traffic on the interconnection network and improves performance.

The HWP mechanism is designed to be low-overhead, integrating with existing hardware components like the Memory Protection Unit (MPU) or Memory Management Unit (MMU) to store shared/private information alongside other page attributes.

Datasets

The evaluation of HWP uses benchmarks from the EEMBC Automotive and MediaBench suites. These suites are representative of critical real-time applications in automotive systems and embedded multimedia/communications, respectively. The authors also create specific workloads by combining these benchmarks to simulate scenarios with varying numbers of cores (1, 2, 4, and 8) and different percentages of shared data (0%, 10%, 20%, and 40%).

Key Insights and Ideas

  • No Single Policy is Optimal: The paper strongly emphasizes that neither WT nor WB alone is superior across all critical metrics (performance, energy, complexity, WCET) for real-time systems. This highlights the need for a more nuanced approach.
  • Shared vs. Private Data is Key: The core insight is that the access patterns of shared and private data are fundamentally different and can be exploited. Private data, which constitutes a significant portion of memory accesses, doesn't require strict coherence, allowing for WB-like optimizations.
  • HWP Bridges the Gap: HWP effectively reconciles the simplicity of WT for coherence with the performance and energy benefits of WB by selectively applying WB to private data.
  • Coherence Simplicity Maintained: A crucial advantage of HWP is that it retains the simpler Valid/Invalid (V/I) coherence protocol, similar to WT, avoiding the complexity of the MESI protocol required by WB.
  • WCET Benefits: The reduction in network traffic from treating private data as WB significantly mitigates contention, leading to much tighter and more predictable WCET estimates compared to WT, especially in multicore environments.

Key Results

  • Performance: HWP achieves performance comparable to WB and significantly better than WT, especially as the number of cores increases. WCET estimates for HWP are remarkably close to WB and substantially lower than WT, with WT's WCET increasing dramatically with core count.
  • Energy Consumption: HWP reduces cache energy usage to levels similar to WB, offering substantial savings compared to WT.
  • Coherence Complexity: HWP maintains the low coherence complexity of WT by using a simple V/I protocol, avoiding the more complex MESI protocol required by WB.
  • Reliability: HWP, like WB, requires more robust error correction (SECDED) in L1 caches compared to WT's parity, but this difference has a limited impact on overall system cost.

Limitations and Future Work

  • Data Classification Granularity: While the paper uses page granularity for shared/private classification, it acknowledges that finer granularities (e.g., cache line) might offer more optimization but at a higher area and energy cost.
  • Dynamic Classification Complexity: The paper notes that dynamic re-classification of pages (e.g., from private to shared) can introduce complexity and coherence issues, and thus assumes a static classification based on software address partitioning. Future work could explore more robust dynamic classification mechanisms.
  • Workload Diversity: While using EEMBC Automotive and MediaBench, the paper could benefit from evaluating HWP on a wider range of real-time application types and more complex multicore contention scenarios.

The authors suggest that HWP offers a compelling solution for future multicore real-time systems, balancing critical metrics without introducing excessive complexity.

Summary updated

Abstract

High-performance processors have deployed multilevel cache (MLC) systems for decades. In the embedded real-time market, the use of MLC is also on the rise, with processors for future systems in space, railway, avionics and automotive already featuring two or more cache levels. One of the most critical elements for MLC is the write policy that not only affects several key metrics such as performance, WCET estimates, energy/power, and reliability, but also the design of complexity-prone cache coherence protocol and cache reliability solutions. In this paper we make an extensive analysis of existing write policies, namely write-through (WT) and write-back (WB). In the context of the real-time domain, we show that no write policy is superior for all metrics: WT simplifies the design of the coherence and reliability solutions at the cost of performance, WCET, and energy; while WB improves performance and energy results, but complicates cache design. To take the best of each policy, we propose Hybrid Write Policy (HWP) a low-complexity hardware mechanism that reconciles the benefits of WT in terms of simplifying the cache design (e.g. coherence solution) and the benefits of WB in improved average performance and WCET estimates as the pressure on the interconnection network increases. Guaranteed performance results show that HWP scales with core count similar to WB. Likewise, HWP reduces cache energy usage of WT, to levels similar to those of WB. These benefits are obtained while retaining the reduced coherence complexity of WT, in contrast to high coherence costs under WB.
BibTeX
@inproceedings{benedicte2018hwp,
  author = {Pedro Benedicte and Carles Hernández and Jaume Abella and Francisco J. Cazorla},
  title = {{HWP: Hardware Support to Reconcile Cache Energy, Complexity, Performance and WCET Estimates in Multicore Real-Time Systems}},
  booktitle = {ECRTS},
  year = {2018},
  doi = {10.4230/lipics.ecrts.2018.3},
}
Figure