什么是 TLB 击落?
什么是 SMP 中的 TLB 击落?
我无法找到有关这个概念的很多信息。任何好的例子将非常感激。
What is a TLB shootdown in SMPs?
I am unable to find much information regarding this concept. Any good example would be very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
TLB(转换后备缓冲区)是从虚拟内存地址到物理内存地址转换的缓存。当处理器更改地址的虚拟到物理映射时,它需要告诉其他处理器使其缓存中的该映射无效。
该过程称为“TLB 击落”。
A TLB (Translation Lookaside Buffer) is a cache of the translations from virtual memory addresses to physical memory addresses. When a processor changes the virtual-to-physical mapping of an address, it needs to tell the other processors to invalidate that mapping in their caches.
That process is called a "TLB shootdown".
一个简单的示例:
系统中的所有处理器共享一些内存。
您的一个处理器限制对该共享内存的一页的访问。
现在,所有处理器都必须刷新其 TLB,以便那些被允许访问该页面的处理器不能再这样做。
一个处理器的操作导致 TLB 被刷新到其他处理器上,这就是所谓的 TLB 关闭。
A quick example:
You have some memory shared by all of the processors in your system.
One of your processors restricts access to a page of that shared memory.
Now, all of the processors have to flush their TLBs, so that the ones that were allowed to access that page can't do so any more.
The actions of one processor causing the TLBs to be flushed on other processors is what is called a TLB shootdown.
我认为这个问题需要更详细的答案。
页表:存储虚拟内存(软件)和物理内存(硬件)映射的数据结构
,但是页表可能很大,需要遍历页表(找到虚拟地址对应的地址)物理地址)可能是一个耗时的过程。为了使这个过程更快,使用了一个称为 TLB(Translation Lookaside Buffer)的缓存,它存储最近访问的虚拟内存地址。
可以清楚地看到,TLB 条目需要始终与其各自的页表条目同步。现在,TLB 是每核缓存 即。每个核心都有自己的 TLB。
每当任何一个核心修改页表条目时,该特定的 TLB 条目在所有核心中都会失效。此过程称为 TLB 击落。
TLB 刷新可以由各种更改页表条目的虚拟内存操作触发,例如页面迁移、释放页面等。
I think the question demands a more detailed answer.
page table: a data structure that stores the mapping between virtual memory (software) and physical memory (hardware)
however, the page table can be quite large and traversing the page table (to find the virtual address's corresponding physical address) can be a time consuming process. To make this process faster, a cache called the TLB (Translation Lookaside Buffer) is used, which stores the recently accessed virtual memory addresses.
As can be clearly seen the TLB entries need to be in sync with their respective page table entries at all times. Now the TLBs are a per-core cache ie. every core has its own TLB.
Whenever a page table entry is modified by any of the cores, that particular TLB entry is invalidated in all of the cores. This process is called TLB shootdown.
TLB flushing can be triggered by various virtual memory operations that change the page table entries like page migration, freeing pages etc.