Intel的Sandy Bridge CPU中TLB的大小是如何确定的? [英] How is the size of TLB in Intel's Sandy Bridge CPU determined?

查看:26
本文介绍了Intel的Sandy Bridge CPU中TLB的大小是如何确定的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

维基网页(https://en.wikipedia.org/wiki/Sandy_Bridge) 提到数据 TLB 对于 4KB、2MB 和 1GB 页面分别有 64、32 和 4 个条目.

The wiki webpage(https://en.wikipedia.org/wiki/Sandy_Bridge) mentioned that Data TLB has 64, 32 and 4 entries respectively for 4KB, 2MB and 1GB pages.

我发现这些数字很难理解.Sandy Bridge 有一个 48 位的虚拟地址,这意味着对于 4K 页面,可以有 2^36 个页面,对于 2MB 和 1GB 页面,应该有 2^27 和 2^18 个页面.如果TLB 有64 个条目用于4K 页,每个条目的大小应不小于6+36 = 42 位.为什么 2M 页只有 32 个条目,而不是 2^15 (42-27) 个条目?

I found these numbers hard to understand. Sandy Bridge has a virtual address of 48 bits, which means for 4K page, there can be 2^36 pages, and for 2MB and 1GB pages, there should be 2^27 and 2^18 pages. If TLB has 64 entries for 4K page, the size of each entry should be no less than 6+36 = 42 bits. Why are there only 32 entries for 2M page, instead of 2^15 (42-27) entries?

我知道在 TLB 条目中会有额外的位用于控制目的.但是对于不同的页面大小,该空间不应该是恒定的吗?

I know in TLB entries there will be additional bits for control purpose. But shouldn't that space be constant for different page size?

推荐答案

因为它们是 不同的 TLB.
在我的 Haswell 上使用 EAX=2 执行 cpuid 并解码 TLB 描述符得到:

Becuase they are different TLBs.
Executing cpuid with EAX=2 on my Haswell and decoding the TLB descriptors gets:

指令 TLB:
           2M/4M 页,完全关联,8 个条目
           4KByte 页面,8 路,64 个条目

Instruction TLB:
              2M/4M pages, fully associative, 8 entries
              4KByte pages, 8-way, 64 entries

数据 TLB:
               2M/4M页,4路,32个条目和的单独的阵列1 GB页,4 路,4 个条目
           4 KB 页,4 路,64 个条目

Data TLB:
              2M/4M pages, 4-way, 32 entries and a separate array with 1 GByte pages, 4-way, 4 entries
              4 KByte pages, 4-way, 64 entries

共享二级 TLB:
           4 K/2M 页,8 向,1024 个条目

Shared 2nd-Level TLB:
              4 K/2M pages, 8-way, 1024 entries

TLB 缓存是高度专门的CAM固定布局,它不是具有通用布局的暂存存储器.

A TLB cache is a highly specialized CAM with a fixed layout, it is not a scratch memory with a general purpose layout.

一些 TLB 可以处理超过一个页面大小,但这些都是权衡,因为信息以通用格式缓存.
使用不同的 TLB 处理不同的页面大小可以提高缓存命中率,就像使用 DTLB 和 ITLB 一样.

Some TLB can handle more that one page size but those are trade-offs were the information is cached in a common format.
Having different TLBs handling different page sizes improves cache hits, just like having a DTLB and an ITLB.

数据缓存的工作方式不同,因为它们不缓存信息,它们缓存没有布局的数据,这就是为什么以 KiB 为单位为它们提供大小是有意义的,但对于处理结构化信息的缓存则不然.

Data caches works differently since they don't cache information, they cache data with no layout and that's why it makes sense to give the size in KiB for them but it doesn't for caches that deal with structured information.

这篇关于Intel的Sandy Bridge CPU中TLB的大小是如何确定的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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