Os PPT Disk Sheduling 22
Os PPT Disk Sheduling 22
head
tail Disk
First-In, First-Out (FIFO)
Do accesses in the order in which they are presented to
the disk
This is very fair to processes
This is very simple to implement
Approximates random accesses to disk
gives rated, average latency for every read
will have large average seeks between each access
Not a good policy
FIFO
•Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20
20 2 22 12 9 6 3 18 21 9 12 2 14 12 2 33 35 30 5
tail head
35 13 22 1 21 1 20 6 14 2 12 3 9 7 2 1 3 2 5
tail head
Similar to SSTF
One major difference
next job scheduled is closest to current job but in one
particular direction
all jobs in other direction are put at the end of the list
Similar to an elevator
it goes up first and then comes back down
Elevator Algorithm
•Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20
2 1 3 32 35 13 22 1 21 1 20 6 14 2 12 3 9 4 5
tail head
Avoids starvation
Provides very good performance
Still has one major issue
FAIRNESS
Jobs in the middle of the disk get serviced twice as
much as jobs at the ends
One-Way Elevator Algorithm
Exactly like elevator algorithm except scheduling is done
in only one direction
for example, elevator always goes “up”
This will require one long seek after finished going up
have to go back to the beginning
This is okay because one long seek doesn’t take very
long
IBM disk: 15 ms from one end to the other
This long seek is done infrequently
One-Way Elevator Algorithm
•Reference String: 5, 35, 2, 14, 12, 21, 3, 9, 22, 20
3 1 2 33 35 13 22 1 21 1 20 6 14 2 12 3 9 4 5
tail head