linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Al Boldi <a1426z@gawab.com>
To: Rik van Riel <riel@redhat.com>
Cc: Chris Snook <csnook@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: How can we make page replacement smarter
Date: Sun, 29 Jul 2007 17:55:24 +0300	[thread overview]
Message-ID: <200707291755.24906.a1426z@gawab.com> (raw)
In-Reply-To: <46ABF184.40803@redhat.com>

Rik van Riel wrote:
> Al Boldi wrote:
> > Good idea, but unless we understand the problems involved, we are bound
> > to repeat it.  So my first question would be:  Why is swap-in so slow?
> >
> > As I have posted in other threads, swap-in of consecutive pages suffers
> > a 2x slowdown wrt swap-out, whereas swap-in of random pages suffers over
> > 6x slowdown.
> >
> > Because it is hard to quantify the expected swap-in speed for random
> > pages, let's first tackle the swap-in of consecutive pages, which should
> > be at least as fast as swap-out.  So again, why is swap-in so slow?
>
> I suspect that this is a locality of reference issue.
>
> Anonymous memory can get jumbled up by repeated free and
> malloc cycles of many smaller objects.  The amount of
> anonymous memory is often smaller than or roughly the same
> size as system memory.

Sounds exactly like the tmpfs problem.

> Locality of refenence to anonymous memory tends to be
> temporal in nature, with the same sets of pages being
> accessed over and over again.
>
> Files are different.  File content tends to be grouped
> in large related chunks, both logically in the file and
> on disk.  Generally there is a lot more file data on a
> system than what fits in memory.
>
> Locality of reference to file data tends to be spatial
> in nature, with one file access leading up to the system
> accessing "nearby" data.  The data is not necessarily
> touched again any time soon.
>
> > Once we understand this problem, we may be able to suggest a smart
> > improvement.
>
> Like the one on http://linux-mm.org/PageoutFailureModes ?

Interesting to see that there are known problems, but it doesn't seem to list 
the resume-from-disk swap-in slowdown.

> I have the LRU lists split and am working on getting SEQ
> replacement implemented for the anonymous pages.
>
> The most recent (untested) patches are attached.

Applied against 2.6.22; the kernel crashes out on boot.


Thanks!

--
Al

  parent reply	other threads:[~2007-07-29 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200707272243.02336.a1426z@gawab.com>
2007-07-28  1:56 ` swap-prefetch: A smart way to make good use of idle resources (was: updatedb) Chris Snook
2007-07-28  4:17   ` How can we make page replacement smarter (was: swap-prefetch) Al Boldi
2007-07-28  7:27     ` Chris Snook
2007-07-28 11:11       ` Al Boldi
2007-07-29  4:07         ` Rik van Riel
2007-07-29  6:40           ` Erblichs
2007-07-29  1:46     ` How can we make page replacement smarter Rik van Riel
2007-07-29 13:09       ` Alan Cox
2007-07-29 15:01         ` Rik van Riel
2007-07-29 14:55       ` Al Boldi [this message]
2007-07-28  4:18   ` swap-prefetch: A smart way to make good use of idle resources (was: updatedb) Al Boldi

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=200707291755.24906.a1426z@gawab.com \
    --to=a1426z@gawab.com \
    --cc=csnook@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    /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