Memory Management
1
Disclaimer: some slides are adopted from book authors’ slides with permission
Memory Management Disclaimer: some slides are adopted from book - - PowerPoint PPT Presentation
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Multi-level paging Instead of a single big table, many smaller tables Save space Demand paging Memory is dynamically
1
Disclaimer: some slides are adopted from book authors’ slides with permission
2
3
4
5
6
7
8
Process A Process B Process C Physical Memory
Disk TLB Page Table
9
10
11
12
13
14
15
16
17
18
19
Page Frame No V M R P 20 bits 2 1 1 1
1 Used recently. Clear the bit and go to Step 1 0 Not used recently. Selected victim. End.
20
21
1 reference=0; counter=0 0 counter++; if counter =N then found victim, otherwise repeat Step 1.
22
– Service the interrupt – hundreds of cpu cycles – Read/write the page from/to disk – lots of time – Restart the process – again just a small amount of time
– if p = 0 no page faults – if p = 1, every reference is a fault
23
= (1 – p) x 200 + p x 8,000,000 = 200 + p x 7,999,800
EAT = 8.2 microseconds. This is a slowdown by a factor of 40!!
– 220 > 200 + 7,999,800 x p 20 > 7,999,800 x p – p < .0000025 – < one page fault in every 400,000 memory accesses
24
25
Bash text Physical memory Bash #1 Bash #2
26
27
28
29
parent child
30
parent child
31
Page Frame No V M R P 20 bits 2 1 1 1
32
parent child RO RO RO Page tbl RO RO RO Page tbl
33
parent child RO RO RW Page tbl RO RO RO Page tbl