You are on page 1of 21

Operating Systems

AICT004-3-2

Secondary Storage Disk


Scheduling
Diploma in Computing and IT
Level 1

Prepared by: ANI First Prepared on: 13-12-04 Last Modified on: 23-06-2008
Quality checked by: MNI
Copyright 2008 Asia Pacific Institute of Information Technology
Topic & Structure of the lesson
Secondary Storage Disk Sche

secondary storage

disk scheduling

Operating Systems Slide 2 of 21


Learning Outcomes
Secondary Storage Disk Sche

At the end of this lecture YOU should be able


to:

- explain the function of disk scheduling

- describe how disk scheduling algorithms


work

Operating Systems Slide 3 of 21


Key Terms you must be able to u
Secondary Storage Disk Sche

If you have mastered this topic, you should be able


to use the following terms correctly in your
assignments and exams:

first come first serve


shortest seek time
SCAN

Operating Systems Slide 4 of 21


Secondary Storage
Secondary Storage Disk Sche

is the lowest level of a file system

progression from magnetic tapes to disks


magnetic tapes access time is slow compared to
disk

tapes are now used for storage and backup of


infrequently used data

Operating Systems Slide 5 of 21


Disk Secondary Storage
Secondary Storage Disk Sche

one dimensional layer array of logical blocks

mapped onto sectors; sector 0 the first sector


of the first
track on the outermost cylinder

Operating Systems Slide 6 of 21


Disk Scheduling
Secondary Storage Disk Sche
it is the operating systems responsibility to use
hardware
efficiently

criteria for disk drivers


- fast access time
- increase disk bandwidth

access time
- seek time time for the disk arm to move
to the
head of the cylinder containing the desired
sector

Operating Systems
- rotational latency additional time waiting Slide 7 of 21
Disk Scheduling
Secondary Storage Disk Sche
disk bandwidth

- total number of bytes transferred divided


by the
total time between the first request for
service to
the computation of the last transfer

How do we improve access time and bandwidth?

- scheduling the services of disk I/O requests


in a
good order
Operating Systems Slide 8 of 21
Disk Scheduling
Secondary Storage Disk Sche
when a process needs I/O to or from the disk,
system
calls are issued to the operating system

if the disk is available, the request is serviced

if the disk is busy, the request will be placed on a


queue

Operating Systems Slide 9 of 21


Disk Scheduling Algorithms
Secondary Storage Disk Sche

First Come First Serve

Shortest Seek Time First

SCAN

C-SCAN

LOOK

C-LOOK

Operating Systems Slide 10 of 21


First Come First Serve
Secondary Storage Disk Sche

simplest algorithm

fair

it does not provide the fastest service

as request arrive they are placed on the queue


and are
satisfied in the order of arrival

Operating Systems Slide 11 of 21


First Come First
Serve Secondary Storage Disk Sche
0 14 37 53 6567 98 122124 183 199

queue = 98,183,37,122,14,124,65,67
head starts at 53
Operating Systems Slide 12 of 21
Shortest Seek Time First
Secondary Storage Disk Sche

services first requests closest to the current head


position

minimizes seek time

requests can arrive at any time, requests


furthest from
the head will need to wait before getting serviced

Operating Systems Slide 13 of 21


Shortest Seek Time
First Secondary Storage Disk Sche
0 14 37 53 6567 98 122124 183 199

queue = 98,183,37,122,14,124,65,67
head starts at 53
Operating Systems Slide 14 of 21
SCAN
Secondary Storage Disk Sche

disk starts at one end and moves towards the


other end

head reverses and moves back

when moving back, it serves requests

scans back and forth

if a request arrives just in front of the head it will


get
serviced first, however a request which arrives
just after
the back of the head, the request will need to
Operating Systems Slide 15 of 21
SCAN
Secondary Storage Disk Sche
0 14 37 53 6567 98 122124 183 199

queue = 98,183,37,122,14,124,65,67
head starts at 53
Operating Systems Slide 16 of 21
Quick Review Questions
Secondary Storage Disk Sche

Name the three disk scheduling algorithms discussed t

Which disk scheduling algorithm is also known as the


elevator syndrome?

Operating Systems Slide 17 of 21


Follow Up Assignment
Secondary Storage Disk Sche

What are the aims of disk scheduling algorithms

Operating Systems Slide 18 of 21


Summary of Main Teaching Points
Secondary Storage Disk Sche

Disk scheduling algorithms aim to reduce seek


time and rotational latency while increasing
bandwidth.

First come first serve services request in the


order that they arrive.

Shortest seek time first services request closest


to the current head position.

SCAN services request by starting from the head


position and moves to the end of the disk, then
reverses and moves towards the other end.
Operating Systems Slide 19 of 21
Question and Answer Session
Secondary Storage Disk Sche

Q&A

Operating Systems Slide 20 of 21


Next Session
Secondary Storage Disk Sche

Disk Scheduling Algorithms

Operating Systems Slide 21 of 21

You might also like