Adaptive-LRU: A Lightweight, Thrash-Resistant Cache Replacement Policy for High-Performance CPU Caches
OM MAHESHWARI · 2025
Cache replacement policies significantly impact CPU performance, particularly under diverse memory access patterns. While Least Recently Used (LRU) excels with strong temporal locality, it suffers catastrophic performance degradation under streaming workloads and working sets that marginally exceed cache capacity. We present Adaptive-LRU, a lightweight, dynamically adaptive insertion policy that employs set dueling to toggle between standard LRU insertion and a thrashresistant bimodal insertion scheme. Our comprehensive evaluation using a detailed trace-driven simulator with proper statistical methodology demonstrates that Adaptive-LRU achieves 32.6 percentage points higher hit rate than LRU/FIFO on streaming workloads and 63.2 percentage points on near-capacity loops. Compared to state-of-the-art DRRIP, Adaptive-LRU delivers 7.6 × better performance on streaming and 5.2 × better on nearcapacity workloads while maintaining identical performance on cache-friendly patterns. The policy requires minimal hardware overhead (6.0 to12.0 bytes total per cache partition, zero per-line metadata) and preserves the hit critical path of standard LRU implementations.