Page Fault and Page Replacement Policies in High Performance Computing, Slides of Computer Science

Page faults in high performance computing systems, the process of handling page faults, and various page replacement policies to decide which page to replace when a page fault occurs. The document also touches upon the principle of locality of reference and its importance in page replacement.

Typology: Slides

2012/2013

Uploaded on 04/28/2013

dewaan
dewaan 🇮🇳

3.8

(4)

43 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
High Performance Computing
Lecture 14
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Page Fault and Page Replacement Policies in High Performance Computing and more Slides Computer Science in PDF only on Docsity!

High Performance Computing

Lecture 14

2

Page Fault

 Situation where virtual address generated

by processor is not available in main

memory

 Detected on attempt to translate address

 Page Table entry is invalid

 Must be `handled’ by operating system

1. Identify slot in main memory to be used

2. Get page contents from disk

3. Update page table entry

 Data can then be provided to the processor

4

Page Replacement Policies

 Question: How does the page fault handler

decide which main memory page to replace

when there is a page fault?

 How important is this decision?

 In the worst case, the policy could always replace

the page that is going to be accessed by the

processor next

 Each of these would require copying the virtual page from hard disk to main memory

5

Aside: Disk Access Speed

 We saw that there is a speed disparity of about

2 orders of magnitude between Processor

(nsec) and Main Memory (~100 ns)

 Recall: nano 10

  • 9

 Hard disk

 Remembers things by the state of magnetic material  Disk is a mechanical device: motors rotating a firm plate coated with magnetic material  Aside: Computer noises  Reading a page from hard disk could take - msecs (milli:

  • 3 ) if not longer  i.e., 10 4 times slower than main memory!

7

Page Replacement Policies

Principle of Locality of Reference

 A commonly believed/seen program property

 If memory address A is referenced at time t , then

it and its neighbouring memory locations are likely

to be referenced in the near future

Temporal Locality of reference Spatial Locality of reference

8

Locality of Reference

 Based on your experience, why do you expect

that programs will display locality of reference?

Instructions Data Same address (temporal) Neighbours (spatial) Small loop Sequential code Local variable Stepping through array Function Loop Loop index

10

Least Recently Used (LRU) Policy

 Keep track of when each page was last used

 With a timestamp

 LRU page: the one with the smallest timestamp

 Requires a large number of comparisons

 Or, keep track of the stack of recently used

pages

 LRU page: at the bottom of the stack

 Stack must be updated on every memory access

 So, LRU might be too expensive in practise