An Associativity Threshold Phenomenon in Set-Associative Caches
Abstract
In an -way set-associative cache, the cache is partitioned into disjoint sets of size , and each item can only be cached in one set, typically selected via a hash function. Set-associative caches are widely used and have many benefits, e.g., in terms of latency or concurrency, over fully associative caches, but they often incur more cache misses. As the set size decreases, the benefits increase, but the paging costs worsen. In this paper we characterize the performance of an -way set-associative LRU cache of total size , as a function of . We prove the following, assuming that sets are selected using a fully random hash function: - For , the paging cost of an -way set-associative LRU cache is within additive of that a fully-associative LRU cache of size , with probability , for all request sequences of length . - For , and for all and , the paging cost of an -way set-associative LRU cache is not within a factor of that a fully-associative LRU cache of size , for some request sequence of length . - For , if the hash function can be occasionally changed, the paging cost of an -way set-associative LRU cache is within a factor of that a fully-associative LRU cache of size , with probability , for request sequences of arbitrary (e.g., super-polynomial) length. Some of our results generalize to other paging algorithms besides LRU, such as least-frequently used (LFU).
Cite
@article{arxiv.2304.04954,
title = {An Associativity Threshold Phenomenon in Set-Associative Caches},
author = {Michael A. Bender and Rathish Das and Martín Farach-Colton and Guido Tagliavini},
journal= {arXiv preprint arXiv:2304.04954},
year = {2023}
}