小编D4l*_*l3k的帖子

测量TLB对Cortex-A9的影响

在阅读了以下论文后,https://people.freebsd.org/~lstewart/articles/cpumemory.pdf("每个程序员应该了解内存的内容")我想尝试一下作者的测试,即测量效果TLB的最终执行时间.

我正在研究嵌入Cortex-A9的三星Galaxy S3.

根据文件:

我写了一个小程序,用N个条目分配一个结构数组.每个条目的大小为== 32个字节,因此它适合缓存行.我执行几次读取访问,并测量执行时间.

typedef struct {
     int elmt; // sizeof(int) == 4 bytes
     char padding[28]; // 4 + 28 = 32B == cache line size
}entry;


volatile entry ** entries = NULL;

//Allocate memory and init to 0
entries = calloc(NB_ENTRIES, sizeof(entry *));
if(entries == NULL) perror("calloc failed"); exit(1);

for(i = 0; i < NB_ENTRIES; i++)
{
      entries[i] = mmap(NULL, …
Run Code Online (Sandbox Code Playgroud)

c benchmarking arm embedded-linux cortex-a

39
推荐指数
1
解决办法
1448
查看次数

标签 统计

arm ×1

benchmarking ×1

c ×1

cortex-a ×1

embedded-linux ×1