Subject: Re: Paging in from swap
To: Jason R Thorpe <>
From: Luke Mewburn <>
List: current-users
Date: 01/05/2003 11:15:14
On Sat, Jan 04, 2003 at 03:08:06PM -0800, Jason Thorpe wrote:
  | On Sat, Jan 04, 2003 at 11:01:31PM +0100, Reinier Jonker wrote:
  |  > This does not seem logical to me. When the pages in swap are required 
  |  > again, there is a huge performance penalty when paging them back in. 
  |  > Wouldn't it be better to page swap pages back in during idle time if 
  |  > the amount of free memory permits that? I do see one disadvantage, it 
  |  > may be required to page them back out before the pages are used again, 
  |  > but it may be possible to reduce that disadvantage with a timeout
  | The reason for leaving them out in swap until they're needed again is
  | because the pages were "idle" in the first place (that's how they were
  | selected to go out to swap).  This means that they're likely to continue
  | to be "idle", and so leaving them there until they are actually needed
  | saves pointless I/O.

I can see one situation where this would be useful; a laptop where
you've set the disk to spin-down on idle.  On the occasions where you
fire up a big program that causes a little bit of swap, the disk spins
up and runs for a while.  What would be nice (*) is if the system
would page in those pages if there's gobs of free RAM again whilst
the disk is spinning would be cool.

Of course, tuning my laptop's vm footprint, and/or adding RAM can
help this problem.

Having other features to be more aware of a disk's "idle" state would
be nice too; I've got my laptop running very quietly most of the time,
because I run noatime,nodevmtime, and I've tweaked services which
normally access the disk too often (syslogd - goes to a loghost,
postfix - with its habit of spinning up the disk every minute - stopped,

(*) yes, this is a corner case, and I'm asking for "pie in the sky"