Skip to content

Delayed write metadata writeback V4

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10xfs: Make inode reclaim states explicitfs/xfs/linux-2.6/xfs_sync.c fs/xfs/xfs_inode.c fs/xfs/xfs_inode.h+63 -292 replies
2/10xfs: Use delayed write for inodes rather than async V2fs/xfs/linux-2.6/xfs_super.c fs/xfs/linux-2.6/xfs_sync.c fs/xfs/xfs_inode.c +3 more+102 -1142 replies
3/10xfs: Don't issue buffer IO direct from AIL push V2fs/xfs/linux-2.6/xfs_buf.c fs/xfs/linux-2.6/xfs_buf.h fs/xfs/linux-2.6/xfs_trace.h +7 more+102 -2031 reply
4/10xfs: Sort delayed write buffers before dispatchfs/xfs/linux-2.6/xfs_buf.c+60 -271 reply
5/10xfs: Use delay write promotion for dquot flushingfs/xfs/quota/xfs_dquot.c+10 -151 reply
6/10xfs: kill the unused XFS_QMOPT_* flush flags V2fs/xfs/quota/xfs_dquot.c fs/xfs/quota/xfs_dquot_item.c fs/xfs/quota/xfs_qm.c +1 more+14 -231 reply
7/10xfs: remove invalid barrier optimization from xfs_fsyncfs/xfs/xfs_vnodeops.c+2 -100 replies
8/10xfs: move the inode locking outside xfs_fsync()fs/xfs/linux-2.6/xfs_file.c fs/xfs/linux-2.6/xfs_lrw.c fs/xfs/xfs_vnodeops.c +1 more+25 -223 replies
9/10xfs: xfs_fs_write_inode() can fail to write inodes synchronously V2fs/xfs/linux-2.6/xfs_super.c+32 -226 replies
10/10xfs: kill xfs_bawritefs/xfs/linux-2.6/xfs_buf.c fs/xfs/linux-2.6/xfs_buf.h+0 -201 reply

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigDave ChinnerAlex Elder
1/10R-b
2/10R-b R-b
3/10R-b R-b
4/10R-b R-b
5/10R-b R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/10] Delayed write metadata writeback V4

While I started with killing async inode writeback, the series has grown. It's not really limited to inode writeback - it touches dquot flushing, changes the way the AIL pushes on buffers, adds xfsbufd sortingi for delayed write buffers, adds a real non-blocking mode to inode reclaim and avoids physical inode writeback from the VFS while fixing bugs in handling delayed write inodes. Hence this is more about enabling efficient delayed write metadata than it is able killing async inode writeback.

The idea behind this series is to make metadata buffers get written from xfsbufd via the delayed write queue rather than being issued asynchronously from all over the place. To do this, async buffer writeback is almost entirely removed from XFS, replaced instead by delayed writes and a method to expedite flushing of delayed write buffers when required.

The result of funnelling all the buffer IO into a single place is that we can more tightly control and therefore optimise the submission of metadata IO. Aggregating the buffers before dispatch allows much better sort efficiency of the buffers as the sort window is not limited to the size of the elevator congestion hysteresis limit. Hence we can approach 100% merge effeciency on large numbers of buffers when dispatched for IO and greatly reduce the amount of seeking metadata writeback causes.

The major change is to the inode flushing and reclaim code. Delayed write inodes hold the flush lock for much longer than for async writeback, and hence blocking on the flush lock can cause extremely long latencies without other mechanisms to expedite the release of the flush locks. To prevent needing to flush inodes immeidately, all operations are done non-blocking unless synchronous. THis required a significant rework of the inode reclaim code, but it greatly simplified other pieces of code (e.g. log item pushing).

Version 4
- rework inode reclaim checks for better legibility
- add warning to reclaim code when delwri flush errors occur
- kill XFS_ITEM_FLUSHING now it is not used
- clean up sync_mode flags being pushed into xfs_iflush()
- kill the now unused xfs_bawrite() function
- include Christoph's fsync cache flush fix
- rework the inode locking and call to xfs_fsync() when doing synchronous inode writes to close races between the fsync and the background delwri flush afterwards.

