由于访问模式是流式访问,因此每个TLB条目将用于对整个页面的每四个字节的一次访问,并且永远不会重复使用 . 这意味着每个TLB条目将被重复使用1023次,因此每页将避免1023个查找(2046个内存访问) . (由于使用不同的翻译没有重叠,只有完全本地化的重用,单个条目数据TLB的性能与2048条目的TLB相当 . )
考虑以下对双入口直接映射数据TLB所发生情况的描述(认识到虚拟地址的最低有效12位 - 页面内的偏移 - 被TLB忽略,并且虚拟地址的一位是用于索引到TLB):
load 0x0100_0000; // TLB entry 0 tag != 0x0800 (page # 0x0_1000) [miss]
// 2 memory accesses to fill TLB entry 0
load 0x0100_0004; // TLB entry 0 tag == 0x0800 [hit]
load 0x0100_0008; // TLB entry 0 tag == 0x0800 [hit]
... // 1020 TLB hits in TLB entry 0
load 0x0100_0ffc; // TLB entry 0 tag == 0x0800 [hit]; last word in page
load 0x0100_1000; // TLB entry 1 tag != 0x0800 (page # 0x0_1001) [miss]
// 2 memory accesses to fill TLB entry 1
load 0x0100_1004; // TLB entry 1 tag == 0x0800 [hit]
load 0x0100_1008; // TLB entry 1 tag == 0x0800 [hit]
... // 1020 TLB hits in TLB entry 1
load 0x0100_1ffc; // TLB entry 1 tag == 0x0800 [hit]; last word in page
load 0x0100_2000; // TLB entry 0 tag (0x0800) != 0x0801 (page # 0x0_1002) [miss]
// 2 memory accesses to fill TLB entry 0
load 0x0100_2004; // TLB entry 0 tag == 0x0801 [hit]
load 0x0100_2008; // TLB entry 0 tag == 0x0801 [hit]
... // 1020 TLB hits in TLB entry 0
load 0x0100_2ffc; // TLB entry 0 tag == 0x0801 [hit]; last word in page
load 0x0100_3000; // TLB entry 1 tag (0x0800) != 0x0801 (page # 0x0_1003) [miss)
// 2 memory accesses to fill TLB entry 1
load 0x0100_3004; // TLB entry 1 tag == 0x0801 [hit]
load 0x0100_3008; // TLB entry 1 tag == 0x0801 [hit]
... // 1020 TLB hits in TLB entry 1
load 0x0100_3ffc; // TLB entry 1 tag == 0x0801 [hit]; last word in page
... // repeat the above 510 times
// then the last 4 pages of the 8 MiB stream
load 0x017f_c000; // TLB entry 0 tag (0x0bfd) != 0x0bfe (page # 0x0_17fc) [miss]
// 2 memory accesses to fill TLB entry 0
load 0x017f_c004; // TLB entry 0 tag == 0x0bfe [hit]
load 0x017f_c008; // TLB entry 0 tag == 0x0bfe [hit]
... // 1020 TLB hits in TLB entry 0
load 0x017f_cffc; // TLB entry 0 tag == 0x0bfe [hit]; last word in page
load 0x017f_d000; // TLB entry 1 tag (0x0bfd) != 0x0bfe (page # 0x0_17fd) [miss]
// 2 memory accesses to fill TLB entry 1
load 0x017f_d004; // TLB entry 1 tag == 0x0bfe [hit]
load 0x017f_d008; // TLB entry 1 tag == 0x0bfe [hit]
... // 1020 TLB hits in TLB entry 1
load 0x017f_dffc; // TLB entry 1 tag == 0x0bfe [hit]; last word in page
load 0x017f_e000; // TLB entry 0 tag (0x0bfe) != 0x0bff (page # 0x0_17fe) [miss]
// 2 memory accesses to fill TLB entry 0
load 0x017f_e004; // TLB entry 0 tag == 0x0bff [hit]
load 0x017f_e008; // TLB entry 0 tag == 0x0bff [hit]
... // 1020 TLB hits in TLB entry 0
load 0x017f_effc; // TLB entry 0 tag == 0x0bff [hit]; last word in page
load 0x017f_f000; // TLB entry 1 tag (0x0bfe) != 0x0bff (page # 0x0_17ff) [miss]
// 2 memory accesses to fill TLB entry 1
load 0x017f_f004; // TLB entry 1 tag == 0x0bff [hit]
load 0x017f_f008; // TLB entry 1 tag == 0x0bff [hit]
... // 1020 TLB hits in TLB entry 1
load 0x017f_fffc; // TLB entry 1 tag == 0x0bff [hit]; last word in page
每个页面按顺序引用1024次(每个四字节元素一次),然后再从未引用 .
(现在考虑一个带有四个TLB条目和两个条目缓存页面目录条目的设计[每个条目都有指向页面表条目页面的指针] . 每个缓存的PDE将被重用于1023页面查找,将它们减少到一个内存访问每个 . [如果8 MiB流式访问作为内部循环重复并且是4 MiB对齐,则在第一次迭代之后,双入口PDE缓存将完全预热,并且所有后续页面表查找仅需要一个内存参考 . ])