A quick look at secondary storage and file systems.
Objectives
Notes
- I will do a whirlwind tour of Chapters 11 - 15.
- Hardware
- Hard Disk Drives (HDD)
- Old
- Mechanical
- Slow and big.
- Transfer rate - tens to hundreds of MB/sec
- positioning time, seek time, rotational latency , milliseconds
- Head crash.
- Read blue box bottom of 451.
- Nonvolatile Memory (NVM)
- new
- MUCH faster
- Becoming larger and cheaper.
- Subject to limitations of rewrite.
- Which appears to actually be erase then write.
- Which makes write slower than read.
- Lifetime is measured in Drive Writes per Day.
- Take a look at This page.
- 1 SDWPD (100% 128KB sequential writes) : Easiest test, overwrite the entire drive with sequential writes.
- 1 RDWPD (100% 16KB random writes): More stressful, write large random blocks.
- 0.25 RDWPD (100% 4KB random writes): Most stressful, write little random blocks.
- These critters cost around $4k (30TB ssd).
- RAM drives
- Treat a large chunk of NVRAM as a device by adding a file system.
- Much faster than SSD
- But temporary
- HDD Scheduling
- It is likely that there are multiple I/O requests occur at nearly the same time.
- The drive is most likely only able to schedule one of these at a time.
- These are placed in a queue
- So the OS is responsible for scheduling which one occurs
- Our old friend FCFS is easiest
- But could have the device seeking all over the place (HDD)
- SCAN
- HDD algorithm
- Start at one end of the disk,
- Service the requests in order of how they line up in the scan.
- Then scan on the way back.
- Start over again.
- This is called the elevator algorithm
- C-SCAN
- Scan but with fly-back.
- This makes wait time more uniform.
- The book says there are many other algorithms.
- Old Linux
- Processes are more likely to block on read then write.
- Linux implements a queue for each.
- Then C-SCAN is used.
- Requests are sent in batches.
- And queue selection is modified to prevent starvation.
- New(er) linux
- Three queues (rt, normal, batch)
- There can be starvation
- Anticipates a process' need based on historic data and prioritizes heavy I/O processes to minimize seek time.
- There may be newer, but I did not look.
- NVM Scheduling
- No moving parts, so this is different.
- And the NVM devices have their own practices at a lower level to prevent burn-out.
- This is a very short section, I bet they are working on/have better algorithms now.
- A quick google search suggests FCFS