Disk Drive Operations Storage Access Methods
Total Page:16
File Type:pdf, Size:1020Kb
Disk Drive Operations Storage Access Methods Lecture 2 September 19, 2006 NEU csg389 Information Storage Technologies, Fall 2006 Plan for today • Questions from last time • On-disk data organization • what they’re all about • Storage access methods • Block-based access • File-based access • Object-based access NEU csg389 Fall 2006, Jiri Schindler 2 Disk Drive Firmware Algorithms NEU csg389 Information Storage Technologies, Fall 2006 Outline • Mapping LBNs to physical sectors • zones • defect management • track and cylinder skew • Bus and buffer management • optimizing storage subsystem resources • Advanced buffer space usage • prefetching and caching • read/write-on-arrival NEU csg389 Fall 2006, Jiri Schindler 4 How functionality is implemented • Some of it is in ASIC logic • error detection and correction • signal/servo processing • motor/seek control • cache hits (often) • Some of it is in firmware running on control processor • request processing • request queueing and scheduling • LBN-to-PBN mapping • Key considerations: cost and performance and cost • optimize common cases • keep things simple and space-conscious NEU csg389 Fall 2006, Jiri Schindler 5 Recall the storage device interface • Linear address space of equal-sized blocks • each identified by logical block number (LBN) … 5 6 7 12 23 … • Common block size: 512 bytes • Number of blocks: device capacity / block size NEU csg389 Fall 2006, Jiri Schindler 6 Recall the physical disk storage reality Cylinder Track Sector NEU csg389 Fall 2006, Jiri Schindler 7 Physical sectors of a single-surface disk NEU csg389 Fall 2006, Jiri Schindler 8 LBN-to-physical for a single-surface disk 4 5 16 17 3 6 15 28 29 18 27 30 40 41 7 2 14 39 42 19 26 38 43 31 37 25 44 32 13 1 36 45 20 8 4 46 24 33 12 35 34 21 9 0 23 22 11 10 NEU csg389 Fall 2006, Jiri Schindler 9 Extending mapping to a multi-surface disk NEU csg389 Fall 2006, Jiri Schindler 10 Some real numbers for modern disks • # of platters: 1-4 • 2-8 surfaces for data • # of tracks per surface: 10s of 1000s • same thing as # of cylinders • # sectors per track: 500-900 • so, 250-450KB • # of bytes per sector: usually 512 • can be chosen by OS for some disks • disk manufactures want to make it bigger NEU csg389 Fall 2006, Jiri Schindler 11 Clarification of Cylinder Numbering NEU csg389 Fall 2006, Jiri Schindler 12 First Complication: Zones • Outer tracks are longer than inner ones • so, they can hold more data • benefits: increased capacity and higher bandwidth • Issues • increased bookkeeping for LBN-to-physical mapping • more complex signal processing logic – because of variable bit rate timing • Compromise: zones • all tracks in each zone hold same number of sectors NEU csg389 Fall 2006, Jiri Schindler 13 Constant number of sectors per track NEU csg389 Fall 2006, Jiri Schindler 14 Multiple “zones” NEU csg389 Fall 2006, Jiri Schindler 15 A real zone breakdown • IBM Ultrastar 18ES (1998) Zone Start cylinder End cylinder SPT 0 0 377 390 1 378 1263 374 2 1264 2247 364 3 2248 3466 351 4 3466 4504 338 5 4505 5526 325 6 5527 7044 312 7 7045 8761 286 8 8762 9815 273 9 9816 10682 260 10 10683 11473 247 NEU csg389 Fall 2006, Jiri Schindler 16 Second Complication: Defects • Portions of the media can become unusable • both before installation and during use – former is MUCH more common than latter • Need to set aside physical space as spares • simplicity dictates having no holes in LBN space • many different organizations of spare space – e.g., sectors per track, cylinder, group of cylinders, zone • Two schemes for using spare space to handle defects • remapping – leave everything else alone and just remap the disturbed LBNs • slipping – change mapping to skip over defective regions NEU csg389 Fall 2006, Jiri Schindler 17 One spare sector per track 4 5 15 16 3 6 14 26 27 17 25 28 37 38 7 2 13 36 39 18 24 35 40 29 34 23 41 30 12 1 33 42 19 8 43 22 31 11 32 20 0 22 9 10 NEU csg389 Fall 2006, Jiri Schindler 18 Remapping from defective sector to spare 4 5 15 16 3 6 14 26 27 17 28 37 38 7 2 13 36 39 18 24 35 40 29 34 23 41 30 12 1 33 42 19 8 43 22 31 11 25 32 20 0 22 9 10 NEU csg389 Fall 2006, Jiri Schindler 19 LBN mapping slipped past defective sector 4 5 15 16 3 6 14 25 26 17 27 37 38 7 2 13 36 39 18 24 35 40 28 34 23 41 29 12 1 33 42 19 8 43 22 30 11 32 31 20 0 22 9 10 NEU csg389 Fall 2006, Jiri Schindler 20 Some Real Defect Management Schemes • High level facts • percentage of space: < 1% • always slip if possible – much more efficient for streaming data • One real scheme: Seagate Cheetah 4LP • 108 spare sectors every 12 cylinders – located on the last track of the 12-cylinder group – used only for remapped sectors grown during usage • many spare sectors on innermost cylinders – used to provide backstop for all slipped sectors NEU csg389 Fall 2006, Jiri Schindler 21 Computing physical location from LBN • First, check list of remapped LBNs • usually identifies exact physical location of replacement • If no match, do the steps from before • but, also account for slipped sectors that affect desired LBN • About 10 different management schemes • For any given scheme, the computations can be fairly straightforward. However, it is quite complex to discuss them all at once concretely NEU csg389 Fall 2006, Jiri Schindler 22 When defects “grow” during operation • First, try ECC • it can recover from many problems • Next, try to read the sector again • often, failure to read the sector is transient • cost is a full rotation added to access time • Last resort, report failure and remap sector • this means that the stored data has been lost • until next write to this LBN, reads get error response – new data allows the location change to take effect NEU csg389 Fall 2006, Jiri Schindler 23 Error Recovery Algorithm for READs READ SELECTOR typically tries 3 times ECC COMPARE NO RETRY YES ECC SYMBOL OR NO RETRY RETRY THRESHOLD LIMIT SECTOR REACHED? REACHED? READ NO YES REPLACE BLOCK ERROR NO INCREASE OR SIGNAL HOST TO RECOVERY LEVELS ERROR RECOVERY PERFORM EXHAUSTED? REPLACEMENT LEVEL YES DELIVER SIGNAL DATA TO DATA ERROR HOST TO HOST NEU csg389 Fall 2006, Jiri Schindler 24 Third Complication: Skew • Switching from one track to another takes time • sequential transfers would suffer full rotation • Solution: skew • offset physical location of first sector to avoid extra rotation – selection of skew value made from switch time statistics • Track skew • for when switching to next surface within a cylinder • Cylinder skew • for when switching from last surface of one cylinder to first surface of next cylinder NEU csg389 Fall 2006, Jiri Schindler 25 What happens to requests that span tracks? 1 2 11 0 0 1 0 13 14 3 10 23 12 1 11 12 13 2 12 25 26 15 22 35 24 13 23 24 25 14 24 27 34 25 35 26 11 4 9 2 10 3 23 35 28 16 21 33 26 14 22 34 27 15 34 29 32 27 33 28 10 22 17 5 8 20 15 3 9 21 16 4 33 30 31 28 32 29 21 32 31 18 19 30 29 16 20 31 30 17 9 20 19 6 7 18 17 4 8 19 18 5 8 7 6 5 7 6 Request spans 2 tracks After reading first part After track switch NEU csg389 Fall 2006, Jiri Schindler 26 What happens to requests that span tracks? 1 2 11 0 0 1 0 13 14 3 10 23 12 1 11 12 13 2 12 25 26 15 22 35 24 13 23 24 25 14 24 27 34 25 35 26 11 4 9 2 10 3 23 35 28 16 21 33 26 14 22 34 27 15 34 29 32 27 33 28 10 22 17 5 8 20 15 3 9 21 16 4 33 30 31 28 32 29 21 32 31 18 19 30 29 16 20 31 30 17 9 20 19 6 7 18 17 4 8 19 18 5 8 7 6 5 7 6 Request spans 2 tracks After reading first part After track switch Sector 12 rotates past during track switch, so full rotation needed NEU csg389 Fall 2006, Jiri Schindler 27 Same request with track skew of one sector 1 2 11 0 0 1 0 12 13 3 10 22 23 1 11 23 12 2 23 35 24 14 21 33 34 12 22 34 35 13 34 25 32 35 33 24 11 4 9 2 10 3 22 33 26 15 20 31 24 13 21 32 25 14 32 27 30 25 31 26 10 21 16 5 8 19 14 3 9 20 15 4 31 28 29 26 30 27 20 30 29 17 18 28 27 15 19 29 28 16 9 19 18 6 7 17 16 4 8 18 17 5 8 7 6 5 7 6 Request spans 2 tracks After reading first part After track switch Track skew prevents unnecessary rotation NEU csg389 Fall 2006, Jiri Schindler 28 Examples of Track and Cylinder Skews Quantum IBM Atlas 10k Ultrastar 18ES S ke Z w o n SPT Track Cylinder SPT Track Cylinder e 1 334 64 101 390 58 102 2 324 62 98 374 56 97 3 306 56 93 364 55 95 NEU csg389 Fall 2006, Jiri Schindler 29 Computing Physical Location from LBN Figure out cylno, surfaceno, and sectno • using algorithms indicated previously Compute total skew for first mapped physical sector on this track • totalskew = (cylno * cylskew) + (surfaceno + (cylno * (surfaces-1)) * trackskew) Compute rotational offset on given track • offset = (totalskew + sectno) % sectspertrack NEU csg389 Fall 2006, Jiri Schindler 30 Basic On-disk Caching NEU csg389 Information Storage Technologies, Fall 2006 On-disk RAM • RAM on disk drive controllers sector • firmware • speed matching buffer • prefetching buffer one $ segment • cache • Canonical disk drive buffers • several fixed-size “segments” • latest thing: variable-size segments • down the road: OS style management NEU csg389 Fall 2006, Jiri Schindler 32 Prefetching and Caching • Prefetching • sequential prefetch essentially free until next request arrives – and until track boundary • Note: physically sequential sectors are prefetched – usefulness depends on access patterns • Example algorithms – prefetch until buffer is full or next request arrives – MIN and MAX values for prefetching – if track n-1 and n have been READ, prefetch track n+1 • Caching • data in buffer segments retained as cache • most of the benefit comes from prefetching NEU csg389 Fall