mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Nick Piggin <npiggin@suse.de>
Cc: Jason Lunz <lunz@falooley.org>,
	lkml <linux-kernel@vger.kernel.org>,
	jffs-dev@axis.com, Hugh Dickins <hugh@veritas.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [jffs2] [rfc] fix write deadlock regression
Date: Sun, 02 Sep 2007 17:15:26 +0100	[thread overview]
Message-ID: <1188749726.3834.30.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20070902141756.GC20902@wotan.suse.de>

On Sun, 2007-09-02 at 16:17 +0200, Nick Piggin wrote:
> On Sun, Sep 02, 2007 at 02:48:04PM +0100, David Woodhouse wrote:
> > On Sun, 2007-09-02 at 15:20 +0200, Nick Piggin wrote:
> > > OK, but then hasn't the patch just made the deadlock harder to hit,
> > > or is there some invariant that says that readpage() will never be
> > > invoked if gc was invoked on the same page as we're commit_write()ing?
> > 
> > > The Q/A comments aren't very sure about this. I guess from the look
> > > of it, prepare_write/commit_write make sure the page will be uptodate
> > > by the start of commit_write, 
> > 
> > That's the intention, yes.
> > 
> > > and you avoid GCing the page in
> > > prepare_write because your new page won't have any nodes allocated
> > > yet that can possibly be GCed?
> > 
> > We _might_ GC the page -- it might not be a new page; we might be
> > overwriting it. But it's fine if we do. Actually it's slightly
> > suboptimal because we'll write out the same data twice -- once in GC and
> > then immediately afterward in the write which we were making space for.
> 
> But doesn't GC only happen in prepare_write in the case that the
> i_size is being extended into a new page?

Ah, yes. I was thinking of commit_write, and it had temporarily escaped
my notice that we also write in prepare_write, to extend the file.

So yes, you're probably right that it doesn't matter; in any GC
triggered from _prepare_write_ we avoid GCing the page in question
because it by definition doesn't exist.

-- 
dwmw2


      reply	other threads:[~2007-09-02 16:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 18:23 jffs2 deadlock introduced in linux 2.6.22.5 Jason Lunz
2007-08-31 21:26 ` Jason Lunz
2007-08-31 21:32   ` Jesper Juhl
2007-09-01 19:06   ` [jffs2] [rfc] fix write deadlock regression Jason Lunz
2007-09-02  4:20     ` Nick Piggin
2007-09-02 12:13       ` David Woodhouse
2007-09-02 13:20         ` Nick Piggin
2007-09-02 13:48           ` David Woodhouse
2007-09-02 14:17             ` Nick Piggin
2007-09-02 16:15               ` David Woodhouse [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=1188749726.3834.30.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jffs-dev@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lunz@falooley.org \
    --cc=npiggin@suse.de \
    /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®