linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: Re: Drop PageReclaim()
Date: Thu, 8 Feb 2007 13:19:37 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0702081317200.12048@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070207092517.15071f04.akpm@linux-foundation.org>

On Wed, 7 Feb 2007, Andrew Morton wrote:

> On Wed, 7 Feb 2007 06:13:48 -0800 (PST) Christoph Lameter <clameter@sgi.com> wrote:
> 
> > Am I missing something here? I cannot see PageReclaim have any effect?
> > 
> > 
> > 
> > PageReclaim is only used for dead code. The only current user is
> > end_page_writeback() which has the following lines:
> > 
> >  if (!TestClearPageReclaim(page) || rotate_reclaimable_page(page)) {
> >          if (!test_clear_page_writeback(page))
> >                   BUG();
> >  }
> > 
> > So the if statement is performed if !PageReclaim(page).
> > If PageReclaim is set then we call rorate_reclaimable(page) which
> > does:
> > 
> >  if (!PageLRU(page))
> >        return 1;
> > 
> > The only user of PageReclaim is shrink_list(). The pages processed
> > by shrink_list have earlier been taken off the LRU. So !PageLRU is always 
> > true.
> > 
> > The if statement is therefore always true and the rotating code
> > is never executed.
> 
> end_page_writeback() is amazingly obscure for such a short function.  For
> which I apologise, but on revisit, it's still not obvious how to clean it
> up.
> 
> It does:
> 
> 	if (!PageReclaim(page)) {
> 		clear_page_writeback();

Well it does
   if (!test_clear_page_writeback(page))
                  BUG();

> 	if (PageRecaim(page)) {
> 		ClearPageReclaim(page);
> 		foo = rotate_reclaimable_page(page);

PageReclaim is only used while the page is off the LRU. In that case 
rotate_reclaimable_page is always returning 1. So foo = 1 and 
rotate_reclaimable_page is useless.

> 		if (foo == 0) {

> 			/*
> 			 * rotate_reclaimable_page has already done
> 			 * clear_page_writeback()
> 			 */
> 		} else {
> 			clear_page_writeback(page);

This is also a test_clear ...

--
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-02-08 21:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 14:13 Drop PageReclaim() Christoph Lameter
2007-02-07 14:32 ` Hugh Dickins
2007-02-08 21:20   ` Christoph Lameter
2007-02-08 21:38     ` Christoph Lameter
2007-02-08 21:42       ` Christoph Lameter
2007-02-08 21:55         ` Christoph Lameter
2007-02-08 22:03           ` Andrew Morton
2007-02-08 22:14             ` Christoph Lameter
2007-02-08 22:24               ` Andrew Morton
2007-02-08 22:26                 ` Christoph Lameter
2007-02-08 22:37                   ` Andrew Morton
2007-02-08 22:40                     ` Christoph Lameter
2007-02-08 23:13                       ` Andrew Morton
2007-02-09  0:22                         ` Christoph Lameter
2007-02-09  0:39                           ` Andrew Morton
2007-02-09  1:06                             ` Christoph Lameter
2007-02-09  1:18                               ` Andrew Morton
2007-02-11  5:12                             ` Rik van Riel
2007-02-07 17:25 ` Andrew Morton
2007-02-08 21:19   ` Christoph Lameter [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=Pine.LNX.4.64.0702081317200.12048@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).