为什么大部分处理器的L1缓存比L2缓存小? [英] Why is the size of L1 cache smaller than that of the L2 cache in most of the processors?

查看:50
本文介绍了为什么大部分处理器的L1缓存比L2缓存小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么大部分处理器的L1缓存比L2缓存小?

Why is the size of L1 cache smaller than that of the L2 cache in most of the processors ?

推荐答案

造成这种情况的原因各不相同.

There are different reasons for that.

系统中存在 L2 以加速出现 L1 缓存未命中的情况.如果 L1 的大小等于或大于 L2 的大小,则 L2 无法容纳比 L1 更多的缓存行,并且无法处理 L1 缓存未命中.从设计/成本的角度来看,L1 缓存与处理器绑定并且比 L2 更快.缓存的整个想法是,您可以通过添加比最慢的硬件性能更高(且成本更高)但比您拥有的更快的硬件更便宜的中间硬件来加速对较慢硬件的访问.即使您决定将 L1 缓存加倍,您也会增加 L2,以加速 L1 缓存未命中.

L2 exists in the system to speedup the case where there is a L1 cache miss. If the size of L1 was the same or bigger than the size of L2, then L2 could not accomodate for more cache lines than L1, and would not be able to deal with L1 cache misses. From the design/cost perspective, L1 cache is bound to the processor and faster than L2. The whole idea of caches is that you speed up access to the slower hardware by adding intermediate hardware that is more performing (and expensive) than the slowest hardware and yet cheaper than the faster hardware you have. Even if you decided to double the L1 cache, you would also increment L2, to speedup L1-cache misses.

那么为什么会有 L2 缓存呢?好吧,L1 缓存通常性能更高且构建成本更高,并且它绑定到单个内核.这意味着将 L1 大小增加一个固定数量将使成本在双核处理器中乘以 4,在四核中将乘以 8.L2 通常由不同的内核共享——取决于架构,它可以在处理器中的几个或所有内核之间共享,因此即使 L1 和 L2 的价格相同,增加 L2 的成本也会更小——即不是.

So why is there L2 cache at all? Well, L1 cache is usually more performant and expensive to build, and it is bound to a single core. This means that increasing the L1 size by a fixed quantity will have that cost multiplied by 4 in a dual core processor, or by 8 in a quad core. L2 is usually shared by different cores --depending on the architecture it can be shared across a couple or all cores in the processor, so the cost of increasing L2 would be smaller even if the price of L1 and L2 were the same --which it is not.

这篇关于为什么大部分处理器的L1缓存比L2缓存小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