Translation Lookaside Buffer

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
skandalOS
Posts: 15
Joined: Mon Sep 05, 2011 12:05 pm

Translation Lookaside Buffer

Post by skandalOS »

Hello,

I've got a simple question to you about TLB.

As I know the TLB is part of MMU which contains/stores the most recently used pages.

Something similar like this:

due to Andrews S. Tannenbaum (Modern Operating Systems)

Virtual Page........... some flags............pageframe(physical page)
140.....................................................31
860.....................................................55
....

So, before the MMU begins to translate it throws a look to the TLB if there is an entry for the searched virtual page.
If the virtual page exists it takes the pageframe and use it.
For example for 860 (which could be a stack-page) it takes the page 55.

But what happens if there a two times the own virtual page entry, from two different processes?
For example two same stack-pages, which would be very easy possible?

The MMU could take wrong page instead of the other. and then boooom.
There is no detailed explanation about this topic.

Are there for every process different TLB-Entries, how does it work exactly?

Please help me, I'm learning for the OS-Exam and they ask deep questions.

I'm a little bit confused and want to know the detailed structure about TLB.

Thanks a lot
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Translation Lookaside Buffer

Post by bluemoon »

skandalOS wrote:But what happens if there a two times the own virtual page entry, from two different processes?
The OS is responsible to invalidate the entry upon switching process, there are specific mechanism to do so for each system.
(In some case you can do lazy invalidate as well)
skandalOS
Posts: 15
Joined: Mon Sep 05, 2011 12:05 pm

Re: Translation Lookaside Buffer

Post by skandalOS »

Hi,

I've got a little question.

What happens with the contain of TLB of the process if the scheduler takes another Process to run.

I think the whole TLB-values will be cleared or not?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Translation Lookaside Buffer

Post by Combuster »

RTFM; 2. AMD, chapter 5 verse 5. Will have an equivalent chapter in Intel 3A as well.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply