Skip to contentSkip to conversation

Completely new idea to virtual memory

DISCUSSION Chuck Ebbert 3 participants 3 messages Apr 12, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines
Quoted 6 lines

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 gains from this might be largely illusion but you could get some
theoretical benefits:

o could write out lots of pages to swap without having to flush TLBs like you would if doing normal swap, since page remains present

o if swsusp does not need to write already-backed pages it could reduce suspend time

Maybe something like this?

   if about_to_spin_down_disks || swap_disk_idle
       if lots_of_memory_free
           page_in
       if little_memory_free
           copy_pages_to_swap

--
"Let's fight till six, and then have dinner," said Tweedledum.
--Lewis Carroll, _Through the Looking Glass_

#1 lore raw
Quoted 2 lines · Chuck Ebbert

o if swsusp does not need to write already-backed pages it could reduce suspend time

Hmmm. Not sure if it's worth the time taken to code & run figuring out if it's already backed, though :>. Would we ever be talking about a significant proportion of pages?

Regards,

Nigel

#2 lore raw
In reply to Chuck Ebbert
Quoted 7 lines

Maybe something like this?

   if about_to_spin_down_disks || swap_disk_idle
       if lots_of_memory_free
           page_in
       if little_memory_free
           copy_pages_to_swap

Exactly - plus, if the disk is only, or mainly, used for swap, you could purposely spin it down after doing the speculative swapout.

John.