Can swap-in be improved?
Posted Jul 25, 2007 23:00 UTC (Wed) by Blaisorblade
In reply to: Can swap-in be improved?
Parent article: On-demand readahead
> A lot of it is reading in memory mapped program files. Speeding that up
> isn't as easy.
Surely swap prefetch won't help here, indeed. But good readahead would.
About swapping, the reason it's old is that, as Rik van Riel (and another
reader below) puts it, systems are slower than ages ago. Would you swap
out firefox, ever? Or X?
> Furthermore, if Linux is stealing a page that was accessed quite
> recently, it ought to steal them all and then wait a while before
> swapping them all back in again and swapping out somebody else.
Well, the swap token was introduced by Rik van Riel to implement something
similar, based on a research paper. Actually it's mostly a mean to prevent
thrashing (which can be what you describe, depending on the times
involved). It didn't work at first and was disabled, but now it should
have been fixed; a new variation of the algorithm was implemented in
7602bdf2fd14a40dd9b104e516fdc05e1bd17952 (in 2.6.20-rc1). LWN described it
well, see Kernel Page Index for more details.
to post comments)