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.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds