LWN.net Logo

Still waiting for swap prefetch

Still waiting for swap prefetch

Posted Jul 26, 2007 8:41 UTC (Thu) by tialaramex (subscriber, #21167)
In reply to: Still waiting for swap prefetch by sitaram
Parent article: Still waiting for swap prefetch

What you've described isn't quite the Right Thing™ though.

Eliminating swap with swapoff will force the kernel to bring back anonymous pages that had been pushed out, but not pages which are associated with existing storage, such as (almost all) program text, and mmap'd data files.

It's obviously possible to arrange for the kernel to notice that there's a lot of free RAM and a lot of pages, anonymous or otherwise that aren't in RAM and fix that. Unfortunately merely having a good idea isn't enough in Free Software, and in the kernel it's not even enough to have a good idea and an implementation.

One worry which swap prefetch people might be able to reassure me on - does it understand that if I have 2GB of as-yet unused RAM and a fresh 2GB mmap() I don't necessarily want it to try to pull all those pages off disk? ie does it know the difference between pages that have been pushed out and those which were simply never needed yet?


(Log in to post comments)

Still waiting for swap prefetch

Posted Jul 29, 2007 23:27 UTC (Sun) by dlang (✭ supporter ✭, #313) [Link]

but if the system is pulling the pages off of disk while the system is idle, and puts those pages at the end of the LRU list so that they are the first thing thrown away if you need more memory, what does it hurt you to pull them in and never use them?

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds