Can swap-in be improved?
Posted May 24, 2007 7:44 UTC (Thu) by mgb
Parent article: On-demand readahead
The place where readahead is really needed is when swapping in a long-idle application.
Anyone with a modest desktop will have experienced the problem of switching back to an application that has sat idle for half an hour. The drive thrashes away for minutes as apparently individual pages are faulted in. This often takes much longer than starting the application from scratch.
I wonder if the kernel could detect this situation, perhaps by noticing an unusually high sustained rate of reads from the swap file for a given process, and try temporarily reading some larger number of contiguous pages instead of one.
There are undoubtedly corner cases where this would make things worse but I suspect that overall something like this would be a considerable improvement.
to post comments)