devices / fjlesystems (start)
1
devices / fjlesystems (start) 1 last time practical LRU - - PowerPoint PPT Presentation
devices / fjlesystems (start) 1 last time practical LRU approximations second chance SEQ: active/inactive list CLOCK algorithms generally (scanning accessed bits) being proactive writeback in advance readahead maintaining little list of
1
2
3
4
5
6
7
8
9
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
10
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
10
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
10
11
12
13
13
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
14
r = reading location, w = writing location
15
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
16
17
17
18
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
19
20
20
read/write/… system call or page cache miss/eviction…
(e.g. previous keypresses to keyboard)
21
22
23
23
23
23
23
24
25
25
25
26
27
27
27
28
29
30
31
(this example: 0x9000 (physical))
32
(this example: 0x9000 (physical))
32
(this example: 0x9000 (physical))
32
(this example: 0x9000 (physical))
32
(this example: 0x9000 (physical))
32
33
33
34
34
34
35
read() 8KB start wait for device (driver ‘top half’) run B while A waits copy from device (driver ‘bottom half’) mark A ready run scheduler switch to A (kernel) copy fjrst 8KB (resume driver ‘top half’) return from read() syscall read() syscall copy 4KB from bufger (driver ‘top half’) return from read() syscall user mode (running A) user mode (running B) kernel mode depends — does scheduler run A right away?
36
read() 8KB start wait for device (driver ‘top half’) run B while A waits copy from device (driver ‘bottom half’) mark A ready run scheduler switch to A (kernel) copy fjrst 8KB (resume driver ‘top half’) return from read() syscall read() syscall copy 4KB from bufger (driver ‘top half’) return from read() syscall user mode (running A) user mode (running B) kernel mode depends — does scheduler run A right away?
36
read() 8KB start wait for device (driver ‘top half’) run B while A waits copy from device (driver ‘bottom half’) mark A ready run scheduler switch to A (kernel) copy fjrst 8KB (resume driver ‘top half’) return from read() syscall read() syscall copy 4KB from bufger (driver ‘top half’) return from read() syscall user mode (running A) user mode (running B) kernel mode depends — does scheduler run A right away?
36
read() 8KB start wait for device (driver ‘top half’) run B while A waits copy from device (driver ‘bottom half’) mark A ready run scheduler switch to A (kernel) copy fjrst 8KB (resume driver ‘top half’) return from read() syscall read() syscall copy 4KB from bufger (driver ‘top half’) return from read() syscall user mode (running A) user mode (running B) kernel mode depends — does scheduler run A right away?
37
read() 8KB start wait for device (driver ‘top half’) run B while A waits copy from device (driver ‘bottom half’) mark A ready run scheduler switch to A (kernel) copy fjrst 8KB (resume driver ‘top half’) return from read() syscall read() syscall copy 4KB from bufger (driver ‘top half’) return from read() syscall user mode (running A) user mode (running B) kernel mode depends — does scheduler run A right away?
37
38
39
40
41
(fjgure adapted from Bloomfjeld’s CS 2150 slides)
42
43
44
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 32 33 34 35
45
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 32 33 34 35
45
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 32 33 34 35
example.txt 46
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 32 33 34 35
example.txt 46
47
48
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 32 33 34 35
block 0 block 1 block 2 block 3 block 0 block 1 block 2
49
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 32 33 34 35
block 0 block 1 block 2 block 3 block 0 block 1 block 2
49
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 32 33 34 35
block 0 block 1 block 2 block 3 block 0 block 1 block 2
49
50
51
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 32 33 34 35 10
dir pt 0 dir pt 1
index.html pt 0 index.html pt 1 index.html pt 2 index.html pt 3
(bytes 0-4095 of index.html) (bytes 4096-8191 of index.html) (bytes 8192-12287 of index.html) (bytes 12278-12792 of index.html) (unused bytes 12792-16384)
52
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 32 33 34 35 10
dir pt 0 dir pt 1
index.html pt 0 index.html pt 1 index.html pt 2 index.html pt 3
(bytes 0-4095 of index.html) (bytes 4096-8191 of index.html) (bytes 8192-12287 of index.html) (bytes 12278-12792 of index.html) (unused bytes 12792-16384)
52
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 32 33 34 35 10
dir pt 0 dir pt 1
index.html pt 0 index.html pt 1 index.html pt 2 index.html pt 3
(bytes 0-4095 of index.html) (bytes 4096-8191 of index.html) (bytes 8192-12287 of index.html) (bytes 12278-12792 of index.html) (unused bytes 12792-16384)
52
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 32 33 34 35 10
dir pt 0 dir pt 1
index.html pt 0 index.html pt 1 index.html pt 2 index.html pt 3
(bytes 0-4095 of index.html) (bytes 4096-8191 of index.html) (bytes 8192-12287 of index.html) (bytes 12278-12792 of index.html) (unused bytes 12792-16384)
52
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
(2010-03-29 04:05:03.56)
(2010-03-29)
(2010-03-22 12:23:12)
last write con’t
(0x156 bytes)
53
54
55
55
55
55
56
57
58
59
60
61
62