Welcome, Guest. Please login or register.

Author Topic: How L1 and L2 caches work  (Read 3959 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline psxphill

Re: How L1 and L2 caches work
« on: September 12, 2014, 11:50:36 AM »
Quote from: biggun;772834
The concept of cache/ways is badly explained as a CPU does not iterative search through its cache ways but all the compares are done in parallel.

I agree they would be done in parallel, but the latency is likely to be higher due to the extra complexity. Cost is the major reason for not doing fully associate cache, it doesn't offer that much advantage for the complexity it adds.
 
 
Quote from: biggun;772834
For example its not explained why people not simply grow the size of the 1st level cache.

Does that need explaining though? I would have thought it was obvious that you can't just add 16GB of L1 cache.
 L1 cache is super fast, much faster than your standard ram. If you could get really large fast ram for really cheap then you wouldn't need any cache at all.
« Last Edit: September 12, 2014, 11:55:37 AM by psxphill »
 

Offline psxphill

Re: How L1 and L2 caches work
« Reply #1 on: September 12, 2014, 02:11:54 PM »
Quote from: ElPolloDiabl;772836
The article is a a bit over simplified, I like the new rule "add a cache level every 10 years" lol

I suspect that won't hold up as well as moore's law.
 
 Although improvements in memory latency are long overdue.
 

Offline psxphill

Re: How L1 and L2 caches work
« Reply #2 on: September 12, 2014, 10:11:46 PM »
Quote from: biggun;772840
The true reason is latency. The latency of a cache is propotional to its size.

Latency is an issue, however I believe that if they threw a large amount of money at it then they could work round that and increase the L1 cache by a modest amount. They just can't justify the cost (size and heat are effectively costs).
« Last Edit: September 12, 2014, 10:15:32 PM by psxphill »
 

Offline psxphill

Re: How L1 and L2 caches work
« Reply #3 on: September 13, 2014, 04:19:36 PM »
Quote from: A6000;772923
@Biggun, sorry, I don't understand this,

An L1 cache is fast because it is small, make it bigger and it slows down, so they add an L2 cache, but an L2 cache is slower than an L1.
I do not understand why an L1+L2 is faster than a larger L1 cache.

Imagine you are looking for a nail in your garage and it's really untidy. You decide that you'll keep some nails in your toolbox that you keep by the door, but you can't fit them all in. As soon as you run out of nails in your toolbox you have to go back to finding them in your garage. Having a toolbox that is as large as your garage wouldn't help as you'll fill it with all type of crap again and it will take just as long to find it.
 
 
Quote from: biggun;772886
Even money an not change the law of physiscs.
And physics simply dictates that increased size needs more space.
More space means longer wires, Longer wires means longer lantency.
Its very simply physics - which everybody will understand.

They've hit hard limits before that were said to be impossible to break, until they were.
 I'm sure one day it will be cost effective to increase L1 cache, some funky 3d circuits or using light instead of electricity etc.
« Last Edit: September 13, 2014, 04:28:43 PM by psxphill »