Re: [PATCH 3/5] [XFS] Block callers of xfs_flush_inodes() correctly.

Dave Chinner
2009-03-16T10:28:08Z

On Mon, Mar 16, 2009 at 05:13:31AM -0400, Christoph Hellwig wrote:
> On Sun, Mar 15, 2009 at 10:31:45PM +1100, Dave Chinner wrote:
> > xfs_flush_inodes() currently uses a magic timeout to wait for
> > some inodes to be flushed before returning. This isn't
> > really reliable but used to be the best that could be done
> > due to deadlock potential of waiting for the entire flush.
> >
> > Now the inode flush is safe to execute while we hold page
> > and inode locks, we can wait for all the inodes to flush
> > synchronously. Convert the wait mechanism to a completion
> > to do this efficiently. This should remove all remaining
> > spurious ENOSPC errors from the delayed allocation reservation
> > path.
>
> Why do we queue it up to a different thread if we synchronously wait
> for it anyway?

To avoid competing with flushes that may already be in progress.
This way all the concurrent ENOSPC flushes are serialised by the
xfssyncd so it can do optimal flushing without being interfered
with....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com