mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Shantanu Goel <sgoel01@yahoo.com>
Cc: linux-kernel@vger.kernel.org,
	Trond Myklebust <trond.myklebust@fys.uio.no>
Subject: Re: 2.6.6-rc{1,2} bad VM/NFS interaction in case of dirty page writeback
Date: Mon, 26 Apr 2004 19:15:12 -0700	[thread overview]
Message-ID: <20040426191512.69485c42.akpm@osdl.org> (raw)
In-Reply-To: <20040427011237.33342.qmail@web12824.mail.yahoo.com>

Shantanu Goel <sgoel01@yahoo.com> wrote:
>
> Hi,
> 
> During page reclamation when the scanner encounters a
> dirty page and invokes writepage(), if the FS layer
> returns WRITEPAGE_ACTIVATE as NFS does, I think the
> page should not be placed on the active as is
> presently done.  This can cause a lot of extraneous
> swapout activity because in the presence of a large
> active list, the pages being written out will not be
> reclaimed quickly enough.  It also seems counter
> intuitive since the scanner has just determined that
> the page has not been recently referenced.
> 
> Shouldn't the following code from shrink_list():
> 
> res = mapping->a_ops->writepage(page, &wbc);
> if (res < 0)
> 	handle_write_error(mapping, page, res);
> if (res == WRITEPAGE_ACTIVATE) {
> 	ClearPageReclaim(page);
> 	goto activate_locked;
> }
> 
> read:
> 
> res = mapping->a_ops->writepage(page, &wbc);
> if (res < 0)
> 	handle_write_error(mapping, page, res);
> if (res == WRITEPAGE_ACTIVATE) {
> 	ClearPageReclaim(page);
> 	goto keep_locked;
> }

WRITEPAGE_ACTIVATE is a bit of a hack to fix up specific peculiarities of
the interaction between tmpfs and page reclaim.

Trond, the changelog for that patch does not explain what is going on in
there - can you help out?

Also, what's the theory behind the handling of BDI_write_congested and
nfs_wait_on_write_congestion() in nfs_writepages()?  From a quick peek it
looks like NFS should be waking the sleepers in blk_congestion_wait()
rather than doing it privately?

> I can observe the benefit of this change if I run a dd
> on an NFS mount with the active list full of mostly
> mapped pages.  The stock kernel ends up paging out
> quite a bit of memory whereas the modified kernel does
> not.

yup.  We should be able to handle the throttling and writeback scheduling
from within core VFS/VM.  NFS should set and clear the backing_dev
congestion state appropriately and the VFS should take care of the rest. 
The missing bit is the early blk_congestion_wait() termination.


  reply	other threads:[~2004-04-27  2:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-27  1:12 Shantanu Goel
2004-04-27  2:15 ` Andrew Morton [this message]
2004-04-27  3:11   ` Trond Myklebust
2004-04-27  3:59     ` Andrew Morton
2004-04-27  5:23       ` Trond Myklebust
2004-04-27  5:58         ` Andrew Morton
2004-04-27 11:44           ` Shantanu Goel
2004-04-27 15:36           ` Trond Myklebust
2004-04-28  0:47             ` Shantanu Goel
2004-04-28  1:02               ` Andrew Morton
2004-04-28  1:28                 ` Trond Myklebust
2004-04-28  1:38                   ` Andrew Morton
2004-04-28  5:29             ` Christoph Hellwig
2004-04-28 16:17               ` Trond Myklebust
2004-04-28 16:38                 ` Christoph Hellwig
2004-04-28 19:07                   ` Andrew Morton
2004-04-29  1:48                     ` Nathan Scott
2004-04-29  8:27                       ` Christoph Hellwig
2004-04-27  6:10       ` Nick Piggin

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=20040426191512.69485c42.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sgoel01@yahoo.com \
    --cc=trond.myklebust@fys.uio.no \
    /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

all inboxes | Powered by JetHome®