public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jlnance@unity.ncsu.edu
To: Bill Davidsen <davidsen@tmr.com>
Cc: "John Bradford" <john@grabjohn.com>,
	"Rik van Riel" <riel@redhat.com>,
	Lasse =?unknown-8bit?Q?K=E4rkk=E4inen?= / Tronic <tronic2@sci.fi>,
	linux-kernel@vger.kernel.org
Subject: Re: Some thoughts about cache and swap
Date: Wed, 16 Jun 2004 10:15:30 -0400	[thread overview]
Message-ID: <20040616141530.GA4680@ncsu.edu> (raw)
In-Reply-To: <40C76861.4040600@tmr.com>

On Wed, Jun 09, 2004 at 03:43:29PM -0400, Bill Davidsen wrote:
> John Bradford wrote:
> >Quote from Rik van Riel <riel@redhat.com>:

> >Is the current system really bad enough to make it worthwhile, though?
> 
> Yes! The current implementation just uses all the memory available, and 
> pushes any programs not actively running out to disk. Click the window 
> and go for coffee. On a small machine that's needed, but for almost any 
> typical usage, desktop or server, pushing out programs to have 3.5GB of 
> buffer instead of 3.0 doesn't help disk performance.

Hi All,

It would be good to make the swap-out code smarter, but it occured
to me this morning that the problem might really be the swap-in code.
If my 120M mozilla process gets paged out and then I click on the window,
whats the best case time required to swap it in.  Isn't it something like
2 seconds?  I dont think we currently get anywhere close to 2 seconds,
though I haven't checked.  I can think of two reasons this might be so,
though I am no expert on the Linux VM code so I would appreciate comments.

First, it may be that we spread the pages of the executable across the
swap space rather than putting them near each other.  This would introduce
a lot of seeks when we paged them back in, and this would certainly slow
us down.

Second, I believe the page-in process is fairly synchronous, something
like this:

    A - app generates a page fault
    B - kernel puts app to sleep and queues page-in
    C - Page in happens and kernel wakes up app

This is good behavior for the normal case where swapping is rare and you
want to drop unneeded pages from the working set.  But it is going to
be slow for the case where we need to page a lot of stuff in.  Does the
kernel try and recognize the case of a swapped out application 'comming
back to life' and try to page large portions of it back in before the
app faults the pages?

Thanks,

Jim

      parent reply	other threads:[~2004-06-16 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-05 14:40 Some thoughts about cache and swap Lasse Kärkkäinen / Tronic
2004-06-05 23:37 ` Rik van Riel
2004-06-06  7:08   ` John Bradford
2004-06-06  8:38     ` Christian Borntraeger
2004-06-09 18:13       ` Matt Mackall
2004-06-09 19:32         ` John Bradford
2004-06-09 19:32           ` Rik van Riel
2004-06-11 14:07             ` Jörn Engel
2004-06-12  1:50               ` Rik van Riel
2004-06-09 19:45       ` Bill Davidsen
2004-06-09 19:43     ` Bill Davidsen
2004-06-10  7:47       ` Buddy Lumpkin
2004-06-16 14:15       ` jlnance [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040616141530.GA4680@ncsu.edu \
    --to=jlnance@unity.ncsu.edu \
    --cc=davidsen@tmr.com \
    --cc=john@grabjohn.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=tronic2@sci.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox