Disk Organization

21
Topics Covered Physical Disk Organization Example Disk Scheduling Algorithms Research Work 1 1

Transcript of Disk Organization

Page 1: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 1/21

Topics Covered

Physical Disk Organization

Example

Disk Scheduling Algorithms

Research Work

11

Page 2: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 2/21

Physical disk organization

2

Page 3: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 3/21

Physical disk organization

3

Page 4: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 4/21

Physical disk organization

To read or write, the disk head must bepositioned on the desired track and at thebeginning of the desired sector

Seek time is the time it takes to position thehead on the desired track 

Rotational delay or rotational latency isthe additional time its takes for the

beginning of the sector to reach the headonce the head is in position

Transfer time is the time for the sector to

pass under the head 4

Page 5: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 5/21

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 thefile has been stored on consecutive sectors onthe same cylinder of the disk 

5

Page 6: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 6/21

Timing of a Disk I/O Transfer

6

Page 7: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 7/21

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

Page 8: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 8/21

Disk Scheduling Algorithms

Several algorithms exist to schedule the servicing of 

I/O requests. These are

Random FIFO or FCFSPRI SSTF

SCAN C-SCAN

N-Step-SCAN FSCAN

LOOK C-LOOK 

Random  – Just a benchmark for comparison 

8

Page 9: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 9/21

PRIPriority given to requests

Scheduling largely outside of disk management controlShort batch jobs may have higher priorityThis provides good interactive response time

Disk Scheduling Algorithms

9

Page 10: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 10/21

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

Disk Scheduling Algorithms

10

Page 11: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 11/21

Disk Scheduling Algorithms

First Come First Served Scheduling or FIFO

Simplest form

Not provide Fastest Service Direction of movement from left to right

11

Page 12: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 12/21

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

Disk Scheduling Algorithms

12

Page 13: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 13/21

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

Page 14: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 14/21

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

Disk Scheduling Algorithms

14

Page 15: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 15/21

Disk Scheduling Algorithms SCAN

Arm moves in one direction only until it reachesthe last request in that direction

Then the arm reverses and repeats

Avoids starvation

Also called elevator algorithm

15

Page 16: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 16/21

SCAN Queue =55 58 39 18 90 160 150 38 184

150 160 184 90 58 55 39 38 18

Total track traversed 250

Disk Scheduling Algorithms

16

Page 17: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 17/21

Disk Scheduling Algorithms

C-SCAN (Circular SCAN)

Like SCAN, but in one direction only

Then returns arm to the opposite side andrepeats

17

Page 18: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 18/21

C-SCAN (Circular SCAN)

184

18

Queue =55 58 39 18 90 160 150 38 184

150 160 184 18 38 39 55 58 90

Total track traversed 322

Disk Scheduling Algorithms

18

Page 19: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 19/21

Divide queue into N-request segments

Use SCAN on each

New requests are added to the rear of the queueto form a new N-request segment

Reduces maximum waiting time in a high-

volume situation Causes head to move more frequently from one

cylinder to the next

N-step-SCAN

Disk Scheduling Algorithms

19

Page 20: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 20/21

Disk Scheduling Algorithms FSCAN Like N-step-SCAN but with two queues

One queue fills while the other is processed

using SCANLOOK

Version of Scan

C-LOOK Version of C-SCAN

20

Page 21: Disk Organization

8/2/2019 Disk Organization

http://slidepdf.com/reader/full/disk-organization 21/21

Disk Scheduling Algorithms

21