Hacker News new | ask | show | jobs
by throwaway_pdp09 2076 days 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

1 comments

Generally the OS should see if you’re doing a long sequential access and prefetch this data before you access it.