What is TLB shootdown?

我与影子孤独终老i 提交于 2019-11-28 16:35:43

问题


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.


回答1:


A quick example:

  1. You have some memory shared by all of the processors in your system.

  2. One of your processors restricts access to a page of that shared memory.

  3. 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.




回答2:


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".




回答3:


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.



来源:https://stackoverflow.com/questions/3748384/what-is-tlb-shootdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!