12.07.2015 Views

Levels of the Memory Hierarchy

Levels of the Memory Hierarchy

Levels of the Memory Hierarchy

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Page Table and Process state° Each program, on compilation, is given its ownpage table° Page Table itself resides in <strong>the</strong> main memory° Address <strong>of</strong> <strong>the</strong> start <strong>of</strong> <strong>the</strong> page table is in <strong>the</strong> pagetable register° Page table Register, toge<strong>the</strong>r with o<strong>the</strong>r registers,specifies <strong>the</strong> state <strong>of</strong> that program – referred to as<strong>the</strong> process state• If a program needs to relinquish CPU for ano<strong>the</strong>r program (preemption),<strong>the</strong> process state needs to be stored first by <strong>the</strong>Operating System• Restoring <strong>the</strong> program execution involves Operating System reloading<strong>the</strong> state° Program Counter (PC):• One <strong>of</strong> <strong>the</strong> o<strong>the</strong>r registers• holds <strong>the</strong> address <strong>of</strong> next instruction to be executed.PDE1C_33Page Table – Continued° Indexed by virtual page number• That is, <strong>the</strong> page table has an entry for each virtual page.• How many page table entries <strong>the</strong> virtual memory <strong>of</strong> figurein #1C_32 will require?° So, no index is needed as in fully associative (FA) cache° But … <strong>the</strong>re is a subtle difference with FA cache• For a given memory address, we extract <strong>the</strong> tag andsearch <strong>the</strong> entire cache (see #1C_22, 23)• The outcome is ei<strong>the</strong>r an entry for <strong>the</strong> reference addressis found (hit) or not found° With Page table, an entry for a virtual page is always found(see above) – this does not mean it is a hit° Hit or miss (page fault) is decided by <strong>the</strong> V-bit in <strong>the</strong> entry° V bit = 1 means that <strong>the</strong> entry has <strong>the</strong> physical address where<strong>the</strong> desired virtual page resides (hit)° V bit = 0 means <strong>the</strong> entry points to <strong>the</strong> disk address where <strong>the</strong>desired page can be fetched from (page fault)PDE1C_34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!