OS & Hardware
On a multicore system, when the OS modifies a page-table entry to revoke a mapping, what must be done?
- AFlushing only its own core's TLB is enough; other cores automatically use the correct translation
- BMaking sure the stale translation is removed from other cores' TLBs too
- CNothing; every TLB is updated at the same moment the page table is written
Show answer and explanation
Answer: B. Making sure the stale translation is removed from other cores' TLBs too
On many CPUs, unlike caches, TLBs are not kept coherent by hardware, so other cores' TLBs may still hold the translation from before the page table was changed. Left alone, other cores could still access the revoked page. The OS therefore removes the stale entry from other cores, either by sending inter-processor interrupts or by using instructions that broadcast the invalidation, and waits for completion. This is a TLB shootdown, and it gets more expensive as core counts rise.
- A. Other cores' TLBs may still hold the stale translation.
- B. Correct. Stale translations must be removed from other cores' TLBs too.
- C. On many CPUs, TLB coherence is not maintained automatically.