Invalidating TLB entries
ID: x86-paging/invalidating-tlb-entries
x86 Paging Tutorial Invalidating TLB entries by
Ciro Santilli 36 Updated 2025-04-24 +Created 1970-01-01
When the process changes,
cr3
change to point to the page table of the new current process.A simple and naive solution would be to completely invalidate the TLB whenever the
cr3
changes.However, this is would not be very efficient, because it often happens that we switch back to process 1 before process 2 has completely used up the entire TLB cache entries.
The solution for this is to use so called "Address Space Identifiers" (ASID) as mentioned in sources such as:
Basically, the OS assigns a different ASID for each process, and then TLB entries are automatically also tagged with that ASID. This way when the process makes an access, the TLB can determine if a hit is actually for the current process, or if it is an old address coincidence with another process.
New to topics? Read the docs here!