From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Ravikiran G Thirumalai <kiran@scalex86.org>,
linux-mm@kvack.org, shai@scalex86.org
Subject: Re: [rfc] [patch] mm: zone_reclaim fix for pseudo file systems
Date: Mon, 30 Jul 2007 19:27:21 -0700 [thread overview]
Message-ID: <20070730192721.eb220a9d.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707301858280.26859@schroedinger.engr.sgi.com>
On Mon, 30 Jul 2007 19:01:07 -0700 (PDT) Christoph Lameter <clameter@sgi.com> wrote:
> On Mon, 30 Jul 2007, Ravikiran G Thirumalai wrote:
>
> > On Mon, Jul 30, 2007 at 05:27:41PM -0700, Christoph Lameter wrote:
> > >On Mon, 30 Jul 2007, Andrew Morton wrote:
> > >
> > >> The problem is that __zone_reclaim() doesn't use all_unreclaimable at all.
> > >> You'll note that all the other callers of shrink_zone() do take avoiding
> > >> action if the zone is in all_unreclaimable state, but __zone_reclaim() forgot
> > >> to.
> > >
> > >zone reclaim only runs if there are unmapped file backed pages that can be
> > >reclaimed.
> >
> > Yes, and in this case, without the patch, VM considers RAMFS pages to be
> > file backed, thus being fooled into entering reclaim. The process entering
> > into reclaim in our tests gets in through zone_reclaim.
Oh.. So this:
/*
* Zone reclaim reclaims unmapped file backed pages and
* slab pages if we are over the defined limits.
*
* A small portion of unmapped file backed pages is needed for
* file I/O otherwise pages read by file I/O will be immediately
* thrown out if the zone is overallocated. So we do not reclaim
* if less than a specified percentage of the zone is used by
* unmapped file backed pages.
*/
if (zone_page_state(zone, NR_FILE_PAGES) -
zone_page_state(zone, NR_FILE_MAPPED) <= zone->min_unmapped_pages
&& zone_page_state(zone, NR_SLAB_RECLAIMABLE)
<= zone->min_slab_pages)
return 0;
is being fooled.
That makes sense, but any fix we do here won't fix things for regular
reclaim.
Sigh, I should have spotted that bug on day one - it's pretty gross. Too
many patches, too little akpm.
> That means RAMFS pages are accounted as NR_FILE_PAGES but not as
> NR_FILE_MAPPED..... So we have unmapped pages that are not reclaimable.
>
> But they are not really file backed pages. They are backed by memory. Can
> we just not increment NR_FILE_MAPPED? Should they not be accounted for an
> NR_ANON_PAGES or so?
Or we change NR_FILE_MAPPED accounting so that it doesn't account
BDI_CAP_foo pages, where foo is, I guess, NO_WRITEBACK.
We're going to create a mess here, I can feel it. Please, ignore "what works".
What is _right_ here? What is our design? Our guiding principle? Because we
already have a mess.
Straw man proposal:
- account file-backed pages, BDI_CAP_NO_ACCT_DIRTY pages and
BDI_CAP_NO_WRITEBACK separately. ie: zone accounting pretty
much follows the BDI_CAP_ selectors.
- work out, then document what those BDI_CAP_* things actually _mean_. ie:
which sorts of callers should set them, and why.
- do the appropriate arith at reclaim-time.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-07-31 2:27 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 23:27 [rfc] [patch] mm: zone_reclaim fix for pseudo file systems Ravikiran G Thirumalai
2007-07-30 18:12 ` Christoph Lameter
2007-07-30 20:23 ` Andrew Morton
2007-07-30 20:31 ` Christoph Lameter
2007-07-30 21:12 ` Lee Schermerhorn
2007-07-31 0:01 ` Ravikiran G Thirumalai
2007-07-31 0:20 ` Andrew Morton
2007-07-31 0:27 ` Christoph Lameter
2007-07-31 1:06 ` Andrew Morton
2007-07-31 1:52 ` Christoph Lameter
2007-07-31 1:56 ` Ravikiran G Thirumalai
2007-07-31 2:01 ` Christoph Lameter
2007-07-31 2:27 ` Andrew Morton [this message]
2007-07-31 2:36 ` Christoph Lameter
2007-07-31 4:47 ` Andrew Morton
2007-07-31 5:00 ` Christoph Lameter
2007-07-31 5:17 ` Andrew Morton
2007-07-31 5:33 ` Christoph Lameter
2007-07-31 5:58 ` Andrew Morton
2007-07-31 6:09 ` Christoph Lameter
2007-07-31 6:18 ` Andrew Morton
2007-07-31 19:35 ` Christoph Lameter
2007-07-31 19:46 ` Andrew Morton
2007-07-31 19:50 ` Christoph Lameter
2007-07-31 8:27 ` Ravikiran G Thirumalai
2007-07-31 8:35 ` Andrew Morton
2007-07-31 19:30 ` Christoph Lameter
2007-07-31 19:20 ` Christoph Lameter
2007-07-31 7:15 ` Ravikiran G Thirumalai
2007-07-31 19:18 ` Christoph Lameter
2007-07-31 1:36 ` Ravikiran G Thirumalai
2007-07-31 1:53 ` Andrew Morton
2007-07-31 1:56 ` Christoph Lameter
2007-07-31 2:19 ` Christoph Lameter
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=20070730192721.eb220a9d.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=kiran@scalex86.org \
--cc=linux-mm@kvack.org \
--cc=shai@scalex86.org \
/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