The TLB, caches and INVLPG instruction

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
User avatar
Coconut9
Member
Member
Posts: 51
Joined: Sat May 20, 2017 1:25 am
Location: PCI bus: 3, slot: 9, function: 5

The TLB, caches and INVLPG instruction

Post by Coconut9 »

I can understand everything in virtual memory except the TLB and I can't find the purpose of the INVLPG instruction. Can someone explain it to me?
Also what is the caches and the caching?
Last edited by Coconut9 on Mon Oct 09, 2017 7:13 am, edited 1 time in total.
How people react when a new update of your OS is coming:
Linux user: Cool, more free stuff!
Mac user: Ooh I have to pay!
Windows user: Ah not again!
davidv1992
Member
Member
Posts: 223
Joined: Thu Jul 05, 2007 8:58 am

Re: The TLB and INVLPG instruction

Post by davidv1992 »

In essence, the goal of the TLB is simple: It is very expensive to do a full page adres lookup on every memory access, as that would lead to 3 memory reads for every memory access (assuming 32 bit 4K pagesize paging). The processing required for this would slow the processor down a lot. So instead of doing such a lookup on every memory read, the processor just remembers what previous outcomes were in a cache, the TLB. However, this means that on a memory read, it is no longer checking the actual page tables, so it won't notice if the software has made a change to them. The INVLPG instruction is basically a heads up to the processor, telling it that anything it assumed for the given adres based on past accesses is may have changed, and forcing it to check the page tables next time it needs that particular page.
Post Reply