[PATCH 1/3] xfs: Use delayed write for inodes rather than async

Christoph Hellwig hch at infradead.org
Fri Jan 8 05:14:32 CST 2010


On Fri, Jan 08, 2010 at 10:05:24PM +1100, Dave Chinner wrote:
> I don't think it really matters for the existing code as we do the
> xfs_flush_buftarg(SYNC_WAIT) in the loop below which will push out
> inodes flushed during reclaim.

True.

> Hmmm - given that xfs_reclaim_inodes(mp, XFS_IFLUSH_DELWRI) can skip
> inodes, there probably should be a sync reclaim done in the flush
> loop to ensure we've caught them.

Indeed, the skipping behaviour is rather confusing and needs to be taken
care off.

> Yes - xfs_iflush_int() gets called only from xfs_iflush() and
> xfs_iflush_cluster() and both check first.

Ok.

> The delayed write flush can skip inodes, so we need to do a sync
> flush to guarantee that we reclaim all dirty inodes. The flush is done
> first so the sync flush doesn't block on the flush locks for too
> long for inodes that are already locked for delwri flushing.
> Perhaps a:
> 
> 	xfs_reclaim_inodes(mp, XFS_IFLUSH_DELWRI);
> 	XFS_bflush(mp->m_ddev_targp);
> 	xfs_reclaim_inodes(mp, XFS_IFLUSH_SYNC);
> 
> sequence would be better here?

I guess that would be optimal.  Maybe with a little comment explaining
why we do it.




More information about the xfs mailing list