linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, mbligh@mbligh.org, riel@redhat.com
Subject: Re: [patch 1/1] vmscan: give referenced, active and unmapped pages a second trip around the LRU
Date: Fri, 25 May 2007 09:51:19 +0200	[thread overview]
Message-ID: <1180079479.7348.33.camel@twins> (raw)
In-Reply-To: <20070525004808.84ae5cf3.akpm@linux-foundation.org>

On Fri, 2007-05-25 at 00:48 -0700, Andrew Morton wrote:
> On Fri, 25 May 2007 09:36:30 +0200 Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > > > The trouble I had with the previous patch is that it somehow looks to
> > > > PG_referenced but not the PTE state, that seems wrong to me.
> > > 
> > > 		if (page_mapped(page)) {
> > > 			if (!reclaim_mapped ||
> > > 			    (total_swap_pages == 0 && PageAnon(page)) ||
> > > 			    page_referenced(page, 0)) {
> > > 				list_add(&page->lru, &l_active);
> > > 				continue;
> > > 			}
> > > 		} else if (TestClearPageReferenced(page)) {
> > > 			list_add(&page->lru, &l_active);
> > > 			continue;
> > > 		}
> > > 
> > > When we run TestClearPageReferenced() we know that the page isn't
> > > page_mapped(): there aren't any pte's which refer to it.
> > 
> > D'0h, I guess I need my morning juice...
> > 
> > OK, that was my biggest beef - another small nit: I think it should do
> > the page_referenced() first, and then the other checks (in the
> > page_mapped() branch). Otherwise we might 'leak' the referenced state
> > and give it yet another cycle on the active list - even though it was
> > not used since last we were here.
> 
> You're saying we whould run page_referenced() prior to testing
> reclaim_mapped?

yep

> That's quite a large change in behaviour: when reclaim is having an easy
> time, (say, reclaiming clean pagecache), a change like that would cause
> more pte-refenced bits to be cleared and it would cause more clearing of
> PG_referenced on mapped pages.  Net effect: mapped pages get deactivated
> and reclaimed more easily.

*nod*

> It's also significantly more computationally expensive: more rmap walking,
> more lock-taking, more tlb writeback when those ptes get dirtied.  Not that
> reclaim is very CPU-intensive.
> 
> 
> But hey, like any change in there it might make reclaim better.  Or worse.
> Or pink with shiny spots.  We just don't know. 

:-/

Pick my code if you feel particularly lucky today, otherwise the
original will do just fine.

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

--
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>

  reply	other threads:[~2007-05-25  7:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 23:57 akpm, Andrew Morton
2007-05-25  7:02 ` Peter Zijlstra
2007-05-25  7:18   ` Andrew Morton
2007-05-25  7:23     ` Peter Zijlstra
2007-05-25  7:28       ` Andrew Morton
2007-05-25  7:36         ` Peter Zijlstra
2007-05-25  7:48           ` Andrew Morton
2007-05-25  7:51             ` Peter Zijlstra [this message]
2007-05-25  8:01               ` Andrew Morton
2007-05-25  8:35                 ` Peter Zijlstra
2007-05-25  8:43                   ` Andrew Morton
2007-05-25 10:13                     ` Peter Zijlstra
2007-05-25 14:50   ` Rik van Riel
2007-05-25 14:43 ` Rik van Riel
2007-05-25 17:20   ` Andrew Morton

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=1180079479.7348.33.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@mbligh.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