Version 3
- rework inode reclaim to:
- separate it from xfs_iflush return values
- provide a non-blocking mode for background operation
- apply delwri buffer promotion tricks to dquot flushing
- kill unneeded dquot flushing flags, similar to inode flushing flag removal
- fix sync inode flush bug when trying to flush delwri inodes

Version 2:
- use generic list sort function
- when unmounting, push the delwri buffers first, then do sync inode reclaim so that reclaim doesn't block for 15 seconds waiting for delwri inode buffers to be aged and written before the inodes can be reclaimed.

Performance numbers for this version are the same as V2, which were as follows:

Perf results (average of 3 runs) on a debug XFS build (means allocation patterns are randomly varied, so runtimes are also a bit variable):

Untar 2.6.32 kernel tarball, sync, then remove:

Untar+sync rm -rf

xfs-dev:           25.2s          13.0s
xfs-dev-delwri-1:  22.5s           9.1s
xfs-dev-delwri-2:  21.9s           8.4s

4 processes each creating 100,000, five byte files in separate directories concurrently, then 4 processes removing a directory each concurrently.

create rm -rf

xfs-dev:           8m32s           4m10s
xfs-dev-delwri-1:  4m55s           3m42s
xfs-dev-delwri-2:  4m56s           3m33s

The patch series (plus the couple of previous bug fixes that haven't been pulled into the tree on oss yet) are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/dgc/xfs for-2.6.34

Christoph Hellwig (1):
xfs: remove invalid barrier optimization from xfs_fsync

Dave Chinner (11):
xfs: don't hold onto reserved blocks on remount,ro
xfs: turn off sign warnings
xfs: Make inode reclaim states explicit
xfs: Use delayed write for inodes rather than async V2
xfs: Don't issue buffer IO direct from AIL push V2
xfs: Sort delayed write buffers before dispatch
xfs: Use delay write promotion for dquot flushing
xfs: kill the unused XFS_QMOPT_* flush flags V2
xfs: move the inode locking outside xfs_fsync()
xfs: xfs_fs_write_inode() can fail to write inodes synchronously V2
xfs: kill xfs_bawrite

 fs/xfs/Makefile               |    2 +-
 fs/xfs/linux-2.6/xfs_buf.c    |  135 ++++++++++++++++++++++++++--------------
 fs/xfs/linux-2.6/xfs_buf.h    |    3 +-
 fs/xfs/linux-2.6/xfs_file.c   |    6 ++-
 fs/xfs/linux-2.6/xfs_lrw.c    |    5 +-
 fs/xfs/linux-2.6/xfs_super.c  |   82 ++++++++++++++++++-------
 fs/xfs/linux-2.6/xfs_sync.c   |  138 +++++++++++++++++++++++++++++++++-------
 fs/xfs/linux-2.6/xfs_trace.h  |    1 +
 fs/xfs/quota/xfs_dquot.c      |   38 +++++-------
 fs/xfs/quota/xfs_dquot_item.c |   87 ++++----------------------
 fs/xfs/quota/xfs_dquot_item.h |    4 -
 fs/xfs/quota/xfs_qm.c         |   14 ++---
 fs/xfs/xfs_buf_item.c         |   64 ++++++++++---------
 fs/xfs/xfs_inode.c            |   86 ++------------------------
 fs/xfs/xfs_inode.h            |   11 +---
 fs/xfs/xfs_inode_item.c       |  108 +++++++-------------------------
 fs/xfs/xfs_inode_item.h       |    6 --
 fs/xfs/xfs_mount.c            |   13 ++++-
 fs/xfs/xfs_mount.h            |    1 +
 fs/xfs/xfs_quota.h            |    8 +--
 fs/xfs/xfs_trans.h            |    3 +-
 fs/xfs/xfs_trans_ail.c        |   13 ++--
 fs/xfs/xfs_vnodeops.c         |   46 +++++--------
 fs/xfs/xfs_vnodeops.h         |    2 +-
 24 files changed, 415 insertions(+), 461 deletions(-)

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs