Jump to content

Back in the days of the Pentium 4 and the Athlon XP, when I was in high school I took a computer repair course. I remember reading about cache on the CPU. At the time L1 and L2 cache were used. Then L3 cache was for servers mostly and it was located on the mother board near the CPU socket.

I know in muticore CPU's generally there is dedicated L1 cache for each core and L2 cache is shared. Where does the L3 cache come in to play? Just kinda curious how modern day CPU's work.

I just want to sit back and watch the world burn. 

Link to comment
https://linustechtips.com/topic/5075-question-about-modern-day-cpus/
Share on other sites

Link to post
Share on other sites

Imagine you work in an office, and are tasked daily with working and organizing paperwork. You have a warehouse facility(Hard Drive) that stores the millions of files you are tasked with working. And you're continually given requests for thousands of files per day. Sure, you can get up and walk all the way down to the warehouse everytime you need to retrieve a file, but that would be horribly inefficient. Especially when theres files you use on a fairly regular basis.

So for example, lets say right now you are tasked with working on Project Y(Photoshop, Crysis, whatever). You go down to the warehouse(Hard Drive), and retrieve all the files for that project. So that you don't have to run back and forth to the warehouse continuously, you store the files in your department's large file cabinets(RAM). Project Y, is a massive undertaking, and more than you can focus on at one time. So you work on certain sections of it at a time. The section you are currently working on, you store in your office's smaller file cabinet(L3). And since you are a smart efficient worker, you decide to keep the files you use most frequently inside your desk drawer(L2). Has less storage capacity as your office's file cabinet, but its faster to access it. Same as your office file cabinets don't store as much as your department's file cabinets, which don't store as much as your warehouse.

The surface of your desk(L1) is where you keep the files you are currently actively working on. Your work space is obviously quite small in relation to the millions of files you have, but everything is right in front of you, so you can access it all incredibly fast. But since you only have very limited space, you continually have to move files from your desk, to your desk drawers, to your office file cabinet, and so on and so forth.

When you leave for the day, all your files get put back into the warehouse by your handy file clerk.

So, the bigger the desk(L1), the more improved efficiency. Same for a bigger desk drawer(L2), and bigger office file cabinet(L3). The more you can store, the less you have to run down to the warehouse(Hard Drive) to drop off and retrieve more files.

L3 is basically just a cheaper, larger cache layer. Its shared by all the cores of the CPU. While L2 used to be seperate from the CPU, its now built in to the processor cores. So L3 takes its place between the CPU and RAM. And while its slower then L2 its still faster than retrieving it from RAM. Theoretically you could have L4, L5, etc. But its not really worth it.

You can have all the cache in the world, but if your CPU isn't smart enough to know how and when to move files around with it, its not going to run efficiently.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×