public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: "David S. Miller" <davem@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch 2/13] remove pages from the LRU in __free_pages_ok()
Date: Sun, 28 Jul 2002 22:15:37 -0700	[thread overview]
Message-ID: <3D44CF79.11082B2D@zip.com.au> (raw)
In-Reply-To: Pine.LNX.4.44.0207282147090.962-100000@home.transmeta.com

Linus Torvalds wrote:
> 
> On Sun, 28 Jul 2002, Andrew Morton wrote:
> >
> > Problem is that the rmap VM doesn't perform swapout via pagetables.
> > It performs it via the LRU.
> >
> > If someone is sleeping on a pagefault against a mmapped file, and a
> > truncate happens meanwhile, that page comes back as an anonymous
> > page.  It's not on the LRU any more so it has become unswappable.
> 
> Note that there is nothing fundamentally wrong with keeping the anonymous
> page on the LRU either.
> 
> Some of th e2.4.x kernels kept _all_ anonymous pages on the LRU. That
> added a lot of LRU overhead, but there could be a fairly simple
> workaround: don't add anon pages to the LRU normally, but if a LRU page is
> turned into an anonymous page _and_ it is still mapped, keep it on the LRU
> list as an anonymous page.

All 2.4 and 2.5 kernels currently put all anon pages on the LRU all the
time.  And, yes, this creates great amounts of list scanning in
Andrea's VM.  Quite expensive for some workloads.

He took anon pages on and off the LRU several times shortly after
2.4.10.  They ended up "on". When I asked him if we could take them
off again earlier this month he said

"the only advantage they give us in 2.4 vm is that they let us know
 better when it's time to swap_out. without them, we'd start to swapout
 only when there's some significant amount of mapped cache, without
 regard of the amount of the amount of anonymous ram. In short swap
 performance are higher with this information. We could try to collect
 this info without having to waste time on the lru but I've never tried
 that."


However, with rmap things are different.  When an anon page
reaches the tail of the LRU and the access info is right, it
gets added to swapcache.  So anon pages on the LRU is a fundamental
part of rmap - there's no other way of getting at them.

I haven't yet checked whether the rmap design has reduced the CPU
load which I was observing in 2.5.24 from churning these
anon pages through shrink_cache().  Rik thinks it may do so.

-

  reply	other threads:[~2002-07-29  5:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-28  7:32 [patch 2/13] remove pages from the LRU in __free_pages_ok() Andrew Morton
2002-07-28 23:54 ` Linus Torvalds
2002-07-29  0:32   ` Andrew Morton
2002-07-29  0:37     ` Linus Torvalds
2002-07-29  0:59       ` Andrew Morton
2002-07-29  0:59         ` Rik van Riel
2002-07-29  2:50     ` David S. Miller
2002-07-29  3:51       ` Linus Torvalds
2002-07-29  3:43         ` David S. Miller
2002-07-29  4:21           ` Linus Torvalds
2002-07-29  5:43             ` David S. Miller
2002-07-29  6:16               ` Linus Torvalds
2002-07-29  6:10                 ` David S. Miller
2002-07-29  6:27                   ` Linus Torvalds
2002-07-29  6:59                     ` Andrew Morton
2002-07-30 11:30                     ` Ed Tomlinson
     [not found]                     ` <200208011942.49342.tomlins@cam.org>
     [not found]                       ` <3D49C951.AB7C527E@zip.com.au>
2002-08-03 19:27                         ` [PATCH] slablru for linux-2.5 bk tree Ed Tomlinson
2002-08-03 20:43                           ` Rik van Riel
2002-08-04  3:17                           ` Andrew Morton
2002-07-29  8:35                 ` [patch 2/13] remove pages from the LRU in __free_pages_ok() Rik van Riel
2002-07-29  4:25           ` Andrew Morton
2002-07-29  4:28             ` Linus Torvalds
2002-07-29  4:52               ` Andrew Morton
2002-07-29  4:50                 ` Linus Torvalds
2002-07-29  5:15                   ` Andrew Morton [this message]
2002-07-29  4:17         ` Andrew Morton
2002-07-29  4:23           ` Linus Torvalds
2002-07-29  5:43           ` David S. Miller
2002-07-29  6:24           ` Paul Mackerras

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=3D44CF79.11082B2D@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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