Title: Disk Scheduling
1Disk Scheduling
- CS3450
- Chapter 11.5 - 11.6
2Memory Hierarchy
3Magnetic disk
Track
Sector
Read write head
Spindle
4Disk Performance Parameters
- Access time
- sum of seek time and rotational delay
- the time it takes to get in position to read or
write - Data transfer occurs as the sector moves under
the head - Data transfer for an entire file is faster when
the file is stored in the same cylinder and in
adjacent sectors
5Disk Scheduling Policies
- Seek time is the reason for differences in
performance - For a single disk there will be a number of I/O
requests - If requests are selected randomly, we will get
the worst possible performance
6Disk Scheduling Policies
- First-in, first-out (FIFO)
- process request sequentially
- fair to all processes
- approaches random scheduling in performance if
there are many processes
7FCFS
Illustration shows total head movement of 640
cylinders.
8Disk Scheduling Policies
- Priority
- goal is not to optimize disk use but to meet
other objectives - short batch jobs may have higher priority
- provide good interactive response time
9Disk Scheduling Policies
- Last-in, first-out
- good for transaction processing systems
- the device is given to the most recent user so
there should be little arm movement - possibility of starvation since a job may never
regain the head of the line
10Disk Scheduling Policies
- Shortest Service Time First
- select the disk I/O request that requires the
least movement of the disk arm from its current
position - always choose the minimum Seek time
11SSTF (Cont.)
12Disk Scheduling Policies
- SCAN
- arm moves in one direction only, satisfying all
outstanding requests until it reaches the last
track in that direction - direction is reversed
13SCAN (Cont.)
14Disk Scheduling Policies
- C-SCAN
- restricts scanning to one direction only
- when the last track has been visited in one
direction, the arm is returned to the opposite
end of the disk and the scan begins again
15C-SCAN (Cont.)
16Disk Scheduling Policies
- N-step-SCAN
- segments the disk request queue into subqueues of
length N - subqueues are process one at a time, using SCAN
- new requests added to other queue when queue is
processed - FSCAN
- two queues
- one queue is empty for new request
17Stable-Storage Implementation
- Write-ahead log scheme requires stable storage.
- To implement stable storage
- Replicate information on more than one
nonvolatile storage media with independent
failure modes. - Update information in a controlled manner to
ensure that we can recover the stable data after
any failure during data transfer or recovery.
18RAIDRedundant Array of Independent Disks
- Set of physical disk drives viewed by the os as a
single logical drive - Data are distributed across the physical drives
of an array - Redundant disk capacity is used to store parity
information, which guarantees data recoverability
in case of a disk failure.
19RAID 0 (non-redundant)
strip 0
strip 1
strip 2
strip 3
strip 4
strip 5
strip 6
strip 7
strip 9
strip 10
strip 11
strip 8
strip 13
strip 15
strip 12
strip 14
20Raid 0
- Characteristics/Advantages
- Implements a striped disk array, the data is
broken down into blocks and each block written to
a separate disk drive - High Transaction and transfer rate
- No parity calculation overhead
- simple design/ easy to implement
- Disadvantages
- Not a True RAID not fault tolerant
- failure of one drive will result in all data in
an array being lost - should not be used for critical environments
Recommended uses Non-critical applications
requiring high bandwidth Image Editing,
Pre-press Applications
21Data Mapping for RAID Level 0 Array
Physical Disk 0
Physical Disk 1
Physical Disk 2
Physical Disk 3
strip 0
strip 1
strip 2
strip 3
strip 4
strip 5
strip 6
strip 7
strip 8
strip 9
strip 10
strip11
strip 12
strip 13
strip 14
strip 15
22RAID 1 (mirrored)
23Raid 1Mirroring and Duplexing
- Characteristics/Advantages
- Each strip is mapped to two separate drives
(mirrored) - Read request serviced by disk with minimum seek
time - Write request can be done to both disk in
parallel. No Parity computation penalty - 100 redundancy of data
- Medium Transaction and transfer rate
- Simplest true RAID design
- Disadvantages
- COST (twice the disk space)
- High I/0 Rate if mostly read request. No
improvement for write request. - Software implementation can load the CPU/Server
degrading throughput at high activity levels
hardware implementation preferred
Recommended uses Accounting, Payroll, Any
application requiring very high availability
24RAID 2 (redundancy through Hamming code)
f2(b)
f1(b)
f0(b)
b2
b1
b0
b2
25Raid 2
- Disadvantages
- Very High ratio of ECC disk to data disk
- low transaction rate
- Only effective choice in an environment of high
disk errors. Considered overkill and not
implemented
- Characteristics/Advantages
- All member disks participate in every I/0
request. Strips are very small (work or byte) - Hamming code used to store bits across all disk
- High Transfer rate
Recommended uses Not Implemented
26RAID 3 (bit-interleaved parity)
P(b)
b2
b1
b0
b2
27Raid 3
- Disadvantages
- Only one I/0 request can be executed at a time.
- Low Transaction rates
- Characteristics/Advantages
- All member disks participate in every I/0
request. Strips are very small (work or byte) - Simple parity used to store bits across all disk
(requires only a single redundant disk.) - High Data transfer rates. Parallel transfer of
data from all data disk. Good for moving very
large sequential files in a timely manner
Recommended uses Video production, Image/video
Editing. Any application requiring very high
throughput
28RAID 4 (block-level parity)
block 0
block 1
block 2
block 3
P(0-3)
block 4
block 5
block 6
block 7
P(4-7)
block 9
block 10
block 11
block 8
P(8-11)
block 13
block 15
block 12
block 14
P(12-15)
29Raid 4
- Disadvantages
- Parity disk becomes a bottleneck for write
operations - Medium/low Data transfer Rate
- Characteristics/Advantages
- Each member disk operates independently. So
separate I/0 request can be done in parallel. - Strips are large
- Each entire block is written on a data disk.
Parity for same - High transaction rate
Recommended uses Not Implemented
30RAID 5 (block-level distributed parity)
block 0
block 1
block 2
block 3
P(0-3)
block 5
block 4
block 6
P(4-7)
block 7
block 9
block 10
block 11
P(8-11)
block 8
block 12
P(12-15)
block 13
block 14
block 15
P(16-19)
block 16
block 17
block 18
block 19
31Raid 5
- Characteristics/Advantages
- Each member disk operates independently. So
separate I/0 request can be done in parallel. - Organized as RAID 4 only RAID 5 distributes
parity strips across all disk - Avoids the bottleneck of RAID 4
- High Transaction rate
- Disadvantages
- Disk failure time consuming/difficult compared to
RAID level1 - medium/low Transfer Rates
Recommended uses High request rate,
read-intensive, data lookupInternet servers,
Database servers WWW, file , application servers
32RAID LEVELS