Real Memory Hierarchies, Cache Blocking, and Chapter Five's Lessons

Theoretical cache and memory concepts take concrete form in real commercial processors with multiple cache levels and carefully tuned sizes. This article compares real memory hierarchies in ARM and Intel processors, shows how cache blocking accelerates matrix multiplication in practice, and closes out the memory hierarchy chapter by addressing common misconceptions.

Real Memory HierarchiesCache BlockingMemory Hierarchy Fallacies

~3 min read · Updated Sep 6, 2026

Real Stuff: Memory Hierarchies in Commercial Processors

Real processors implement the caching and memory concepts covered throughout this chapter with specific, carefully chosen parameters. Both the ARM Cortex-A53 and Intel Core i7, discussed earlier in this series regarding pipeline design, also differ meaningfully in their memory hierarchies: mobile-oriented designs like the Cortex-A53 typically use smaller cache sizes at each level to conserve power and die area, while performance-oriented designs like the Core i7 use larger, multi-level caches, often three levels deep, to minimize average memory access time at the cost of additional power and chip area.

Applying Cache Concepts: Cache Blocking for Matrix Multiply

Matrix multiplication, discussed earlier in this series regarding subword parallelism and instruction-level parallelism, can also be optimized specifically for the memory hierarchy using a technique called Cache Blocking (also called Tiling). Rather than processing an entire large matrix row by row, which can repeatedly evict useful cached data due to capacity misses discussed earlier in this series, the matrix is divided into smaller sub-blocks sized specifically to fit within the cache.

Without blocking:
Large matrix accessed row-by-row,
repeatedly evicting data still needed later,
causing many capacity misses

With blocking:
Matrix divided into smaller sub-blocks
that fit entirely within the cache,
each sub-block fully processed
before moving to the next

By ensuring each sub-block's data remains in the cache throughout its processing, cache blocking significantly reduces the number of capacity misses, directly applying the locality principles introduced earlier in this series to a real, widely used computational workload.

Common Fallacies About Memory Hierarchies

  • Assuming a larger cache is always better — as discussed earlier regarding cache performance tradeoffs, a larger cache increases hit time and cost even as it reduces capacity misses.
  • Assuming virtual memory and caching are unrelated systems — as shown earlier in the unified framework covering block placement, identification, replacement, and write policy, they answer the exact same underlying questions.
  • Assuming a cache miss always costs the same amount of time — as discussed earlier regarding the three types of misses, the actual cost depends heavily on which level of the memory hierarchy must ultimately satisfy the request.

Common Pitfalls in Memory-Sensitive Code

  • Writing code with poor spatial locality, such as accessing array elements in a non-sequential pattern, which defeats the benefit of the block-based caching discussed earlier in this series.
  • Ignoring the load-use hazard discussed earlier in this series when reasoning about why memory-heavy code sometimes performs worse than expected despite a seemingly efficient algorithm.
  • Overlooking multicore cache coherence overhead, discussed earlier in this series, when writing parallel code that frequently modifies shared data across cores.

Chapter Summary: The Full Memory Hierarchy Picture

This chapter traced the path from the smallest and fastest storage to the largest and slowest: SRAM-based caches exploiting locality of reference, virtual memory providing both illusion of abundant memory and process isolation, dependable memory techniques protecting against silent data corruption, cache coherence keeping multicore systems consistent, and RAID protecting persistent storage against physical disk failure. Every one of these mechanisms exists because no single memory technology can be simultaneously fast, large, cheap, and reliable — a theme first introduced at the very start of this chapter and echoed in every technique built on top of it.

Written & researched by Dr. Shahin Siami

Related Articles

Common Misconceptions About Parallel Computing and the Book's Final Lessons

After covering everything from thread-level parallelism to warehouse-scale computing, it is worth correcting persistent misconceptions about parallel systems that even experienced engineers sometimes hold. This article addresses common fallacies about scaling and parallel hardware, then closes out the parallel processing chapter by tying together the full journey from a single instruction to a building full of cooperating machines.

Continue

Real Stuff: Benchmarking CPUs Against GPUs and Multiprocessor Matrix Multiply

Comparing a CPU and a GPU fairly requires a model that accounts for both computational throughput and memory bandwidth limits together. This article introduces the roofline model used to compare real hardware like the Intel Core i7 and NVIDIA Tesla GPU, then shows how matrix multiplication is accelerated across multiple processors as the final practical application of this chapter's parallel concepts.

Continue

Benchmarking Multiprocessors and Modeling Parallel Performance

Measuring the performance of a parallel system requires different tools and metrics than measuring a single-core processor. This article covers the specialized benchmarks used to evaluate multiprocessor systems, explains how to model scaling behavior as more processors are added, and revisits Amdahl's Law in the context of real-world performance measurement.

Continue

Cluster Networking: Connecting to the World Outside

A cluster of machines is only useful if it can communicate efficiently both internally and with the outside world. This article covers the networking layers involved in cluster communication, the tradeoffs between latency and bandwidth at scale, and how clusters connect to external networks and users.

Continue

Clusters, Warehouse-Scale Computers, and Network Topologies

Beyond a single chip, parallelism extends to entire buildings full of independent computers working together. This article explains the shift from shared memory multiprocessing to clusters of separate machines, introduces the concept of warehouse-scale computing, and covers the network topologies that connect these independent machines efficiently.

Continue

An Introduction to GPUs: Massive Parallelism for Data-Heavy Workloads

A GPU takes the SIMD idea covered earlier in this series to an extreme scale, running thousands of lightweight threads simultaneously to process massive amounts of independent data. This article explains why GPUs are architecturally so different from CPUs, how their thread execution model works, and what kinds of workloads benefit most from this design.

Continue