Linked by Thom Holwerda on Sun 5th Aug 2007 21:15 UTC, submitted by irbis
Linux "It has been almost two years since LWN covered the swap prefetch patch. This work, done by Con Kolivas, is based on the idea that if a system is idle, and it has pushed user data out to swap, perhaps it should spend a little time speculatively fetching that swapped data back into any free memory that might be sitting around. Then, when some application wants that memory in the future, it will already be available and the time-consuming process of fetching it from disk can be avoided. There is a vocal set of users out there who will attest that swap prefetch has made their systems work better. Even so, the swap prefetch patch has languished in the -mm tree for almost all of those two years with no path to the mainline in sight. Con has given up on the patch (and on kernel development in general). It is an unfortunate thing when a talented and well-meaning developer runs afoul of the kernel development process and walks away. So it is worth the trouble to try to understand what went wrong."
Permalink for comment 261110
To read all comments associated with this story, please click here.
RE[4]: swap prefetch?
by tsedlmeyer on Mon 6th Aug 2007 03:06 UTC in reply to "RE[3]: swap prefetch? "
tsedlmeyer
Member since:
2005-07-07

What does swap_prefetch do that's different? Instead of waiting on the user to try and interact with Firefox before copying data from the swap to RAM, it slowly over time copies in the data as soon as free RAM is available. Again, this isn't complicated, and no additional heuristics are needed since the VM system already knows how to copy data from swap to RAM.


To continue your example. You click on Firefox and because there are no heuristics implemented the memory which was prefetched did not include that needed by Firefox. Now in order to switch to Firefox the memory which was just read in now has to be swapped back out in order to make room to read in the memory segments needed by Firefox.

Reply Parent Score: 2