Presentation is loading. Please wait.

Presentation is loading. Please wait.

W4118 Operating Systems Instructor: Junfeng Yang.

Similar presentations


Presentation on theme: "W4118 Operating Systems Instructor: Junfeng Yang."— Presentation transcript:

1 W4118 Operating Systems Instructor: Junfeng Yang

2 Disk  Goal  Learn how disks work  This knowledge will help us better understand tradeoffs in file systems  Disk Structure  Disk Interface  Disk Overhead  Disk Technology Trends  Redundant Arrays of Inexpensive Disks (RAID) 1

3 Moving-head Disk Structure

4 Disk Interface  Disk drives addressed as one-dimension of logical sectors  The logical sector is the smallest unit of transfer  This array is mapped sequentially onto disk sectors  Logical sector 0 is the 1 st sector of 1 st track of the outermost cylinder  Logical sector address incremented within track, then within tracks of cylinder, then across cylinders, from outermost to innermost  Precisely reverse-engineer this mapping in OS is difficult  Disk transparently remap defective sectors  Number of sectors per track is not a constant 3

5 Disk Overheads  To read from disk, disk controller computes cylinder #, surface #, sector #  Latency includes:  Seek time: to get to the track  Latency time: to get to the sector (rotation delay)  Transfer time: get bits off the disk Track Sector Seek Time Rotation Delay

6 Sequential v.s. Random  Overhead of sequential access  Seek to the right track  Rotate to the right sector  Transfer  Overhead of random access of the same amount of data  Seek to the right track  Rotate to the right sector  Transfer  Repeat  Since seek and rotate are slow, sequential access is much faster than random access 5

7 Modern Disk Parameters Barracuda 180Cheetah X15 36LP Capacity181GB36.7GB Disk/Heads12/244/8 Cylinders24,24718,479 Sectors/track~609~485 Speed7200 RPM15000 RPM Rotational latency (ms)4.172.0 Avg seek (ms)7.43.6 Track-2-track(ms)0.80.3

8 Disk Technology Trends  Data  More dense  More bits per square inch  Disk head closer to surface  Create smaller disk with same capacity  Disk geometry  smaller  Spin faster  Increase bandwidth, reduce rotational delay  Faster seek  Lighter weight  Disk price  cheaper  Density improving more than speed (mechanical limitations) 7

9 RAID Motivation  Performance  disks are slow compared to CPU  Disk speed improves slowly compared to CPU  Reliability  In single disk systems, one disk failure  data loss  Cost  A single fast, reliable disk is expensive 8

10 RAID Idea  RAID idea: use redundancy to improve performance and reliability  Redundant array of cheap disks as one storage unit  Fast: simultaneous read and write disks in the array  Reliable: use parity to detect and correct errors  RAID can have different redundancy levels, achieving different performance and reliability  Seven different RAID levels (0-6) 9

11 Evaluating RAID  Performance  Large Read  Large Write  Large Read-Modify-Write  Small Read  Small Write  Small Read-Modify-Write  Reliability  Tolerance of disk failures  Cost  Storage utilization: data capacity / total capacity 10

12 RAID 0: Non-redundant Striping  Structure  Data striped across all disks in an array  No parity  Advantages:  Good performance: with N disks, speed up N times  Disadvantages:  Poor reliability: one disk failure  data loss 11

13 RAID 1: Mirroring  Structure  Keep a mirrored (shadow) copy of data  Advantages  Good reliability: one disk failure OK  Good read performance  Disadvantage  High cost: one data disk requires one parity disk 12

14 RAID2: Error-Correction Parity  Structure  A data sector striped across data disks  Compute error-correcting parity and store in parity disks  Advantages  Good reliability with higher storage utilization than mirroring  Disadvantages  Cost still high  Poor small read, write, read-modify-write performance E.g., to read a data sector, must read a sector from each disk 13 parity disks

15 RAID3: Bit-Interleaved Parity  Structure  Each data sector striped across data disks  One parity disk (XOR of each stripe of a data sector)  Advantages  Same reliability with one disk failure as RAID2 since disk controller can determine what disk fails  High storage utilization  Disadvantages  Poor small read, write, read-modify-write performance 14

16 RAID4: Block-Interleaved Parity  Structure  A set of data sectors (parity group) striped across data disks  One parity disk (XOR of data sectors)  Advantages  Same reliability as RAID3 since disk controller can detect if sector is correct  Good small read performance  Disadvantages  Poor small write and read-modify-write performance All writes must write parity  parity disk is bottleneck 15 P

17 RAID5: Block-Interleaved Distributed Parity  Structure  Same as RAID4 except no single parity disk  Parity sectors distributed across all disks  Advantages  Good performance Good Small write and read-modify-write performance  Disadvantages  Only tolerate one disk failure 16 P P P P

18 RAID6: P+Q Redundancy  Structure  Same as RAID 5 except using two parity sectors per parity group  Advantages  Can tolerate two disk failures 17 P Q PQ PQ Q P

19 RAID Levels

20 New Mass Storage Technologies  Disk speed limited by mechanical parts  Seek and rotational delays  New memory-based mass storage technologies solve this problem  NAND Flash  Battery-backed DRAM (NVRAM)  Disadvantages  Price: still more expensive than same capacity disk  Reliability: more likely to lose data 19


Download ppt "W4118 Operating Systems Instructor: Junfeng Yang."

Similar presentations


Ads by Google