Module 4 Disk Scheduling
Module 4 Disk Scheduling
1956
IBM RAMDAC computer
included the IBM Model 350
disk storage system
5M (7 bit) characters
50 x 24” platters
Access time = < 1 second
Solid-State Disks
Nonvolatile memory used like a hard drive
Many technology variations
Can be more reliable than HDDs
More expensive per MB
Maybe have shorter life span
Less capacity
But much faster
Busses can be too slow -> connect directly to PCI for example
No moving parts, so no seek time or rotational latency
Magnetic Tape
Was early secondary-storage medium
Evolved from open spools to cartridges
Relatively permanent and holds large quantities of data
Access time slow
Random access ~1000 times slower than disk
Mainly used for backup, storage of infrequently-used data,
transfer medium between systems
Kept in spool and wound or rewound past read-write head
Once data under head, transfer rates comparable to disk
140MB/sec and greater
200GB to 1.5TB typical storage
Common technologies are LTO-{3,4,5} and T10000
Disk Structure
Disk drives are addressed as large 1-dimensional arrays of logical
blocks, where the logical block is the smallest unit of transfer
Low-level formatting creates logical blocks on physical media
The 1-dimensional array of logical blocks is mapped into the sectors
of the disk sequentially
Sector 0 is the first sector of the first track on the outermost
cylinder
Mapping proceeds in order through that track, then the rest of
the tracks in that cylinder, and then through the rest of the
cylinders from outermost to innermost
Logical to physical address should be easy
Except for bad sectors
Non-constant # of sectors per track via constant angular
velocity
Disk Attachment
Host-attached storage accessed through I/O ports talking to I/O
busses
SCSI itself is a bus, up to 16 devices on one cable, SCSI initiator
requests operation and SCSI targets perform tasks
Each target can have up to 8 logical units (disks attached to
device controller)
FC is high-speed serial architecture
Can be switched fabric with 24-bit address space – the basis of
storage area networks (SANs) in which many hosts attach to
many storage units
I/O directed to bus ID, device ID, logical unit (LUN)
Storage Array
Can just attach disks, or arrays of disks
Storage Array has controller(s), provides features to attached
host(s)
Ports to connect hosts to array
Memory, controlling software (sometimes NVRAM, etc)
A few to thousands of disks
RAID, hot spares, hot swap (discussed later)
Shared storage -> more efficiency
Features found in some file systems
Snaphots, clones, thin provisioning, replication,
deduplication, etc
Storage Area Network
• Seek Time: The data may be stored on various blocks of disk. To access these
data according to the request, the disk arm moves and finds the required
block. The time taken by the arm in doing this search is known as "Seek Time".
• Transfer Time: When a request is made from the user side, it takes some time
to fetch these data and provide them as output. This taken time is known as
"Transfer Time".
Disk Scheduling
• Disk Access Time: It is defined as the total time taken by all the above
processes. Disk access time = (seek time + rotational latency time + transfer
time)
• Disk Response Time: The disk processes one request at a single time. So, the
other requests wait in a queue to finish the ongoing process of request. The
average of this waiting time is called "Disk Response Time".
The request that comes first will be processed first and so on. The requests
coming to the disk are arranged in a proper sequence as they arrive. Since every
request is processed in this algorithm, so there is no chance of 'starvation'.
•Advantages:
• Implementation is easy.
• No chance of starvation.
•Disadvantages:
• 'Seek time' increases.
• Not so efficient.
82,170,43,140,24,16,190
FCFS
• The disk arm starts at one end of the disk, and moves toward the
other end, servicing requests until it gets to the other end of the
disk, where the head movement is reversed and servicing continues.
• SCAN algorithm Sometimes called the elevator algorithm
• Illustration shows total head movement of 236 cylinders
• But note that if requests are uniformly dense, largest density at
other end of disk and those wait the longest
(199−50)+(199−0)+(43−0)=391
LOOK
• The disk arm moves to the 'last request' present and services them.
• After reaching the last requests, it reverses its direction and again comes back
to the starting point.
• It goes to the end of requests.
Example a disk having 200 tracks (0-199). The request
sequence(82,170,43,140,24,16,190) are shown in the given figure and the head
position is at 50
LOOK
(190−50)+(190−16)+(43−16)=341
Selecting a Disk-Scheduling Algorithm
SSTF is common and has a natural appeal
SCAN and C-SCAN perform better for systems that place a heavy load on the
disk
Less starvation
Performance depends on the number and types of requests
Requests for disk service can be influenced by the file-allocation method
And metadata layout
The disk-scheduling algorithm should be written as a separate module of
the operating system, allowing it to be replaced with a different algorithm if
necessary
Either SSTF or LOOK is a reasonable choice for the default algorithm
What about rotational latency?
Difficult for OS to calculate
How does disk-based queueing effect OS queue ordering efforts?