From: Dave Chinner <david@fromorbit.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: spurious -ENOSPC on XFS
Date: Thu, 5 Feb 2009 18:43:53 +1100 [thread overview]
Message-ID: <20090205074353.GN24173@disturbed> (raw)
In-Reply-To: <Pine.LNX.4.64.0902042310240.27204@hs20-bc2-1.build.redhat.com>
On Wed, Feb 04, 2009 at 11:31:25PM -0500, Mikulas Patocka wrote:
> > > ... and if you turn it into trylock, what are you going to do with the
> > > inode that is just being written to? You should definitely flush it, but
> > > trylock will skip it because it's already locked.
> >
> > We've already flushed it directly. You disabled that code fearing
> > deadlocks. I've made it synchronous (i.e. not handed off to
> > xfssyncd) because the flush path requires us to hold the lock we are
> > already holding....
>
> This is not "fearing deadlocks". This was getting a real deadlock:
<sigh>
Thank you for *finally* telling me exactly what the deadlock is that
you've been handwaving about for the last week. It's not a VFS
deadlock, nor is it an inode lock deadlock - its a page lock deadlock.
Perhaps next time you will post the stack trace instead of vaguely
describing a deadlock so you don't waste several hours of another
developer's time looking for deadlocks in all the wrong places?
> This one was obtained on a machine with 4k filesystem blocks, 8k pages and
> dd bs=1 on a nearly full filesystem.
That's helpful, too. I can write a test case to exercise that.
So, now I understand why you were suggesting going all the way back up
to the top of the IO path and flushing from there - so we don't hold
a page lock.
Perhaps we should just cull the direct inode flush completely.
If that inode has any significant delayed allocation space on it,
then the only reason it gets to an ENOSPC is that is has converted
all the speculative preallocation that it already has reserved
and is trying to allocate new space. Hence flushing it will not
return any extra space.
Hmmmmm - given that we hold the iolock exclusively, the trylock I
added into xfs_sync_inodes_ag() will fail on the inode we currently
hold page locks on (tries to get iolock shared) so that should avoid
deadlock on the page we currently hold locked. Can you remove the
direct inode flush and just run with the modified device flush to see
if that triggers the deadlock you've been seeing?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2009-02-05 7:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 11:14 spurious -ENOSPC on XFS Mikulas Patocka
2009-01-12 15:11 ` Christoph Hellwig
2009-01-13 5:58 ` Lachlan McIlroy
2009-01-14 22:16 ` Dave Chinner
2009-01-15 0:57 ` Lachlan McIlroy
2009-01-15 8:47 ` Dave Chinner
2009-01-13 21:49 ` Dave Chinner
2009-01-14 4:28 ` Mikulas Patocka
2009-01-18 17:31 ` Christoph Hellwig
2009-01-20 19:38 ` Mikulas Patocka
2009-01-20 23:24 ` Dave Chinner
2009-01-22 20:59 ` Christoph Hellwig
2009-01-22 22:43 ` Christoph Hellwig
2009-01-23 20:14 ` Mikulas Patocka
2009-01-24 7:12 ` Dave Chinner
2009-01-29 16:39 ` Mikulas Patocka
2009-01-29 16:45 ` Mikulas Patocka
2009-01-31 23:57 ` Dave Chinner
2009-02-02 17:36 ` Mikulas Patocka
2009-02-03 3:27 ` Dave Chinner
2009-02-03 20:05 ` Mikulas Patocka
2009-02-04 12:08 ` Dave Chinner
2009-02-05 4:31 ` Mikulas Patocka
2009-02-05 7:43 ` Dave Chinner [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=20090205074353.GN24173@disturbed \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--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