Topic | Reading | Recommended Exercises |
---|---|---|
The Memory System | DDCA 8.1-8.3.4 | Exercises 8.1-8.10, 8.13, 8.14(b), 8.15 and Question 8.1 |
This reading covers material that connects this course and operating systems (CSC369). If you want to read ahead, Section 8.4, about virtual memory, introduces a key topic in the operating systems course.
The key takeaway from this section is that the processor and memory must work together to execute programs efficiently. One significant challenge to them doing so is the extreme distance between them. This makes it difficult to get enough instructions and data to the processor to keep it busy. (In contrast, now that processor designs are becoming faster at a slower rate, I/O systems appear to be getting "closer", so there are exciting things happening in the intersection of the operating system and I/O systems.) As a result, we have to take steps to reduce the distance between the processor and memory (caches) or to avoid that latency (speculation and hyperthreading). This section focuses on the former topic: the system of caches designed to reduce the cost of normal memory operations.
Section 8.1 introduces the problem and can be skimmed quickly. Figure 8.2 is the canonical "memory wall" picture (the increasing distance between processor and memory), and figure 8.3 briefly illustrates the memory system. Make sure you look at both and can summarize what they represent. Also make sure you can define the terms "spatial locality" and "temporal locality" and can generate examples of them (Exercises 8.1-8.2). (Finally, take a moment to chuckle at Figure 8.4. I've seen recent SRAM costs per gigabyte around $800.)
Section 8.2 seeks to quantify the impact of the memory system on performance. The equations for miss rate and average memory access time (AMAT) are central to this. By the end of the section, you should be able to use those equations and to explain the meaning of the components in the AMAT equation. You should also be able to state Amdahl's law, which is a very useful tool when considering whether it is worth spending time or effort on a problem.
Finally, Section 8.3 introduces the idea of caches. Make sure you can define what a cache is, model replacement policies (LRU and, in Exercise 8.14(b) FIFO), and that you can compare direct mapped, N-way set associative, and fully associative caches (Exercises 8.3-8.7 and Question 8.1). These ideas lead to a couple typical exam questions: can you determine what the contents of a particular cache will be after a series of memory operations, and could you determine how many hits and misses occurred? (Exercises 8.8-8.10)