Mass Storage Structure, Operating System

advertisement
Topic:
Mass Storage Structure
Disk Structure
Disk Attachment
Disk Scheduling
Group Members:
Malik Adil Shahzad (FA16-BCS-5B-063)
Sheharyar Ahmad (FA16-BCS-5B-053)
Mass Storage Structure: Hard Drives
•
Each Platter has a flat circular shape like a CD or DVD.
•
Generally the diameter ranges from 1.8” to 5.25”
•
Transfer rates: is rate at which data flow between drive and computer.
•
Seek Time: Time required to move Read/Write head on the desired track.
•
Rational Latency: Time the disk rotates to reach desired location.
•
Positioning time (Random-Access Time): Seek Time + Rational Latency
•
Head Crash: Result from disk head making contact with disk surface.
•
Disks can be removable
•
Drive attached to computer via I/O bus
•
Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI,
SAS, Firewire.
•
Host controller in computer uses bus to talk to disk controller built into
drive or storage array
Diagram:
Hard Drives:
•
Performance
•
Transfer Rate – theoretical – 6 Gb/sec
•
Effective Transfer Rate – real – 1Gb/sec
•
Seek time from 3ms to 12ms – 9ms common for desktop drives
•
Average seek time measured or calculated based on 1/3 of tracks
•
Latency based on spindle speed
•
1 / (RPM / 60) = 60 / RPM
•
Average latency = ½ latency
•
Access Latency = Average access time = average seek time + average latency
•
Average I/O time = average access time + (amount to transfer / transfer rate) +
controller overhead
•
For example to transfer a 4KB block on a 7200 RPM disk with a 5ms average
seek time, 1Gb/sec transfer rate with a .1ms controller overhead
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
Storage Arrays
•
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
•
Shared storage -> more efficiency
•
Features found in some file systems
•
Snaphots, clones, thin provisioning, replication, deduplication, etc
Network-Attached Storage
•
Network-attached storage (NAS) is storage made available over a network rather than
over a local connection (such as a bus)
•
Remotely attaching to file systems
•
NFS and CIFS are common protocols
•
Implemented via remote procedure calls (RPCs) between host and storage over
typically TCP or UDP on IP network
•
iSCSI protocol uses IP network to carry the SCSI protocol
Storage Area Network
•
SAN is one or more storage arrays
•
Connected to one or more Fibre Channel switches
•
Hosts also attach to the switches
•
Easy to add or remove storage, add new host and allocate it storage
•
•
Over low-latency Fibre Channel fabric
Why have separate storage networks and communications networks?
•
Consider iSCSI, FCOE
Disk Scheduling:
•
It is operating system responsibility to is to use the hardware efficiently. For
the disk drives, meeting this responsibility entails having,
•
Fast access times.
•
Large disk bandwith.
•
Minimizing seek time.
•
Disk Scheduling algorithms are used to schedule requests.
•
Read/Write requests are placed in the queue which are than scheduled.
FCFS Scheduling:
•
Simplest disk scheduling algorithm.
•
Request are entertained in the order they arrive (enter disk queue).
•
Advantages:
•
•
Easy to understand and implement.
•
No starvation.
•
Can be used with less load.
Disadvantages:
•
Requires more seek time
•
More waiting time and response time
•
Inefficient
FCFS Scheduling:
SSTF Scheduling:
•
Shortest Seek Time First Scheduling Services the request which is closest to
the read/write head.
•
Tie is broken in the direction of the head movement.
•
Advantages:
•
•
Very efficient in seek moves.
•
Less average response time and waiting time.
•
Increased throughput
Disadvantages:
•
Overhead to find out closest request.
•
Request which are far from the head will starve.
•
High variance in response time and waiting time.
SSTF Scheduling:
SCAN Scheduling:
Head starts at one end of the disk and moves towards the other end, servicing
requests in between. When it reaches other end the direction of the head is
reversed and process continues. Head continuously scans back and forth across the
disk.
•
•
Advantages:
•
simple easy to understand and implement
•
no starvation but bounded waiting
•
low variance and average waiting time
Disadvantages:
•
long waiting time or just for just visited by head
•
unnecessary move till the end of the disk even if there is no request
SCAN Scheduling:
C-SCAN Scheduling:
Head starts at one end of the disk and moves towards the other end, servicing
requests in between, when it reaches the other end the direction of the head is
reversed and head reaches first end without satisfying any request.
•
•
Advantages:
•
Provide waiting uniform waiting time
•
Better response time
Disadvantages:
•
More seek moments compared to simple scan
C-SCAN Scheduling:
LOOK Scheduling:
It is same as SCAN algorithm but instead of going till the last track we go till the
last request, and then change direction.
•
•
Advantages:
•
Better performance compared to SCAN
•
Should be used in case of less lode
Disadvantages:
•
Overhead to find the last request
•
Should not use when the load is more
•
Long waiting time or just for just visited by head
C-LOOK Scheduling:
•
It takes the advantages of both C-SCAN and LOOK algorithm.
•
It will satisfy request only in one direction.
•
It will go till last request and return without satisfying request in the opposite
direction.
•
Advantages:
•
•
More uniform waiting time compared to look
•
More efficient (less moves) compare to c scan
Disadvantages:
•
More overhead in calculations
•
Should not be used in case of more load
C-LOOK Scheduling:
Any Questions?
Download