Custom Search
Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC!
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
Results 1 to 6 of 6

Thread: why L1 cache and L2 cache are different sizes

  1. #1

    why L1 cache and L2 cache are different sizes

    Hello i just have a question really i want to know why L1 cache and L2 cache are different sizes if any one could help me with this question i would really like to hear from you thanks.

  2. #2
    Join Date
    Jan 2004
    Location
    Here
    Posts
    10,487
    I am not an expert on this but from my understanding the biggest issue, in a nutshell, is that a smaller cache is faster, but a larger cache will take less hits, meaning it is more likely to hold the sought after data. So to improve performance the CPU will go to the smaller faster L1 cache first, if the sought after data isn't there it will then move to the larger relatively slower L2 cache, then to the L3 (if present), then to main system memory, then finally to the HDD if necessary.

    So basically there is a balance between smaller and faster, and larger and slower but taking less hits.

    There is much more to this though. In fact you could probably write a masters thesis on cache alone.
    8.1 Pro 64bit
    AMD FX 8350
    Asus Sabertooth 990FX R2.0
    24GB GSkill/Corsair 1866MHz
    2x XFX 6870 1GB
    SSD - OCZ V4 128GB/Kingston 120GB
    HDD - 3TB/2x 750GB/500GB/250GB
    Corsair TX850M
    Cooler Master HAF 932 Red
    CM Hyper 212 EVO w/2x SickleFlow 120mm Red
    12x BD-ROM
    Logitech X540 5.1 Surround
    2X Acer 23" LED - Eyefinity: 3840x1080
    Microsoft Sidewinder x4 KB

    "The significant problems we face cannot be solved at the same level of thinking we were at when we created them."
    - Albert Einstein

  3. #3
    Join Date
    Mar 2002
    Location
    west Lothian, Scotland.
    Posts
    13,319
    COST
    The faster the cache memory, the more it costs; the slower, the less it costs.
    Hence it is a smart strategy to use small amounts of fast expensive memory at the top of the memory higherarchy [probably modelled on our social structure (very few millionaire's at the top and millions of poor grunts at the bottom)], and large amounts of low cost storage at the bottom.
    The stuff that's used the most [most needed/valuable] moves up the higherarchy; the stuff used the least [least needed] goes down the higherarchy.

  4. #4
    Join Date
    Jan 2004
    Location
    Here
    Posts
    10,487
    Well yes cost is a consideration. If SRAM wasn't so expensive it would be used as main system ram instead of tiny amounts for cache. But the smaller and larger sizes as you move down the ladder has to do with branch prediction and performance. The smaller size is basically the same concept as a smaller registry; less space to look through equals less time to find what you are looking for, equals better performance, if the data is actually there. If not then move too the larger but slower (in ns) L2, but still way faster than regular SDRAM system memory. Now hopefully the CPU doesn't need to go all the way down the to the HDD to get data. That's like walking to the other side of the world to get a stick of butter.
    8.1 Pro 64bit
    AMD FX 8350
    Asus Sabertooth 990FX R2.0
    24GB GSkill/Corsair 1866MHz
    2x XFX 6870 1GB
    SSD - OCZ V4 128GB/Kingston 120GB
    HDD - 3TB/2x 750GB/500GB/250GB
    Corsair TX850M
    Cooler Master HAF 932 Red
    CM Hyper 212 EVO w/2x SickleFlow 120mm Red
    12x BD-ROM
    Logitech X540 5.1 Surround
    2X Acer 23" LED - Eyefinity: 3840x1080
    Microsoft Sidewinder x4 KB

    "The significant problems we face cannot be solved at the same level of thinking we were at when we created them."
    - Albert Einstein

  5. #5
    Join Date
    Jan 2004
    Location
    Here
    Posts
    10,487
    Quote Originally Posted by jlreich
    but a larger cache will take less hits, meaning it is more likely to hold the sought after data.
    So basically there is a balance between smaller and faster, and larger and slower but taking less hits.
    Sorry, that should have been misses. A hit would be actually finding the data.
    8.1 Pro 64bit
    AMD FX 8350
    Asus Sabertooth 990FX R2.0
    24GB GSkill/Corsair 1866MHz
    2x XFX 6870 1GB
    SSD - OCZ V4 128GB/Kingston 120GB
    HDD - 3TB/2x 750GB/500GB/250GB
    Corsair TX850M
    Cooler Master HAF 932 Red
    CM Hyper 212 EVO w/2x SickleFlow 120mm Red
    12x BD-ROM
    Logitech X540 5.1 Surround
    2X Acer 23" LED - Eyefinity: 3840x1080
    Microsoft Sidewinder x4 KB

    "The significant problems we face cannot be solved at the same level of thinking we were at when we created them."
    - Albert Einstein

  6. #6
    Join Date
    Mar 2002
    Posts
    12,211
    Blog Entries
    2
    Part of it is the nature of the evolving architectures of computers and their processors. In the early days of computing, CPU's didn't have cache. It wasn't an idea that had developed until the late 1970's (at least for PC processors). There are many reasons for this, but performance has always been the driving factor behind caches.

    As to the reason why L1 cache is bigger than L2 cache - the simple answer is that they aren't. In the world of x86 CPU's, Socket 7 designs were known to support but not require L2 cache. In later years, the Duron was a cost-effective "cheapo" CPU from AMD that had less L2 cache than L1 cache. Intel has never been able to do this due to the fact that all of their CPU's use an inclusive cache architecture, while AMD uses exclusive. Other processor platforms have similar stories, such as the SPARC series in Sun-based servers and the Motorola/PowerPC CPU's of the Apple Macintosh PC's.

    I'm sure if I dig deep enough into CPU history, I could find many examples of CPU's with equal-sized L1 and L2 caches. So the "rules" as we see them aren't always absolute.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •