week 7 - scheduling and memory management

paging

page table entries

cachingreferencedmodifiedprotectionmodified/absentpage frame number

implementation

with a page size of 4kb and a 32 but address space, the table with require around 1,000,000 entries

speeding up paging

name of missexplanation
soft misswhen the address is not in the TLB, but is in memory. the TLB must be updated. no disk I/O. around 2nsecs to fix
hard misswhen a page is not in the TLB or memory, this requires a search of the page table. easily a million times slower to fix then a soft miss
minor page faulta page may not be in the process page table, but could still be in memory due to a another process bringing it in (i.e a shared library)
major page faultwhen the page table is not in memory at all
segmentationif a process tries to access invalid memory addresses. the OS will kill this process with a “segmentation fault” signal

biiiiiiig memories

PT1 offsetPT2 offsetoffset

page replacement algorithms

list of algorithms
optimal algorithm
NRU (not recently used)
FIFO (first in, first out)
second chance
LRU (least recently used)
NFU (not frequently used)
aging
clock
working set
WS clock

NRU

Class TypeR bitM bitdescription
class 000not references, or modified
class 101although it might seem impossible, this happens when a page has been modified, but not referenced for long enough that it’s R bit has been cleared. The OS will never clear the M bit of the page, since it’s needed so that it can be written back to disk if it is evicted
class 210referenced but not modified
class 311modified and referenced

first in first out

second chance

clock page replacement

least recently used

not frequently used

aging

working set page replacement

WSclock

page fault handling

on the event of a page fault, the following steps are carried out:

backing store

segmentation

memory stack

table of comparison

point of comparisonpagingsegmentation
is programmer aware?NY
how many address spaces1many
total address space > physical memoryYY
conflicting size can easily be dealt withNY
can easily share common utils between processesNY

segmentation with paging

18 bits for address of page table9 bit segment length (in terms of pages)1 bit for page size3 bits for protection bits1 bit for random stuff

segmentation in x86

13 bits for table index1 bit for GDT vs LDT toggle2 bits for privilege level

Back to notes...

click here to go back to more