> What I wanted to say is that if there is free memory it should be filled with
> the pages that were in use before the memory got rare. And these are the pages
> swapped out last.
Not necessarily. Memory isn't merely used to hold swappable stuff, it also
caches files. Consider a small but io-intensive program. The stuff
you want isn't necessarily the last swap (perhaps there
even isn't anything swapped out) , it might be the last thing
dropped from cache instead.
And we can often predict better than "the last thing swapped/flushed"
A bunch of free memory appearing could usually be better used for
extra read-ahead, wether it is read-ahead of files/directories/bitmaps
being accessed, or executable code faulted in from executables or
swap devices.
> The other swapped out pages are swapped out even longer and so
> will likely not be used in the near future... (That's what the LRU algorithm
> says...)
"What we're going to need soon" is the best. It isn't always predictable,
but sometimes. "The block following the last we read from some
file/fs-structure"
is often a good one though.
Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/