VM - Space Sharing

less than 1 minute read

Segmentation

use base and bound to know if the address is out of range

find free block policy: best fit and worst fit, sometimes worst fit is better because best fit makes a lot of small pieces which are unable to use.

space management: merge small pieces of free space into a big one.

Paging

Linear paging

addr_trans

  • use VPN(virtual page number) and offset to indicate PTE(page table entry)
  • use page table to find page and actual content

Linear paging is too slow, so we use TLB as cache of address translation.

Another problem is that page table is relatively big, so we use multilevel paging.

Multilevel Paging

multi_pg_tbl

use a extra page table directory as an index of linear page table.

pg_dir_index


Page Fault

content is not in memory but in disk.