Introduction
Non-volatile memories (NVMs) such as STT-RAM, PCM, and ReRAM are emerging as strong candidates for Last Level Caches (LLCs) due to their high density and low leakage power compared to traditional SRAM. However, NVMs face a significant hurdle: limited write endurance. In typical processor workloads, cache accesses are highly non-uniform, leading to "inter-set write variation." This phenomenon causes a small number of "hot" cache sets to fail much earlier than others, effectively ending the useful life of the entire cache.
The Cache-Coloring Approach
This research proposes a software-controlled cache-coloring technique to perform wear-leveling across the LLC. Unlike hardware-heavy solutions that track individual sets, this approach logically partitions the cache into "colors" and physical memory into "regions."
The wear-leveling mechanism operates through four main stages:
- Dynamic Profiling: The system monitors write traffic to each cache color. Remapping is triggered by a specific write count threshold rather than fixed time intervals, allowing the system to adapt to the workload's write intensity.
- Variation Analysis: The algorithm calculates the standard deviation of writes across colors. If variation exceeds a predefined threshold, intervention occurs.
- Mapping Swaps: The most frequently written colors from the recent interval are swapped with the colors that have the lowest cumulative lifetime write counts.
- Cache Flushing: To maintain consistency during a swap, dirty blocks in affected colors are written back to main memory.
By managing wear at a coarse-grained "color" level, the system avoids the complexity and overhead of fine-grained hardware remapping.
Experimental Evaluation
The proposed technique was evaluated using the SPEC CPU2006 benchmark suite on the Sniper x86-64 simulator. The target architecture featured a 2GHz processor with a 4MB, 16-way set-associative STT-RAM LLC.
Key Results
The cache-coloring technique significantly extends the operational lifespan of NVM caches. On average, the cache lifetime improved by 4.20x compared to a baseline without wear-leveling.
As shown in the figure above, the effectiveness of the technique varies by workload. Applications with highly skewed write patterns, such as povray (Pov) and sjeng (Sje), saw dramatic improvements of up to 20x. Conversely, workloads with naturally uniform write distributions, like libquantum, saw minimal gains.
The primary trade-off for this increased longevity is a modest impact on system performance. The average relative performance was measured at 0.96x, representing a 4% overhead primarily due to the cache flushes required during color remapping.
Additionally, the system experienced an average energy increase of 9.42% and a slight rise in Misses Per Kilo-Instruction (MPKI) of 0.85. Given the four-fold increase in hardware lifespan, these overheads are considered highly acceptable for practical implementation.
Conclusion and Future Work
Cache-coloring provides an effective, low-overhead software solution for the write endurance challenges of NVM-based caches. While the current coarse-grained approach ignores intra-color variation, it successfully mitigates the most damaging inter-set skews. Future research will explore incorporating additional metrics like miss rates into the remapping logic and extending the evaluation to multi-core environments to further optimize the performance-lifespan trade-off.
Summary updated