From: Dave Chinner <david@fromorbit.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 1/5] [XFS] Use xfs_sync_inodes() for device flushing
Date: Wed, 18 Mar 2009 15:17:52 +1100 [thread overview]
Message-ID: <20090318041752.GN26138@disturbed> (raw)
In-Reply-To: <Pine.LNX.4.64.0903170857050.26754@hs20-bc2-1.build.redhat.com>
On Tue, Mar 17, 2009 at 09:08:36AM -0400, Mikulas Patocka wrote:
> On Sun, 15 Mar 2009, Dave Chinner wrote:
>
> > From: Dave Chinner <dgc@evostor.com>
> >
> > Currently xfs_device_flush calls sync_blockdev() which is
> > a no-op for XFS as all it's metadata is held in a different
> > address to the one sync_blockdev() works on.
> >
> > Call xfs_sync_inodes() instead to flush all the delayed
> > allocation blocks out. To do this as efficiently as possible,
> > do it via two passes - one to do an async flush of all the
> > dirty blocks and a second to wait for all the IO to complete.
> > This requires some modification to the xfs-sync_inodes_ag()
> > flush code to do efficiently.
.....
> I tested the code and it works fine.
>
> But I'm not somehow convinced that that TRYLOCK is right ... that it will
> avoid that pagelock-deadlock that I found before.
Care to expand on why?
> What is the ordering of pagelock, ILOCK and IOLOCK?
iolock, pagelock, and ilock is always the innermost of the three.
> If you keep the
> ordering right, you don't need trylock.
In this case, we are doing:
iolock exclusive
pagelock
<flush>
Clearly we can't take the iolock during <flush> (nor any other
several other places in XFS that might try to take the iolock), so
trylock-and-fail is the usual method used in XFS for avoiding a
deadlock in this scenario.
> And if the ordering is wrong,
> trylock will only lower the probability of a deadlock, not avoid it
> completely.
Details of why you think this? XFS uses trylocks extensively to
avoid deadlocks in these sorts of situations, so I'm curious to
know why you think this technique provide an absolute guarantee in
this case....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2009-03-18 4:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-15 10:57 [PATCH 0/5] [XFS] Spurious ENOSPC fixes Dave Chinner
2009-03-15 10:57 ` [PATCH 1/5] [XFS] Use xfs_sync_inodes() for device flushing Dave Chinner
2009-03-17 13:08 ` Mikulas Patocka
2009-03-18 4:17 ` Dave Chinner [this message]
2009-03-18 16:14 ` Mikulas Patocka
2009-03-20 4:30 ` Dave Chinner
2009-03-25 15:19 ` Mikulas Patocka
2009-03-15 10:57 ` [PATCH 2/5] [XFS] Make inode flush at ENOSPC synchronous Dave Chinner
2009-03-15 10:57 ` [PATCH 3/5] [XFS] Block callers of xfs_flush_inodes() correctly Dave Chinner
2009-03-15 10:57 ` [PATCH 4/5] [XFS] Flush delayed allcoation blocks on ENOSPC in create Dave Chinner
2009-03-15 10:57 ` [PATCH 5/5] [XFS] Remove xfs_flush_space Dave Chinner
2009-03-15 11:11 ` [PATCH 0/5] [XFS] Spurious ENOSPC fixes Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2009-03-15 11:31 [PATCH 0/5, RESEND] " Dave Chinner
2009-03-15 11:31 ` [PATCH 1/5] [XFS] Use xfs_sync_inodes() for device flushing Dave Chinner
2009-03-16 9:08 ` Christoph Hellwig
2009-03-16 10:45 ` Dave Chinner
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=20090318041752.GN26138@disturbed \
--to=david@fromorbit.com \
--cc=hch@infradead.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