Problems: Page Table Size Maximum virtual space can be considerable - - PowerPoint PPT Presentation

problems page table size
SMART_READER_LITE
LIVE PREVIEW

Problems: Page Table Size Maximum virtual space can be considerable - - PowerPoint PPT Presentation

Problems: Page Table Size Maximum virtual space can be considerable (e.g. 2 40 bytes) Disk space for program image (1TB per process!) Page Table size 0.5GB (with 16KB pages, 8 byte descriptors) Most programs use only a small fraction of maximum


slide-1
SLIDE 1

Problems: Page Table Size

Maximum virtual space can be considerable (e.g. 240 bytes) Disk space for program image (1TB per process!) Page Table size 0.5GB (with 16KB pages, 8 byte descriptors) Most programs use only a small fraction of maximum address space Allocate virtual space only for portion of address space actually used Reduce program image size Reduce size of page table Allow the virtual space to increase dynamically

VPN 0 1 2 3 4 5 6 7 8 9 10 11 ……..14 15 16 17 18 19 20 21 22 23 …………….28 29 30 31

Segment 1 Segment 2 Segment 3

Sparsely Populated Virtual Space: Three segments each consisting

  • f several contiguous pages
slide-2
SLIDE 2

Reducing Page Table Size: 1. Register-fenced segments

For each segment: Base and Limit registers to delimit range of valid virtual pages Page table descriptors allocated only for valid pages

BASE LIMIT 1 2 3 4 5 6 BASE 16 17 18 LIMIT BASE 28 29 30 31 LIMIT

Size of segment (Page Table for segment) can be expanded dynamically Common Scenario: Have two segments one growing from 0 to 7FFFFFFF and the other from FFFFFFFF down to 80000000 Use MSB of address to identify which segment is being accessed

Page Tables for Segment 1, 2 and 3

Page table entry with valid descriptor

slide-3
SLIDE 3

Reducing Page Table Size: 2. Two-level page tables

Partition Page Table (array of size 2n) into blocks of B = 2b entries each (usually same size as a page) First level Page Table: An entry for each block of the page table (2n-b entries) Entry i points to the ith block of the page table Second-Level Page Table: Store blocks which have at least one valid descriptor Entry j of block i has descriptor for page with VPN: i x B + j

VPN 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Example: N = 2n = 32,B = 2b = 4

B

0 1 2 3 4 5 6 7 First-Level Page Table Page Table

slide-4
SLIDE 4

Two-Level Page Tables (contd…)

0 1 2 3 4 5 6

16 17 18 28 29 30 31

X X X X

First-level Page Table 0 1 2 3 4 5 6 7 Second-level Page Table Blocks containing no valid descriptors need not be stored Only blocks with at least one descriptor are stored Accessible from the First-level Page table entry for this block

A block of the second-level Page table may be moved to disk (to save memory space), and can be indicated by a bit in the first level Page Table

Second-level Page Table

Virtual pages 8-15 and 20-28 not valid and have no second-level page tables Pages 7 and 19 not valid,and do not have a page descriptor. Wasted space within block

slide-5
SLIDE 5

3-Level Page Tables

  • `

Level 1 Level 2 Level 3 Page Offset

PTR

Offset PFN

VPN

slide-6
SLIDE 6

Reducing Page Table Size: 3. Inverted Page Tables

  • Normal page table: proportional to size of virtual memory
  • Inverted Page Table:
  • proportional to size of physical memory
  • For each page frame holds virtual page mapped to the it
  • Given VPN how do we find the PFN?
  • Linear search of inverted page table on a TLB Miss (slow)
  • Hash Table implementation
  • Find PFN or identify page fault/unmapped page with a small number of

probes