5 ms·
If you keep many accesses in flight simultaneously, you give the OS the chance to reorder your operations to minimize seek times. This is one of the reasons why
by rbanffy 6y ago
If you keep many accesses in flight simultaneously, you give the OS the chance to reorder your operations to minimize seek times. This is one of the reasons why async disk IO is cool. Even on an SSD, if you group your accesses, you’ll end up reading a flash block only once for all files that live on it, and the same will happen with writing.
- dataflow 6y agoIs this one of those things that hypothetically could happen in the future or are there kernels that actually do this right now?
- wiml 6y agoReordering disk io requests to minimize seek time and rotational latency has been a standard OS behavior since the 1970s, at least. Whether it's still effective in an SSD+io_uring world I don't know but I'm curious.
- astrange 6y agoIf you can issue multiple requests at once then they can go into the SSD controller's queues where it can reorder them, so it is beneficial. As usual with parallelism, it's hard to find if you look for it bottom-up, so running multiple processes is a better way to take advantage of it.
- doctor_eval 6y agoI learned about “elevator algorithms” in CS in the early 90s, well before Linux was a thing... I think it was common even then.
- tinus_hn 6y agoDoesn’t the kernel read a whole flash block regardless of how small a part you request? Seems like the smart thing to do.
- fulafel 6y agoFlash block size generally affects only writing (and things related to that happen on the on-device FTL, not in the kernel, except for embedded raw flash devices that require specialized filesystems). There is a general readahead in Linux though, see eg blkdev(8). For many use cases the small randomish iops rate is the bottleneck (think database index), and because of the small latencies in flash storage you often want to keep the readahead modest absent some detected pattern of sequential io.