0% found this document useful (0 votes)
14 views

Disk Scheduling Algorithm and RAID

Uploaded by

syed.12682
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Disk Scheduling Algorithm and RAID

Uploaded by

syed.12682
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Disk Scheduling Algorithm

• Types of disk arm scheduling algorithms:

1. FCSC (First come first serve)


2. SSTF (Shorted seek time first)
3. SCAN (Elevator)
4. C-SCAN
5. LOOK
6. C-LOOK
FCFS
• FCFS is the simplest of all the Disk Scheduling
Algorithms. In FCFS, the requests are
addressed in the order they arrive in the disk
queue.Let us understand this with the help of an
example.
Example: Suppose the order of request is-
(82,170,43,140,24,16,190) And current position of
Read/Write head is : 50
Solution
Total seek time:
=(82-50)+(170-82)+(170-43)+(140-43)+(140- Advantages:
24)+(24-16)+(190-16) Every request gets a fair chance
=642 No indefinite postponement
Total no of tracks movement/ Head movement:
=(170-50)+(170-43)+(140-16)+(190-16) Disadvantages:
Does not try to optimize seek time
May not provide the best possible service
SSTF
In SSTF (Shortest Seek Time First), requests
having shortest seek time are executed first. So,
the seek time of every request is calculated in
advance in the queue and then they are scheduled
according to their calculated seek time. As a result,
the request near the disk arm will get executed
first. SSTF is certainly an improvement over FCFS
Total no of tracks movement/ Head movement:
as it decreases the average response time and
=(50-16)+(190-16)
increases the throughput of system.Let us
=
understand this with the help of an example.
Example: Suppose the order of request is- Advantages:
(82,170,43,140,24,16,190) And current position of Average Response Time decreases
Read/Write head is : 50 Throughput increases
• Solution: Disadvantages:
• Total seek time: Overhead to calculate seek time in advance
Can cause Starvation for a request if it has higher seek time as
• =(50-43)+(43-24)+(24-16)+(82-16)+(140- compared to incoming requests
82)+(170-40)+(190-170) High variance of response time as SSTF favours only some requests
• =208
SCAN(Elevator)
• In SCAN algorithm the disk arm moves into a
particular direction and services the requests
coming in its path and after reaching the end of
disk, it reverses its direction and again services
the request arriving in its path. So, this
algorithm works as an elevator and hence also
known as elevator algorithm. As a result, the
requests at the midrange are serviced more and Total no of tracks movement/ Head movement:
those arriving behind the disk arm will have to =(199-50)+(199-16)
wait. =
Example: Suppose the requests to be addressed Advantages:
are-82,170,43,142,24,16,190. And the Read/Write High throughput
arm is at 50, and it is also given that the disk arm Low variance of response time
should move “towards the larger value”. Average response time
Solution:
the seek time is calculated as: Disadvantages:
=(199-50)+(199-16) Long waiting time for requests for locations just
visited by disk arm
=332
CSCAN
• In SCAN algorithm, the disk arm again scans the
path that has been scanned, after reversing its
direction. So, it may be possible that too many
requests are waiting at the other end or there may be
zero or few requests pending at the scanned area.
• These situations are avoided in CSCAN algorithm in
which the disk arm instead of reversing its direction
goes to the other end of the disk and starts servicing
the requests from there. So, the disk arm moves in a
circular fashion and this algorithm is also similar to
SCAN algorithm and hence it is known as C-SCAN
(Circular SCAN).

Example: Suppose the requests to be addressed are-


82,170,43,142,24,16,190. And the Read/Write arm is at
50, and it is also given that the disk arm should move Total no of tracks movement/ Head movement:
“towards the larger value”.
=(199-50)+(199-0)+(43-0)
Solution: =
• Seek time is calculated as: Advantages:
• =(199-50)+(199-0)+(43-0) Provides more uniform wait time compared to SCAN
• =391
LOOK
• It is similar to the SCAN disk scheduling
algorithm except for the difference that the disk
arm in spite of going to the end of the disk goes
only to the last request to be serviced in front of
the head and then reverses its direction from
there only. Thus it prevents the extra delay
which occurred due to unnecessary traversal to
the end of the disk.
Example: Suppose the requests to be addressed
are-82,170,43,140,24,16,190. And the Read/Write
arm is at 50, and it is also given that the disk arm
should move “towards the larger value”.
• Solution
• seek time is calculated as:
Total no of tracks movement/ Head movement:
• =(190-50)+(190-16) =(190-50)+(190-16)
• =314 =314
CLOOK
• As LOOK is similar to SCAN algorithm, in
similar way, CLOOK is similar to CSCAN disk
scheduling algorithm. In CLOOK, the disk arm
in spite of going to the end goes only to the last
request to be serviced in front of the head and
then from there goes to the other end’s last
request. Thus, it also prevents the extra delay
which occurred due to unnecessary traversal to
the end of the disk.
• Example:
• Suppose the requests to be addressed are-
82,170,43,140,24,16,190. And the Read/Write
arm is at 50, and it is also given that the disk
arm should move “towards the larger value”
• Solution:
• the seek time is calculated as:
• =(190-50)+(190-16)+(43-16)
• =341
Practice Question
• Suppose a disk has 201 cylinders, numbered • Consider an operating system capable of
from 0 to 200. At some time the disk arm is at loading and executing a single sequential user
cylinder 100, and there is a queue of disk process at a time. The disk head scheduling
access requests for cylinders 30, 85, 90, 100, algorithm used is First Come First Served
105, 110, 135 and 145. If Shortest-Seek Time (FCFS). If FCFS is replaced by Shortest Seek
First (SSTF) is being used for scheduling the Time First (SSTF), claimed by the vendor to
disk access, the request for cylinder 90 is give 50% better benchmark results, what is the
serviced after servicing ____________ number expected improvement in the I/O performance
of requests. of user programs?

Suppose the following disk request sequence (track numbers) for a disk
with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that
the initial position of the R/W head is on track 50. The additional
distance that will be traversed by the R/W head when the Shortest Seek
Time First (SSTF) algorithm is used compared to the SCAN (Elevator)
algorithm (assuming that SCAN algorithm moves towards 100 when it
starts execution) is _________ tracks
RAID
• RAID – multiple disk drives provides reliability via
redundancy

• All RAID have the property that the data are distributed over drives, to allow parallel operation.

• RAID is arranged into six different levels


RAID (Cont.)
• Several improvements in disk-use techniques involve the use
of multiple disks working cooperatively

• Disk striping uses a group of disks as one storage unit

• RAID schemes improve performance and improve the reliability of


the storage system by storing redundant data

– Mirroring or shadowing (RAID 1) keeps duplicate of each disk

– Striped mirrors (RAID 1+0) or mirrored stripes


(RAID 0+1) provides high performance and high reliability

– Block interleaved parity (RAID 4, 5, 6) uses


much less
redundancy
RAID Levels

Prepared By: Kaushik Vaghani


Note :Raid 2,3,4 is out dated not in use
even parity =0
odd parity 1
Conclusion
• Raid 0 Data stripping
• Raid 1 Data mirroring
• Raid 2 Bit level Data stripping + Parity
• Raid 3 Byte level Data stripping + Parity
• Raid 4 Block level Data stripping + Parity
• Raid 5 Block level Distributed Parity Bit
• Raid 6 Block level Double Distributed Parity Bit
• Raid 10 Hybrid

You might also like