Context Switching: Difference between revisions

[unchecked revision][unchecked revision]
Line 33:
When virtual memory is updated -- for instance, when one process's address space is replaced with another's during a software context switch -- the TLB suddenly contains "stale" translations that are no longer valid. These translations must be flushed for correct behavior. Writing to CR3 will flush the TLB. However, by writing to CR3, you also eliminate all translations for the kernel, in addition to the last user process. This is less than ideal, as the next few operations must wait for the slow virtual-to-physical translations.
 
Recent Intel and AMD processors sport a tagged TLB, which allow you to tag a given translation with a certain address space configuration. In this scheme, the TLB entries never needsget to be flushed"stale", and thethus kernelthere translationsis areno neverneed needlesslyto flushedflush the TLB.
 
==Hardware Context Switching==
Anonymous user