From: Dave Chinner <david@fromorbit.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, xfs@oss.sgi.com, stable@kernel.org
Subject: Re: [PATCH 1/3] writeback: pay attention to wbc->nr_to_write in write_cache_pages
Date: Thu, 10 Jun 2010 08:58:04 +1000 [thread overview]
Message-ID: <20100609225804.GK7869@dastard> (raw)
In-Reply-To: <20100609140942.6799c84a.akpm@linux-foundation.org>
On Wed, Jun 09, 2010 at 02:09:42PM -0700, Andrew Morton wrote:
> On Wed, 9 Jun 2010 10:37:18 +1000
> Dave Chinner <david@fromorbit.com> wrote:
>
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > If a filesystem writes more than one page in ->writepage, write_cache_pages
> > fails to notice this and continues to attempt writeback when wbc->nr_to_write
> > has gone negative - this trace was captured from XFS:
> >
> >
> > wbc_writeback_start: towrt=1024
> > wbc_writepage: towrt=1024
> > wbc_writepage: towrt=0
> > wbc_writepage: towrt=-1
> > wbc_writepage: towrt=-5
> > wbc_writepage: towrt=-21
> > wbc_writepage: towrt=-85
> >
> > This has adverse effects on filesystem writeback behaviour. write_cache_pages()
> > needs to terminate after a certain number of pages are written, not after a
> > certain number of calls to ->writepage are made. This is a regression
> > introduced by 17bc6c30cf6bfffd816bdc53682dd46fc34a2cf4 ("vfs: Add
> > no_nrwrite_index_update writeback control flag"), but cannot be reverted
> > directly due to subsequent bug fixes that have gone in on top of it.
>
> Might be needed in -stable. Unfortunately the most important piece of
> information which is needed to make that decision was cunningly hidden
> from us behind the vague-to-the-point-of-uselessness term "adverse
> effects".
>
> _what_ "adverse effects"??
Depends on how the specific filesystem handles a negative
nr_to_write, doesn't it? I can't speak for the exact effect on
anything other than XFS except to say that most ->write_page
implemetnations don't handle the wbc->nr_to_write < 0 specifically...
For XFS, it results in increased CPU usage because it triggers
page-at-a-time allocation (i.e no clustering), which increases
overhead in the elveator due to merging requirements of single page
bios and increased fragmentation due to small interleaved
allocations on concurrent writeback workloads. Effectively it causes
accelerated aging of XFS filesystems...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2010-06-09 22:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 0:37 [PATCH 0/3] writeback: bug fixes for 2.6.35 Dave Chinner
2010-06-09 0:37 ` [PATCH 1/3] writeback: pay attention to wbc->nr_to_write in write_cache_pages Dave Chinner
2010-06-09 21:09 ` Andrew Morton
2010-06-09 22:58 ` Dave Chinner [this message]
2010-06-10 0:08 ` Dave Chinner
2010-06-23 20:36 ` [stable] " Greg KH
2010-06-09 0:37 ` [PATCH 2/3] xfs: remove nr_to_write writeback windup Dave Chinner
2010-06-09 21:10 ` Andrew Morton
2010-06-09 0:37 ` [PATCH 3/3] writeback: limit write_cache_pages integrity scanning to current EOF Dave Chinner
2010-06-09 21:12 ` 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=20100609225804.GK7869@dastard \
--to=david@fromorbit.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=xfs@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).