first try for swap prefetch
Quoted 3 lines · John Bradford
We could possibly avoid this by swapping the pages back in after one minute of inactivity, then letting the disk spin down.
Why not also write pages out to swap before it's really necessary?
If they were left mapped but marked as having up-to-date copies on swap, they could be discarded immediately if the system needed memory. (Of course if they got written to they would have to be paged out again.)
--
"Let's fight until six, and then have dinner," said Tweedledum. --Lewis Carroll, _Through the Looking Glass_
Completely new idea to virtual memory (Was: Re: [RFC] first try for swap prefetch)
Quoted 10 lines
Quoted 3 lines
We could possibly avoid this by swapping the pages back in after one minute of inactivity, then letting the disk spin down.
Why not also write pages out to swap before it's really necessary? If they were left mapped but marked as having up-to-date copies on swap, they could be discarded immediately if the system needed memory. (Of course if they got written to they would have to be paged out again.)
Hmmm, interesting...
The laptop-with-disk-configured-to-spin-down scenario would seem, (in theory), to benefit from a completely different approach to swapping to what we have at the moment.
Instead of trying to minimise the I/O bandwidth used, we could more or less ignore it, but consider the initial request, (after a certain timeout), to be very expensive.
So, all the time the disk was spinning, we'd make sure that the swap area contained the most useful data, possibly duplicating what was in RAM, and then spin the disk down at the earliest opportunity. That way, you could effectively swap in and swap out without spinning the disk up.
(Obviously, you can't do _both_ :-), but the idea would be to either swap out a lot, or swap in a lot, before spinning down, that way you get a 'free' swap either way, and consolidate disk reads/writes).
John.