如何找到页面大小、关联性以及 TLB 大小和条目数?

Tim*_*Tim 4 cache virtual-memory

在Ubuntu系统下,有没有查找命令:

  • 页面大小,
  • n 在 n 路缓存关联中,
  • TLB 缓存的大小和条目数?

slm*_*slm 13

该工具cpuid可以调用 CPU 以获取有关 CPU 架构的更多详细信息:

TLB 大小、整体和关联性

$ cpuid | grep -i tlb
   cache and TLB information (2):
      0x5a: data TLB: 2M/4M pages, 4-way, 32 entries
      0x03: data TLB: 4K pages, 4-way, 64 entries
      0x55: instruction TLB: 2M/4M pages, fully, 7 entries
      0xb2: instruction TLB: 4K, 4-way, 64 entries
      0xca: L2 TLB: 4K, 4-way, 512 entries
Run Code Online (Sandbox Code Playgroud)

有各种版本的工具被称为,cpuid但你想要这个,我相信它是“原始的”。

Debian/Ubuntu 附带的版本是不同的,但是cpuid如果其他发行版不是已经可用的预构建版本,则可以在上面编译。它可用于官方存储库中的大多数基于 Red Hat 的发行版。