首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在我的计算机上找到有关TLB的任何信息,也无法获取有关TLB的硬件计数器的信息。

无法在我的计算机上找到有关TLB的任何信息,也无法获取有关TLB的硬件计数器的信息。
EN

Unix & Linux用户
提问于 2023-05-24 05:20:51
回答 1查看 25关注 0票数 0

我使用的Ubuntu版本是Ubuntu 18.04.6LTS,内核版本是5.4.0-148泛型。我的处理器是12th Gen (R) Core (商标) i7-12700

我想知道不同页面大小(1G,2MB,4KB)在我的CPU中的TLB条目的数量,以及在程序执行过程中dTLB遗漏的数量。

cpuid -1命令告诉我它们是0:

代码语言:javascript
复制
    L1 TLB/cache information: 2M/4M pages & L1 TLB (0x80000005/eax):
      instruction # entries     = 0x0 (0)
      instruction associativity = 0x0 (0)
      data # entries            = 0x0 (0)
      data associativity        = 0x0 (0)
   L1 TLB/cache information: 4K pages & L1 TLB (0x80000005/ebx):
      instruction # entries     = 0x0 (0)
      instruction associativity = 0x0 (0)
      data # entries            = 0x0 (0)
      data associativity        = 0x0 (0)
   L1 data cache information (0x80000005/ecx):
      line size (bytes) = 0x0 (0)
      lines per tag     = 0x0 (0)
      associativity     = 0x0 (0)
      size (KB)         = 0x0 (0)
   L1 instruction cache information (0x80000005/edx):
      line size (bytes) = 0x0 (0)
      lines per tag     = 0x0 (0)
      associativity     = 0x0 (0)
      size (KB)         = 0x0 (0)
   L2 TLB/cache information: 2M/4M pages & L2 TLB (0x80000006/eax):
      instruction # entries     = 0x0 (0)
      instruction associativity = L2 off (0)
      data # entries            = 0x0 (0)
      data associativity        = L2 off (0)
   L2 TLB/cache information: 4K pages & L2 TLB (0x80000006/ebx):
      instruction # entries     = 0x0 (0)
      instruction associativity = L2 off (0)
      data # entries            = 0x0 (0)
      data associativity        = L2 off (0)
   L2 unified cache information (0x80000006/ecx):
      line size (bytes) = 0x40 (64)
      lines per tag     = 0x0 (0)
      associativity     = 0x7 (7)
      size (KB)         = 0x500 (1280)
   L3 cache information (0x80000006/edx):
      line size (bytes)     = 0x0 (0)
      lines per tag         = 0x0 (0)
      associativity         = L2 off (0)
      size (in 512KB units) = 0x0 (0)

不支持perf stat -e dTLB-loads,dTLB-load-misses,iTLB-load-misses显示

最新情况:

代码语言:javascript
复制
$ cpuid -1 -l 2
CPU:
      0xff: cache data is in CPUID 4
      0xfe: unknown
      0xf0: 64 byte prefetching

$ cpuid -1 -l 0x18
CPU:
   0x00000018 0x00: eax=0x00000004 ebx=0x00000000 ecx=0x00000000 edx=0x00000000

$ perf -v
perf version 5.4.231


$ perf list

List of pre-defined events (to be used in -e):

  branch-instructions OR branches                    [Hardware event]
  branch-misses                                      [Hardware event]
  bus-cycles                                         [Hardware event]
  cache-misses                                       [Hardware event]
  cache-references                                   [Hardware event]
  cpu-cycles OR cycles                               [Hardware event]
  instructions                                       [Hardware event]
  ref-cycles                                         [Hardware event]

  alignment-faults                                   [Software event]
  bpf-output                                         [Software event]
  context-switches OR cs                             [Software event]
  cpu-clock                                          [Software event]
  cpu-migrations OR migrations                       [Software event]
  dummy                                              [Software event]
  emulation-faults                                   [Software event]
  major-faults                                       [Software event]
  minor-faults                                       [Software event]
  page-faults OR faults                              [Software event]
  task-clock                                         [Software event]

我完全搞不懂我的机器出了什么问题。

EN

回答 1

Unix & Linux用户

发布于 2023-05-24 06:12:13

我怀疑你的机器有什么问题。cpuid的S输出是原始的,需要一些解释;具体来说,对于TLB信息,你应该看看第2页的信息而不是您引用的部分。您将在输出中找到更高的值,或者直接请求它:

代码语言:javascript
复制
$ cpuid -1 -l 2
CPU:
      0x63: data TLB: 2M/4M pages, 4-way, 32 entries
            data TLB: 1G pages, 4-way, 4 entries
      0x03: data TLB: 4K pages, 4-way, 64 entries
      0x76: instruction TLB: 2M/4M pages, fully, 8 entries
      0xff: cache data is in CPUID leaf 4
      0xb5: instruction TLB: 4K, 8-way, 64 entries
      0xf0: 64 byte prefetching
      0xc1: L2 TLB: 4K/2M pages, 8-way, 1024 entries

perf而言,您所拥有的版本可能不知道您的CPU (我还没有检查)。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/746810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档