linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [patch 1/7] mm: write_cache_pages writepage error fix
Date: Tue, 28 Oct 2008 14:18:46 +0100	[thread overview]
Message-ID: <20081028131846.GA3082@wotan.suse.de> (raw)
In-Reply-To: <20081022093715.4d213d5e.akpm@linux-foundation.org>

On Wed, Oct 22, 2008 at 09:37:15AM -0700, Andrew Morton wrote:
> On Wed, 22 Oct 2008 11:36:32 +0200 Nick Piggin <npiggin@suse.de> wrote:
> 
> > > >  				wbc->encountered_congestion = 1;
> > > > 
> > > > -- 
> > > 
> > > I don't think I like the implementation much.
> > > 
> > > In all cases in that function where we set done=1, we want to bale out
> > > right now at this page, rather than processing the remaining pages in
> > > the pagevec.
> > > 
> > > So it would be better to implement a bit of code which releases the
> > > pagevec pages and then breaks out of the loop.  Then this bug
> > > automatically gets fixed.
> > 
> > I had almost exactly that at some point, then I rethought it because it
> > was a bigger behaviour change than the bugfix-only.
> > 
> > I thought the !done thing must be just for batching and to process the
> > pages already looked up in the pagevec.
> > 
> > I'll need to backport at least some of these to stable -- any chance of
> > making the change you suggest toward the end of the patchset?
> 
> That works.
> 
> > Let me
> > know if you want a patch or will do one yourself.
> 
> I couldn't hope to match your level of testing ;)

OK, looking at this closer, I think the aversion to breaking out of the
loop early is because it becomes more difficult to keep track of you
end index, for cyclic writeback. It's no longer the index that comes out
of the radix tree lookup.

And whether we go for the current page index or the previous one depends
on the reason we have to bail out.

So I don't know if it will fall out quite so nicely as you had it. But
I missed this too: I didn't handle it properly either in the early bailout
from writepage error case. So I'll have to do that.

The problem that would cause in normal writeout operations is that you'd
bail out when nr_to_write reaches 0, but you would most likely set the
writeback_index to skip a few dirty pages that were in the pagevec but
not yet written out. For error-cases it's not so bad as it will be an
abnormal condition, but AFAIKS nowhere is documented that range_cyclic
cannot be used for data integrity, so it is better to be consistent and
make it all work as expected.

Anyway, I just noticed this as I was about to merge your changes and
resend, so I'll need a little longer to fix and test...


  reply	other threads:[~2008-10-28 13:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  8:09 [patch 0/7] writeback data integrity and other fixes npiggin
2008-10-21  8:09 ` [patch 1/7] mm: write_cache_pages writepage error fix npiggin
2008-10-21 21:55   ` Andrew Morton
2008-10-21 22:01     ` Matthew Wilcox
2008-10-21 22:05       ` Andrew Morton
2008-10-22  9:36     ` Nick Piggin
2008-10-22 16:37       ` Andrew Morton
2008-10-28 13:18         ` Nick Piggin [this message]
2008-10-21  8:09 ` [patch 2/7] mm: write_cache_pages integrity fix npiggin
2008-10-21  8:09 ` [patch 3/7] mm: do_sync_mapping_range " npiggin
2008-10-21  8:09 ` [patch 4/7] mm: write_cache_pages cyclic fix npiggin
2008-10-21  8:09 ` [patch 5/7] mm: write_cache_pages cleanups npiggin
2008-10-21  8:09 ` [patch 6/7] mm: write_cache_pages optimise page cleaning npiggin
2008-10-21  8:09 ` [patch 7/7] mm: write_cache_pages terminate quickly npiggin

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=20081028131846.GA3082@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.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).