简体   繁体   English

在 LINUX 上测量 TLB 未命中的命令

[英]Command to measure TLB misses on LINUX

Could some one direct me to a command to measure TLB misses on LINUX, please?有人可以指导我使用命令来测量 LINUX 上的 TLB 未命中吗? Is it okay to consider minor page faults as TLB misses?是否可以将次要页面错误视为 TLB 未命中?

You can use perf to do this.您可以使用perf来执行此操作。 Provided your CPU supports it.只要您的 CPU 支持它。

Use perf list to get some idea of the counters available.使用perf list了解可用的计数器。 When I took this list and grepped for TLB (on my Sandy Bridge machine) I got:当我拿到这份清单并搜索 TLB(在我的 Sandy Bridge 机器上)时,我得到:

rob@tartarus:~$ perf list | grep -i tlb
  dTLB-loads                                         [Hardware cache event]
  dTLB-load-misses                                   [Hardware cache event]
  dTLB-stores                                        [Hardware cache event]
  dTLB-store-misses                                  [Hardware cache event]
  dTLB-prefetches                                    [Hardware cache event]
  dTLB-prefetch-misses                               [Hardware cache event]
  iTLB-loads                                         [Hardware cache event]
  iTLB-load-misses                                   [Hardware cache event]

You can then use this particular counter with: perf record -e <event0>,<event1>,..然后你可以使用这个特定的计数器: perf record -e <event0>,<event1>,..

And then just use perf report to look at the results.然后只需使用perf report来查看结果。

To see this information for the entire system, you could use the following line.要查看整个系统的此信息,您可以使用以下行。 This will record the counters for 1 minute (60 seconds).这将记录计数器 1 分钟(60 秒)。

perf stat -e dTLB-loads,dTLB-load-misses,iTLB-loads,iTLB-load-misses sleep 60

If miss ratio is higher than 1% you should look into using huge pages .如果未命中率高于 1%,您应该考虑使用大页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM