Video
Đăng bởi Ban biên tập OpenER ·
Tác giả giữ toàn bộ bản quyền (All Rights Reserved) — không phải giấy phép mở. Bạn vẫn xem và học miễn phí trên OpenER; muốn tái sử dụng cần xin phép tác giả.
PROFESSOR
And welcome back, and our way to understand what caches are — sometimes it helps to have a really good analogy.
This library analogy is really very strong, so let's take a look at what that means and understand how that connects to what caches are. Here's the big picture.
You've seen this before. This is the high-level abstraction layer of why this is the new-school machine structures class, not just the old school machine structures class.
Today, we're looking at those two pieces, caches and main memory, and how they interact. Here is the picture of the components of the computer.
Just to remind you, on the left is the processor, control, and data path. Control is the brain. Data path is the brawn, the wires.
You have some interaction with memory, and memory has interaction with I and O. But the idea is how would this change if I bring in what caches are.
So keep this in mind as I start to teach you what caches are in the next slide or two.
So here's the analogy with libraries, and let's think and make sure that we're familiar with how this works. So you've got to find a book in a big library.
You're a Cal student. You're trying to find a book in the stacks. So, what is your process? Well, you've got to go and go find the card catalog, and it's really large.
And so you're searching, searching, searching, searching, searching. And the larger the library, the slower that is because it's more things to search through.
There's also the round trip time to actually walk to the stacks, pick up the book, and actually retrieve the desired book. So there's kind of two stages.
One is to look at where it is, and then the second is to figure out, actually go get it, and bring it back.
So there's the getting it, bringing it back, and then finding out where it is. The larger you make libraries, the worse that is. Imagine the card catalog is floors of card catalogs.
Imagine how painful that might be back in the days before search. [INAUDIBLE] before having computers and libraries, this is the model, Just. So you appreciate how painful it used to be [INAUDIBLE] Okay, boomer!
Yeah, you get it? All right. Here we go.
Electronic memories — virtual libraries, in that sense — have the same issue and plus the technology as you go to different technologies to store the bits, as you go farther away from the CPU.
The fastest one is the register. Literally the fastest one of the registers, and you go farther away from that.
They get larger and they get much slower, and so the full technology change is there, and that's different than libraries. Libraries are a longer distance, another other floor.
This is like, what if the other floor requires you to walk through quicksand or something? So it's even worse when you get to computer memories in terms — oh, a large library.
Well, I'll just have to walk longer. You know, New York Public Library, maybe one of the largest ones in the world. Whatever. It's just walking farther.
Here it's actually walking farther, and the time is slower per step. It's even worse. All right. What we want — in the ideal case, by the way, we want a really large memory.
We want as large as we can but as fast as the smallest element. That's the perfect thing. Boy, I wanted fastest registers but as big as infinity. So that's really what we're looking for.
This is more back setup again.
Back in the '80s — these are two graphs of the graphs between the speed of a processor and the speed of memory, how many clock cycles were to do something.
And so what you're seeing is the CPU performance has increased incredibly, but in terms of the time to get to memory, memory is increased much slower than, and that increase of 7% per year versus 55% per year.
This graph ends in 2010, and it flattened out. CPU performance flattened out after about 2004 or 2005. We call this the sea change.
We'll actually talk about that in this class, but still that gap was really big. So the gap is closing, but it's not closing very fast. So that's an issue.
So if you think about it, 1980. Basically, one instruction is the same as DRAM access. So if I happen to need to go to memory, it's not a big deal.
But in 2020 to go to memory is 1,000 instructions, so the CPU — if I do nothing else, if I'm not smart about how I use my time, the CPU is sitting idle for 1,000 cycles.
1,000 full cycles, which might not seem a big deal to you because it's at a gigahertz-level. So it's like what's the big deal?
But in terms of — what if I'm doing this a lot? What if I'm doing this a lot?
That ends up being [INAUDIBLE] have a big performance hit on our software, especially as I'm trying to compute on larger and larger quantities of data.
I can't afford to have that hit, that memory hit to do that. So we're doing all — these whole set of lectures is to deal with this slide here.
How are we trying to deal with that disparity between CPU speed and DRAM speed? That's it. In the next couple of lectures — this is the last slide on this particular issue.
We're going to see whether an idea called caches can resolve and solve this problem. OK?
The idea is in the big picture can I be as fast as I can, as fast as a register, but at the speed — I'm sorry.
As fast as register but at the size of unimaginable size, size of my hard drive, even bigger than that. Could I work with that? Okay? We'll see you at the next lecture.
Đăng nhập để đánh giá học liệu này.
Đăng nhập để bình luận — chưa ai bình luận về học liệu này.
Không có khóa học liên quan.