4 ms·
General question: if mmap pulls in data as you ask it and not before, you're going to have CPU waits on the disk, followed by processing on the CPU but no disk
by throwaway_pdp09 6y ago
General question: if mmap pulls in data as you ask it and not before, you're going to have CPU waits on the disk, followed by processing on the CPU but no disk activity, alternating back and forth. I'd assume that to be optimal is to have them both working at once, so to have some kind of readahead request for the disk. How is this done, if at all?
Edit: just seen this which kind of touches on the same https://news.ycombinator.com/item?id=24737186 https://news.ycombinator.com/item?id=24737186
- saagarjha 6y agoGenerally the OS should see if you’re doing a long sequential access and prefetch this data before you access it.