problems page table size
play

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


  1. 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 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 Sparsely Populated Virtual Space: Three segments each consisting of several contiguous pages 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

  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 16 28 BASE BASE BASE 0 17 29 1 18 30 LIMIT 2 LIMIT 31 3 4 Page Tables for Segment 1, 2 and 3 5 Page table entry with valid descriptor LIMIT 6 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

  3. Reducing Page Table Size: 2. Two-level page tables Partition Page Table (array of size 2 n ) into blocks of B = 2 b entries each (usually same size as a page) First level Page Table: An entry for each block of the page table (2 n-b entries) Entry i points to the i th 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 B 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 Page Table First-Level Page Table Example: N = 2 n = 32,B = 2 b = 4 0 1 2 3 4 5 6 7

  4. Two-Level Page Tables (contd…) 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 0 1 2 3 4 5 6 16 17 18 28 29 30 31 Virtual pages 8-15 and 20-28 not valid X X X X and have no second-level page tables Pages 7 and 19 not valid,and do not have First-level Page Table 0 1 2 3 4 5 6 7 a page descriptor. Wasted space within block

  5. 3-Level Page Tables VPN • ` Level 1 Level 2 Level 3 Page Offset PTR PFN Offset

  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

Recommend


More recommend