r/ComputerEngineering • Performance Architect • Aug 31 '19

Computer Architecture Highlights: Week 7

Hi all! I'm an architecture PhD student, and I wanted to start posting a brief summary of an influential research paper (either old or new) every week! Here's a classic one from Norm Jouppi on improving the performance of caches!

Title: *Improving Direct-Mapped Cache Performance by the Addition of a Small Fully-Associative Cache and Prefetch Buffers *

Conference: ISCA 1990

Paper Link: Link

 

Problem: The speed of improvement for processors far exceeded that of memory. Caches were used to mitigate this problem by exploiting the fact that not all data was needed at once, and that data is typically accessed close in either space or time (temporal and spatial locality). However, caches aren't perfect, and some data we are going to access soon can get evicted. Furthermore, many applications have simple access patterns but no reuse, leading to many cache misses. This paper focuses on solving these problems using small, but deliberate changes to the micro-architecture, and avoiding brute force solutions like drastically increasing the size of the L1 cache.

 

Solution: This paper introduced the idea of miss-caches, victim caches, and stream buffers. Miss-caches are small (2-5 entry) fully associative cache that sit just below the L1. On a cache miss in the L1, the miss-cache is checked next, and the missing line is filled into there if it is not already present. This helps when there are pathological access patterns where the cache line at the same location in the L1 is being evicted repeatedly. Victim caches extend this idea by having evicted lines from the L1 go into the small fully associative structure instead a cache line being filled on a miss. This exploits the fact that we want to "catch" evicted lines because they may be used later.

Stream buffers tackle a separate, but related problem, by automatically pre-fetching cache lines on a miss. Normally, on the first access to a cache line, it won't be in the cache (compulsory miss). However, many applications have spatial locality (e.g. if cache line at address A is accessed, there is a high probability that the one at A+1 will be accessed next). Stream buffers exploit this fact by automatically fetching the next consecutive cache lines on a cache miss. Furthermore, this is extended to to multi-way stream buffers when there are multiple consecutive access patterns at the same time (e.g. multiple rows of a matrix are being accessed).

 

Major Impact: This paper was incredibly influential, has been cited hundreds of times, and won the influential paper award at ISCA. It showed that small, but deliberate changes to the architecture can beat out brute force alternatives. The author showed that victim caches could prevent over 36% of data misses (and 18% of overall misses) with only 4 extra cache lines in a fully associative structure!

He also showed that the brute force of doubling the L1 cache from 4kB to 8kB only improves data cache misses by 32%. This really highlights the idea that a little associativity goes a long way. Instead changing the entire L1 cache to be set-associative (expensive!) they showed that having a few extra cache lines with a high degree of associativity (cheap!) is sufficient in many cases. Multi-way stream buffers were further were able to remove 72% of instruction misses (sequentially accessing instructions is common), and 43% of data misses.

Last of all, this paper inspired many clever ways of pre-fetching and handling/avoiding cache misses that have been put into modern architectures!

 

That's all for this week! Check out the paper linked above for more details on victim caches and stream buffers! Simple ideas can go a long way! Have a wonderful start to the weekend!

 

--Nick

Last Week's: Link -->

My YouTube channel with similar teaching content.

My GitHub where I post all my teaching code.

31 Upvotes

1 comment sorted by