Introduction
Modern server workloads, ranging from cloud microservices to massive database systems, are increasingly constrained by the "frontend bottleneck." Unlike traditional scientific benchmarks (such as SPEC CPU) that spend significant time in tight, predictable loops, server applications feature deep kernel operations and complex software layers. This results in massive instruction footprints that frequently exceed the capacity of L1 and L2 caches, forcing instruction fetches to descend into the Shared Last-Level Cache (LLC).
However, current LLC management policies are almost exclusively "data-centric." They prioritize the retention of frequently reused data lines while often evicting instructions that appear "cold" due to lower reuse frequency. This paper introduces Garibaldi, a novel management scheme that bridges the gap between instruction and data hotness to mitigate the frontend bottleneck.
The Instruction Victim Problem
The authors identify a critical inefficiency in modern caches termed the instruction victim problem. In server workloads, an instruction might be fetched infrequently, making it a prime candidate for eviction under standard Least Recently Used (LRU) or reuse-distance-based policies. However, that single instruction may be responsible for triggering dozens of hits on "hot" data lines.
When such an instruction is evicted, the CPU stalls on the instruction fetch. During this stall, the associated "hot" data remains in the cache but is effectively useless because the processor cannot progress to the point of requesting it. This asymmetry—where a data miss is expensive but an instruction miss is catastrophic—is the primary target of the Garibaldi framework.
Garibaldi: Pairwise Instruction-Data Management
Garibaldi operates as a pairwise management scheme alongside existing LLC replacement policies. It shifts the focus from independent line management to a coupled approach that tracks the relationship between instructions and the data they consume. The system consists of several key components:
- The Pair Table: A specialized, direct-mapped structure that tracks the relationship between an instruction (identified by its Program Counter) and the specific data lines it accesses.
- Miss Cost Tracking: Instead of measuring simple reuse, Garibaldi assigns a "miss_cost" to instructions. If an instruction triggers data accesses that result in cache hits, its cost increases. This mechanism effectively propagates the "hotness" of data back to the instruction that requested it.
- Selective Instruction Protection: When the LLC selects a candidate for eviction, it queries the Pair Table. If the candidate is an instruction with a high miss_cost, Garibaldi protects it from eviction, even if it has not been recently accessed.
- Pairwise Prefetching: If an instruction does miss in the cache, Garibaldi utilizes the Pair Table to proactively prefetch associated data lines, overlapping the instruction fetch latency with data preparation to further reduce stalls.
- Dynamic Thresholding: To maintain efficiency across different program phases, Garibaldi uses a "coloring" timer to periodically adjust protection thresholds and age out stale entries in the Pair Table.
Evaluation and Results
The researchers evaluated Garibaldi using 16 diverse server workloads, including the DaCapo, Renaissance, and OLTP Bench suites (e.g., Cassandra, Kafka, TPCC, and YCSB). These were compared against traditional SPEC CPU 2006/2017 benchmarks to highlight the unique demands of server environments.
Performance Gains
Garibaldi achieved significant performance improvements across the board:
- Speedup: A 13.2% average performance improvement over baseline LRU policies and a 6.1% improvement over Mockingjay, a state-of-the-art reuse-distance policy.
- Stall Reduction: In specific workloads like
verilator, Garibaldi reduced instruction-fetch (ifetch) stalls by 42%, resulting in a 65.2% speedup for that task. - Energy Efficiency: By reducing CPU idle time caused by stalls, the system reduced total energy consumption by an average of 10.4% when integrated with Mockingjay.
Hardware Overhead
Garibaldi is designed for practical implementation. For a 40-core system, the entire module requires approximately 194 KB of storage. This represents less than 1% of the total LLC capacity, making it a highly efficient addition to modern processor architectures.
Limitations and Future Work
While Garibaldi provides substantial gains, the authors note certain limitations. In workloads where both instructions and data exhibit very long reuse distances (such as kafka), protecting instructions can occasionally displace useful data, leading to minor performance trade-offs. Additionally, the current direct-mapped Pair Table may face scaling challenges with even larger instruction footprints. Future research may explore more associative or compressed storage structures and expanded mapping capabilities for instructions that trigger massive data bursts.
Conclusion
Garibaldi demonstrates that instruction "hotness" should not be measured in isolation. By recognizing that an instruction’s value is intrinsically linked to the data it triggers, Garibaldi provides a smarter, pairwise approach to LLC management. This shift effectively addresses the frontend bottleneck, offering a path toward more efficient and higher-performing server architectures.
Summary updated