disk management
play

Disk Management Disk Structure Disk Scheduling RAID Disk Block - PDF document

CPSC 410 / 611 : Operating Systems Disk Management Disk Management Disk Structure Disk Scheduling RAID Disk Block Management Modern Secondary Storage Technologies Disk Management Disk Structure Disk Scheduling RAID


  1. CPSC 410 / 611 : Operating Systems Disk Management Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies 1

  2. CPSC 410 / 611 : Operating Systems Disk Management Disk Structure sector cylinder track Disk speed: • seek time : head moves to correct track • rotational delay : wait until sector is under head • transfer time : transfer data between disk and memory Disk Performance Seek Time : T s n = number of tracks traversed T m n s = × + S m = “ track traversal time ” s = startup time 1 Rotational Delay (Latency Time): T R T = R 2 r r = # revolutions per time unit b Transfer Time : T T T T = rN b = # bytes to be transferred N = number of bytes on track Disk Access Time : T = T + T + T S R T 2

  3. CPSC 410 / 611 : Operating Systems Disk Management Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies Disk Scheduling application application kernel file system device driver disk queue Q: Does it pay off to think about scheduling policy in disk queue? Evaluation: Compare time for service for given request sequence. Distinguish only by cylinder. 3

  4. CPSC 410 / 611 : Operating Systems Disk Management FCFS Scheduling Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67 0 24 49 74 99 124 149 174 199 total head movement: 640 tracks FCFS Pros: FCFS Cons: – simple – poor average service time – fair Shortest-Seek-Time-First (SSTF) Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67 0 24 49 74 99 124 149 174 199 total head movement: 236 tracks Always serve “closest” request. SSTF Pros: SSTF Cons: – short service times – Starvation! 4

  5. CPSC 410 / 611 : Operating Systems Disk Management Elevator Algorithm (SCAN) Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67 0 24 49 74 99 124 149 174 199 total head movement: 236 tracks Continuously scan disk from one SCAN Cons: end to the other. – When scanning, few requests after us, since just past through. – Problem: When we change direction SCAN Pros: at end, requests there are very – short service times new. Circular SCAN (C-SCAN) Request Sequence: 98, 183, 37, 122, 14, 124, 65, 67 0 24 49 74 99 124 149 174 199 Reduce variance in service time by always starting at the beginning of the disk. 5

  6. CPSC 410 / 611 : Operating Systems Disk Management LOOK, C-LOOK 0 24 49 74 99 124 149 174 199 Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies 6

  7. CPSC 410 / 611 : Operating Systems Disk Management RAID Observation: Traditional secondary storage devices are slow! Improve their performance by using multiple devices in parallel: RAID – Redundant Arrays of Independent Disks – Redundant Arrays of Inexpensive Disks (Berkeley) Common characteristics: – Array of physical disks that are visible as single device to OS. – Data is distributed across physical drives of array. – Redundant disk capacity is used for error detection/correction. RAID (cont) Approach: Replace single large-capacity disk with array of smaller- capacity disks. Benefits: – Improved I/O performance – Enables incremental upgrade Problems: – Reliability : more devices increase the probability of failure. - λ t R ( t ) = P [ t > t ] e . g . R ( t ) = e F ∞ MTTF = E [ t ] = R ( t ) dt ∫ F 0 Solution: redundancy 7

  8. CPSC 410 / 611 : Operating Systems Disk Management Raid (cont 2) Raid = Striping + Redundancy block-level bit-level bit-level striping blocks block block-level striping RAID Level 0 “ Block-level Striped Set without Parity ” blocks block-level striping 8

  9. CPSC 410 / 611 : Operating Systems Disk Management RAID Level 1 “ Mirrored Set without Parity ” • Problem: – cost (100% redundancy) mirrors • Performance – READs : good (with multithreading and “ split reads ” ) – WRITEs: small performance penalty. RAID Level 2 “ Memory-Style Error-Correcting Parity ” block • Head and spindles synchronized • Small strips • Error correction code calculated over bits of data disks. (Hamming Code) • Appropriate for systems with many failures. • Typically not implemented. 9

  10. CPSC 410 / 611 : Operating Systems Disk Management RAID Level 3 “ Bit-Interleaved Parity ” block S 0 S 1 • Heads and spindles synchronized. S 2 • Small strips. S 3 • Simple parity bits instead of ECC. S 4 e . g . P ( S ) = S = S ⊕ S ⊕ S ⊕ S 4 3 2 1 0 parity Disk 1 fails: S = S ⊕ S ⊕ S ⊕ S 1 4 3 2 0 RAID Level 4 “ Block level Parity ” block • Same as RAID 3, but with block- level striping. • No synchronization across disks. • Large strips. • Each strip on parity disk contains parity information for all corresponding strips. • Parity computation upon READ: X 4 ( i ) = X 3 ( i ) ⊕ X 2 ( i ) ⊕ X 1 ( i ) ⊕ X 0 ( i ) X 4 ' ( i ) = X 3 ( i ) ⊕ X 2 ( i ) ⊕ X 1 ' ( i ) ⊕ X 0 ( i ) = X 3 ( i ) ⊕ X 2 ( i ) ⊕ X 1 ' ( i ) ⊕ X 0 ( i ) ⊕ X 1 ( i ) ⊕ X 1 ( i ) = X 4 ( i ) ⊕ X 1 ( i ) ⊕ X 1 ' ( i ) 10

  11. CPSC 410 / 611 : Operating Systems Disk Management RAID Level 5 “ Striped Set with Interleaved Parity ” block • Same as RAID 4, but parity spread across all disks. • No synchronization across disks. • Large strips. RAID Level 6 “ Striped Set with Dual Interleaved Parity ” block • Same as RAID 5, but uses 2 bits to store “ parity ” . • No synchronization across disks. • Large strips. • Uses ECC instead of parity. • Tolerates two failures. • In practice, a second drive can fail during recovery from first drive failure. 11

  12. CPSC 410 / 611 : Operating Systems Disk Management Nested Levels: RAID Level 1+0 = RAID 10 Raid 10 = “ Mirrored Set in a Striped Set ” Raid 10 Raid 1 Raid 0 blocks Raid 1 block-level striping Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies 12

  13. CPSC 410 / 611 : Operating Systems Disk Management Disk Formatting • Bare disk : • Physical formatting : • “ cut ” into sectors • identify sectors • add space for error detection/correction 1 ecc 2 ecc 3 ecc 4 ecc 5 ecc X ecc • Logical formatting : • add blank directory, FAT, free space list, ... 1 FAT 2 DIR 3 DIR 4 F/L 5 ... X Framing • Character count • Starting and ending chars, with character stuffing character count DLE STX a b DLE DLE c DLE ETX 5 1 2 3 4 8 1 2 3 4 5 6 7 2 1 stuffed DLE • Starting and ending flags, with bit • Physical layer coding violations stuffing framing pattern: 01111110 binary Manchester 011011111 0 11111 0 11111 0 10010 stuffed bits lack of transition 13

  14. CPSC 410 / 611 : Operating Systems Disk Management Bad Block Management • One or more blocks become unreadable/unwriteable: bad blocks • Off-line management of bad blocks: – Run bad-block detection program and put bad blocks on bad- block list. (Either remove them from free list or mark entry in FAT.) – May have to run file recovery utility. • On-line management: – Have the device driver map the bad block onto a good block – Block X goes bad. Whenever OS requests block X , the disk transparently accesses a replacement block Y . – Problem: interferes with scheduling! Disk Management • Disk Structure • Disk Scheduling • RAID • Disk Block Management • Modern Secondary Storage Technologies 14

  15. CPSC 410 / 611 : Operating Systems Disk Management NAND Flash Memory • Flash chips are arranged in 8kB blocks. • Each block is divided into 512B pages. • Flash memory does not support “ overwrite ” operations. • Only supports a limited number of “ erase ” operations. • This is handled in the Flash Translation Layer (FTL) Flash Translation Layer (FTL) 15

  16. CPSC 410 / 611 : Operating Systems Disk Management Performance Comparison: IOPS Performance Comparison: Throughput 16

  17. CPSC 410 / 611 : Operating Systems Disk Management Performance Comparison: Latency Intel 3D XPoint (Optane) 17

  18. CPSC 410 / 611 : Operating Systems Disk Management Optane (cont) 18

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend