Sie sind auf Seite 1von 21

Topics Covered

Physical Disk Organization Example Disk Scheduling Algorithms Research Work

11

Physical disk organization

Physical disk organization

Physical disk organization

To read or write, the disk head must be positioned on the desired track and at the beginning of the desired sector Seek time is the time it takes to position the head on the desired track Rotational delay or rotational latency is the additional time its takes for the beginning of the sector to reach the head once the head is in position Transfer time is the time for the sector to pass under the head 4

Physical disk organization

Access time = seek time + rotational latency + transfer time Efficiency of a sequence of disk accesses strongly depends on the order of the requests Adjacent requests on the same track avoid additional seek and rotational latency times Loading a file as a unit is efficient when the file has been stored on consecutive sectors on the same cylinder of the disk
5

Timing of a Disk I/O Transfer

Example: Two single-sector disk requests

Assume -- average seek time = 10 ms -- average rotational latency = 3 ms -- transfer time for 1 sector = 0.01875 ms Adjacent sectors on same track -- access time = 10 + 3 + 2*(0.01875) ms = 13.0375 ms Random sectors -- access time = 2*(10 + 3 + 0.01875) ms = 26.0375 ms
7

Disk Scheduling Algorithms


Several algorithms exist to schedule the servicing of I/O requests. These are Random FIFO or FCFS PRI SSTF SCAN C-SCAN N-Step-SCAN FSCAN LOOK C-LOOK Random Just a benchmark for comparison
8

Disk Scheduling Algorithms


PRI Priority given to requests Scheduling largely outside of disk management control Short batch jobs may have higher priority This provides good interactive response time

Disk Scheduling Algorithms


Evaluating the policies
To evaluate the policies, we will use a random sequence of track accesses Head starting at100 55 58 39 18 90 160 150 38 184

Calculate how many track traversal each policy will require to finish the sequence
10

Disk Scheduling Algorithms


First Come First Served Scheduling or FIFO

Simplest form Not provide Fastest Service Direction of movement from left to right

11

Disk Scheduling Algorithms


FIFO : process requests in the order they arrive
Queue =55 58 39 18 90 160 150 38 184 Head start at 100 Total track traversed 498

12

Disk Scheduling Algorithms


The Shortest Service Time First (SSTF)

Service all the requests close to the current head position From requests currently in the queue, choose the request that minimizes movement of the arm (read/write head) May cause starvation

13

Disk Scheduling Algorithms


The Shortest Service Time First (SSTF)
Queue =55 58 39 18 90 160 150 38 184
90 58 55 39 38 18 150 160 184 Total track traversed 248

14

Disk Scheduling Algorithms


SCAN
Arm

moves in one direction only until it reaches the last request in that direction Then the arm reverses and repeats Avoids starvation Also called elevator algorithm

15

Disk Scheduling Algorithms


SCAN Queue =55 58 39 18 90 160 150 38 184
150 160 184 90 58 55 39 38 18 Total track traversed 250

16

Disk Scheduling Algorithms


C-SCAN (Circular SCAN)
Like

SCAN, but in one direction only Then returns arm to the opposite side and repeats

17

Disk Scheduling Algorithms


C-SCAN (Circular SCAN)
Queue =55 58 39 18 90 160 150 38 184 150 160 184 18 38 39 55 58 90 Total track traversed 322

18

184
18

Disk Scheduling Algorithms


N-step-SCAN
Divide

queue into N-request segments Use SCAN on each New requests are added to the rear of the queue to form a new N-request segment Reduces maximum waiting time in a highvolume situation Causes head to move more frequently from one cylinder to the next
19

Disk Scheduling Algorithms


FSCAN Like N-step-SCAN but with two queues One queue fills while the other is processed using SCAN LOOK Version of Scan

C-LOOK

Version of C-SCAN

20

Disk Scheduling Algorithms

21

Das könnte Ihnen auch gefallen