Page-table lookups, Operating System

Assignment Help:

How exactly is a page table used to look up an address?

The CPU has a page table base register (PTBR)which points to the base (entry 0) of the level-0 page table. Each process has its own page table, and so in a context switch, the PTBR is updated along with the other context registers. The PTBR contains a physical address, not a virtual address.When theMMU receives a virtual address which it needs to translate to a physical address, it uses the PTBR to go to the the level-0 page table. Then it uses the level-0 index fromthemost-signi?cant bits (MSBs) of the virtual address to ?nd the appropriate table entry, which contains a pointer to the base address of the appropriate level-1 page table. Then, from that base address, it uses the level-1 index to ?nd the appropriate entry. In a 2-level page table, the level-1 entry is a PTE, and points to the physical page itself. In a 3-level (or higher) page table, there would be more steps:

This sounds pretty slow: N page table lookups for everymemory access. But is it necessarily slow? A special cache called a TLB1 caches the PTEs from recent lookups, and so if a page's PTE is in the TLB cache, this improves a multi-level page table access time down to the access time for a single-level page table.

When a scheduler switches processes, it invalidates all the TLB entries (also known as TLB shoot- down). The new process then starts with a "cold cache" for its TLB, and takes a while for the TLB to "warm up". The scheduler therefore should not switch too frequently between processes, since a "warm" TLB is critical to making memory accesses fast. This is one reason that threads are so useful: switching threads within a process does not require the TLB to be invalidated; switching to a new thread within the same process lets it start up with a "warm" TLB cache right away. So what are the drawbacks of TLBs? The main drawback is that they need to be extremely fast, fully associative caches. Therefore TLBs are very expensive in terms of power consumption, and have an impact on chip real estate, and increasing chip real estate drives up price dramatically. The TLB can account a signi?cant fraction of the total power consumed by a microprocessor, on the order of 10% or more. TLBs are therefore kept relatively small, and typical sizes are between 8 and 2048 entries.


Related Discussions:- Page-table lookups

Fibonacci sequence, #questionThe Fibonacci sequence is the series of number...

#questionThe Fibonacci sequence is the series of numbers 0,1,1,2,3,5,8,… Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fib n-1 + fib n-2 Write a C program u

Explain root partition, Explain root partition The root partition,which...

Explain root partition The root partition,which have the operating-system kernel and potentially other system files, is mounted at boot time. In successful mount operation, ope

Why high level languages need compiler, Q. Why High level languages need Co...

Q. Why High level languages need Compiler? High level languages - illustrations are COBOL, FORTRAN, PL/I andALGOL - are processed by interpreters andcompilers. A compilers is a

Making the transition to client - server programming, Making the Transition...

Making the Transition to Client - Server Programming Making the transition to client - server programming is a significant effort. Client - server applications must be designed

Explain peterson''s solution for the critical section problem, Explain the ...

Explain the Peterson's solution for the critical section problem? In Peterson's solution two variables a) flag and b) turn are used as shared variables. If the both shared vari

Explain acyclic graph directories and its implementation, Acyclic Graph Dir...

Acyclic Graph Directories In this kind of directory structure the shared directories or files can exist in the file system in two or more places at once. A tree structure excl

Explain interrupts, Interrupts The hardware mechanism that enables a de...

Interrupts The hardware mechanism that enables a device to inform the CPU is called an interrupt. The basic interrupt mechanism works as follows. The CPU hardware has a wire kn

What is the main advantage of multiprogramming, What is the main advantage ...

What is the main advantage of multiprogramming? Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users. I

Queing theory, how to solve queing theory step by step

how to solve queing theory step by step

Transportation, what are the factors influencing the choice of a mode of tr...

what are the factors influencing the choice of a mode of transportation?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd