Storage Devices - cs.cornell.edu
Transcript of Storage Devices - cs.cornell.edu
![Page 1: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/1.jpg)
CS 4410 Operating Systems
Storage Devices
Summer 2016
Cornell University
![Page 2: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/2.jpg)
Today
• Devices that can persistently store data.
• Magnetic disk
• Flash storage
2
![Page 3: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/3.jpg)
3
Magnetic Disks: Then
![Page 4: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/4.jpg)
4
Magnetic Disks: Now
![Page 5: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/5.jpg)
5
Magnetic Disk: Internal
![Page 6: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/6.jpg)
Disk Speed
• To read from disk, we must specify: – cylinder number, track number, sector number.
• disk access time = seek time + rotation time + transfer time – seek time: the time to move the disk arm to the desired track
– rotation time: the time for the desired sector to rotate to the disk head.
– transfer time: the time for the desired data to flow between the drive and the computer.
6
![Page 7: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/7.jpg)
Disk Scheduling
• Disk access involves moving mechanical parts, such as arm and platter.
• So, disk access is expensive (milliseconds), – comparing to memory access (nanoseconds).
• The disk should be used efficiently. – as few movements as possible when serving a
sequence of requests.
• Goal : small access time and large bandwidth. • The OS may employ a disk scheduling algorithm
to achieve the above target.
7
![Page 8: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/8.jpg)
8
FCFS ● Consider a disk queue with requests for I/O to blocks on cylinders:
– 98, 183, 37, 122, 14, 124, 65, 67
● The disk head is initially at cylinder 53.
● Total head movement of 640 cylinders
![Page 9: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/9.jpg)
SSTF • Selects request with minimum seek time from current head position.
• Total head movement of 236 cylinders.
9
![Page 10: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/10.jpg)
SCAN
● The disk arm starts at one end of the disk.
● Moves toward the other end, servicing requests. ● Head movement is reversed when it gets to the other end of disk.
10
![Page 11: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/11.jpg)
11
C-SCAN
● The head moves from one end of the disk to the other.
● Servicing requests as it goes.
● When it reaches the other end it immediately returns to the beginning of the disk.
● Provides a more uniform wait time than SCAN.
![Page 12: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/12.jpg)
12
C-LOOK
● Arm only goes as far as last request in each direction. ● Then reverses direction immediately.
![Page 13: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/13.jpg)
Flash storage (memory)
• Solid state storage. • No moving parts. • Better random IO performance than disks. • Less power consumption. • Less vulnerable to physical damage. • Used in:
– thumb drives (USBs), – smart phones, – machine room servers, – laptop computers …
• But, more expensive (per byte) than disks.
13
![Page 14: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/14.jpg)
Flash storage
• NOR flash storage allows individual words (e.g., 4 bytes) to be written and read.
– Used for storing device firmware, since it can be executed in place.
• NAND flash storage allows reads and writes of a page (2-4 KB).
14
![Page 15: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/15.jpg)
Accessing a NAND flash storage
• Erase blocks
– Before writing, flash memory should be erased in blocks.
– Slow process
• Write page
• Read page
15
![Page 16: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/16.jpg)
Today
• Devices that can persistently store data.
• Disk
– Scheduling requests
• Flash storage
16
![Page 17: Storage Devices - cs.cornell.edu](https://reader034.fdocuments.in/reader034/viewer/2022052301/628917b74377976097789627/html5/thumbnails/17.jpg)
Coming up…
• Next lecture: RAID
• HW4:
– ex 1, 2, 3, 4
– Due on Tuesday
• Next exam on Thursday
17