4.1.5 Cache Misses

Figure: CPU Meets a Cache Miss
\resizebox{3in}{!}{\includegraphics{cartoons/tollbooth}}

An additional multi-threading obstacle to CPU performance is the ``cache miss''. As noted earlier, modern CPUs sport large caches in order to reduce the performance penalty that would otherwise be incurred due to slow memory latencies. However, these caches are actually counter-productive for variables that are frequently shared among CPUs. This is because when a given CPU wishes to modify the variable, it is most likely the case that some other CPU has modified it recently. In this case, the variable will be in that other CPU's cache, but not in this CPU's cache, which will therefore incur an expensive cache miss (see Section [*] for more detail). Such cache misses form a major obstacle to CPU performance, as shown in Figure [*].



Paul E. McKenney 2011-12-16