Boot Camp Session 1: Module: COS 122 Author: Mr. Werner Hauger
Boot Camp Session 1: Module: COS 122 Author: Mr. Werner Hauger
Boot Camp Session 1: Module: COS 122 Author: Mr. Werner Hauger
I/O Techniques
No Interrupts Use of Interrupts
Disk Cylinder
COS 122 November 4, 2019 6
Disk Performance
• Seek time
– Time required for the head to reach the
appropriate track
• Rotational delay
– Time required for the beginning of the
appropriate sector to reach the head
• Access time = seek + rotational delay
• Transfer time
– Time required to transfer requested data
– T = b/(r*N); b -> # bytes to transfer; r ->
rotation speed (rps); N -> # bytes on a track
COS 122 November 4, 2019 7
Exercise 1 – Disk Performance
• Consider the following fixed sector disk: 512
bytes/sector, with 128 sectors/track, 110
tracks per surface, and 8 usable surfaces.
Assume that the disk rotates at 3600 rpm
and has an average seek time of 6ms.
a) What is the average rotational delay (ard) of this
disk?
b) What is the average access time of this disk?
c) What is the transfer time to read 1 MB (1048576
bytes) of data stored sequentially from this disk
(ignore ard)?
d) What is the total time required to read 1 MB of
data from this disk?
75
100
125
150
175
199
(a) FIFO Time
0 COS 122 November 4, 2019 10
25
SSTF Algorithm
0
25
75
25
50
track number
75
100
125
150
175
199
(b) SSTF Time
0 COS 122 November 4, 2019 11
25
r
SCAN (no LOOK) Algorithm
• Known as the elevator algorithm
• Arm moves in one direction only
– satisfies all outstanding requests until
it reaches the last track in that
direction (0 or max); then the direction
is reversed
tra
150
175
C-SCAN Algorithm
199
(b) SSTF Time
0
25
• Improvement of the previous algorithm
track number
50
75
• Restricts scanning to one direction only
100
– satisfies all outstanding requests until there are no
125
150
more requests in that direction; then arm is returned
175
199
to the opposite end of the disk and scan begins
again at first I/O request
(c) SCANin same direction Time
0
25
track number
50
75
100
125
150
175
199
(d) C-SCAN Time
COS 122 November 4, 2019 15
Figure 11.7 Comparison of Disk Scheduling Algorithms (see Table 11.3)
Exercise 2 – Disk Scheduling
• Consider a disk drive with 200 tracks, numbered
0 to 199. The request queue has the following
composition:
176, 79, 34, 60, 92, 11, 41, 114
• The current head position is track 50 and the
previous I/O request was served at 40. Compute
the total and average distance (in tracks) that
the disk arm would move using the following
algorithms:
a) FIFO
b) SSTF
c) SCAN
d) C-SCAN
COS 122 November 4, 2019 16
RAID Levels
• Redundant Array of Independent
Disks
• Seven levels: 0 to 6
• 3 common design characteristics:
– Set of physical disks seen as single
logical drive by the OS
– Data is distributed across the physical
disks as strips => striping
– Redundant capacity is used to store
parity information to guarantee
recoverability in case of disk failure
RAID Level 2
(a) RAID 0 (non-redundant)
•stripParallel
0 strip 1
access
strip 2
with smallstripdata
strip 3 0
strips
strip 1 strip 2
•stripHamming
4 strip 5 Code
strip 6 forstripbit
7 error
strip 4correction
strip 5 strip 6
strip 8 strip 9 strip 10 strip 11 strip 8 strip 9 strip 10
•stripMultiple
12 strip 13 parity
strip 14disksstripe.g.
15 HC(7,4)
strip 12 =13 3 disks
strip strip 14
b0 b1 b2 b3 P(b)
RAID Level 5
block 0 block 1 block 2 block 3 P(0-3)
block 4 block 5 block 6 block 7 P(4-7)
• Distributed
block 8
parity block
block 9 block 10 block 11 P(8-11)
• Round-robin
block 12 block allocation
13 block 14 block 15 P(12-15)
RAID Level 6
block 0 block 1 block 2 block 3 P(0-3)
block 4 block 5 block 6 P(4-7) block 7
• block
2 8parityblockblocks
9
on different
P(8-11) block 10
disks
block 11
•block
Adv:
12 Extreme
P(12-15) high
block 13 data
block 14availability
block 15
– 3 or more
P(16-19) block 16 block 17
disk failuresblock
= 18data block
loss 19
Good Luck!
COS 122 November 4, 2019 27