linux-kernel-test/fs/xfs
Dave Chinner c854363e80 xfs: Use delayed write for inodes rather than async V2
We currently do background inode flush asynchronously, resulting in
inodes being written in whatever order the background writeback
issues them. Not only that, there are also blocking and non-blocking
asynchronous inode flushes, depending on where the flush comes from.

This patch completely removes asynchronous inode writeback. It
removes all the strange writeback modes and replaces them with
either a synchronous flush or a non-blocking delayed write flush.
That is, inode flushes will only issue IO directly if they are
synchronous, and background flushing may do nothing if the operation
would block (e.g. on a pinned inode or buffer lock).

Delayed write flushes will now result in the inode buffer sitting in
the delwri queue of the buffer cache to be flushed by either an AIL
push or by the xfsbufd timing out the buffer. This will allow
accumulation of dirty inode buffers in memory and allow optimisation
of inode cluster writeback at the xfsbufd level where we have much
greater queue depths than the block layer elevators. We will also
get adjacent inode cluster buffer IO merging for free when a later
patch in the series allows sorting of the delayed write buffers
before dispatch.

This effectively means that any inode that is written back by
background writeback will be seen as flush locked during AIL
pushing, and will result in the buffers being pushed from there.
This writeback path is currently non-optimal, but the next patch
in the series will fix that problem.

A side effect of this delayed write mechanism is that background
inode reclaim will no longer directly flush inodes, nor can it wait
on the flush lock. The result is that inode reclaim must leave the
inode in the reclaimable state until it is clean. Hence attempts to
reclaim a dirty inode in the background will simply skip the inode
until it is clean and this allows other mechanisms (i.e. xfsbufd) to
do more optimal writeback of the dirty buffers. As a result, the
inode reclaim code has been rewritten so that it no longer relies on
the ambiguous return values of xfs_iflush() to determine whether it
is safe to reclaim an inode.

Portions of this patch are derived from patches by Christoph
Hellwig.

Version 2:
- cleanup reclaim code as suggested by Christoph
- log background reclaim inode flush errors
- just pass sync flags to xfs_iflush

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-02-06 12:39:36 +11:00
..
linux-2.6 xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
quota xfs: quota limit statvfs available blocks 2010-01-21 16:34:23 -06:00
support xfs: event tracing support 2009-12-14 23:08:16 -06:00
Kconfig xfs: use generic Posix ACL code 2009-06-10 17:07:47 +02:00
Makefile xfs: turn off sign warnings 2010-01-26 15:10:15 +11:00
xfs_acl.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_ag.h xfs: embed the pagb_list array in the perag structure 2010-01-15 15:34:39 -06:00
xfs_alloc_btree.c xfs: Don't directly reference m_perag in allocation code 2010-01-15 15:33:12 -06:00
xfs_alloc_btree.h [XFS] Always use struct xfs_btree_block instead of short / longform 2008-10-30 17:14:34 +11:00
xfs_alloc.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_alloc.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_arch.h xfs: use generic Posix ACL code 2009-06-10 17:07:47 +02:00
xfs_attr_leaf.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_attr_leaf.h [XFS] Remove macro-to-function indirections in attr code 2009-01-09 15:46:44 +11:00
xfs_attr_sf.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_attr.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_attr.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_bit.c
xfs_bit.h [XFS] Remove macro-to-function indirections in the mask code 2009-01-09 15:53:54 +11:00
xfs_bmap_btree.c xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_bmap_btree.h xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_bmap.c xfs: suppress spurious uninitialised var warning in xfs_bmapi() 2010-01-20 10:50:06 +11:00
xfs_bmap.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_btree_trace.c [XFS] make btree tracing generic 2008-10-30 16:58:50 +11:00
xfs_btree_trace.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_btree.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_btree.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_buf_item.c xfs: kill XLOG_VEC_SET_TYPE 2010-01-21 13:44:43 -06:00
xfs_buf_item.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_da_btree.c xfs: convert dirnameops to unsigned char names 2010-01-20 10:47:17 +11:00
xfs_da_btree.h xfs: convert dirnameops to unsigned char names 2010-01-20 10:47:17 +11:00
xfs_dfrag.c xfs: clean up inconsistent variable naming in xfs_swap_extent 2010-01-15 15:31:23 -06:00
xfs_dfrag.h xfs: clean up inconsistent variable naming in xfs_swap_extent 2010-01-15 15:31:23 -06:00
xfs_dinode.h xfs: remove m_litino 2009-03-29 09:51:14 +02:00
xfs_dir2_block.c xfs: clean up sign warnings in dir2 code 2010-01-20 10:48:05 +11:00
xfs_dir2_block.h
xfs_dir2_data.c
xfs_dir2_data.h xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_dir2_leaf.c xfs: clean up sign warnings in dir2 code 2010-01-20 10:48:05 +11:00
xfs_dir2_leaf.h
xfs_dir2_node.c xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_dir2_node.h xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_dir2_sf.c xfs: clean up sign warnings in dir2 code 2010-01-20 10:48:05 +11:00
xfs_dir2_sf.h [XFS] kill xfs_dinode_core_t 2008-12-01 11:37:35 +11:00
xfs_dir2.c xfs: clean up sign warnings in dir2 code 2010-01-20 10:48:05 +11:00
xfs_dir2.h xfs: make xfs_dir_cilookup_result use unsigned char 2010-01-20 10:47:25 +11:00
xfs_dmapi.h removed unused #include <linux/version.h>'s 2008-08-23 12:14:12 -07:00
xfs_dmops.c [XFS] kill struct xfs_mount_args 2008-10-30 17:53:24 +11:00
xfs_error.c [XFS] avoid memory allocations in xfs_fs_vcmn_err 2008-12-22 18:02:01 +11:00
xfs_error.h [XFS] avoid memory allocations in xfs_fs_vcmn_err 2008-12-22 18:02:01 +11:00
xfs_extfree_item.c xfs: kill XLOG_VEC_SET_TYPE 2010-01-21 13:44:43 -06:00
xfs_extfree_item.h [XFS] remove always-true #ifndef HAVE_FORMAT32 tests 2009-01-22 14:07:31 +11:00
xfs_filestream.c xfs: Kill filestreams cache flush 2010-01-15 15:34:22 -06:00
xfs_filestream.h xfs: Kill filestreams cache flush 2010-01-15 15:34:22 -06:00
xfs_fs.h trivial: fix typo "for for" in multiple files 2009-09-21 15:14:54 +02:00
xfs_fsops.c xfs: Replace per-ag array with a radix tree 2010-01-15 15:33:52 -06:00
xfs_fsops.h filesystem freeze: add error handling of write_super_lockfs/unlockfs 2009-01-09 16:54:42 -08:00
xfs_ialloc_btree.c xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_ialloc_btree.h xfs: remove superflous inobt macros 2009-02-09 08:37:14 +01:00
xfs_ialloc.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_ialloc.h xfs: rationalize xfs_inobt_lookup* 2009-09-01 12:45:39 -05:00
xfs_iget.c xfs: rename xfs_get_perag 2010-01-15 15:33:02 -06:00
xfs_inode_item.c xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_inode_item.h xfs: kill xfs_bmbt_rec_32/64 types 2009-12-16 13:41:20 -06:00
xfs_inode.c xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_inode.h xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_inum.h xfs: remove XFS_INO64_OFFSET 2009-08-31 14:46:22 -05:00
xfs_iomap.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_iomap.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_itable.c xfs: replace KM_LARGE with explicit vmalloc use 2010-01-21 13:44:56 -06:00
xfs_itable.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_log_priv.h xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_log_recover.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_log_recover.h xfs: Use list_heads for log recovery item lists 2010-01-15 15:31:51 -06:00
xfs_log.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_log.h xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_mount.c xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_mount.h xfs: more reserved blocks fixups 2010-02-08 17:41:48 -06:00
xfs_mru_cache.c xfs: Kill filestreams cache flush 2010-01-15 15:34:22 -06:00
xfs_mru_cache.h xfs: Kill filestreams cache flush 2010-01-15 15:34:22 -06:00
xfs_quota.h xfs: kill XFS_QMOPT_ASYNC 2010-01-21 13:44:10 -06:00
xfs_refcache.h
xfs_rename.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_rtalloc.c xfs: fix missing error check in xfs_rtfree_range 2010-01-15 13:46:19 -06:00
xfs_rtalloc.h xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_rw.c xfs: move more buffer helpers into xfs_buf.c 2010-01-15 15:35:17 -06:00
xfs_rw.h xfs: move more buffer helpers into xfs_buf.c 2010-01-15 15:35:17 -06:00
xfs_sb.h [XFS] Remove the rest of the macro-to-function indirections. 2009-01-19 14:45:55 +11:00
xfs_trans_ail.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_trans_buf.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_trans_extfree.c
xfs_trans_inode.c xfs: simplify xfs_trans_iget 2009-09-01 12:46:16 -05:00
xfs_trans_item.c xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_trans_priv.h [XFS] Finish removing the mount pointer from the AIL API 2008-10-30 17:39:58 +11:00
xfs_trans_space.h xfs: remove superflous inobt macros 2009-02-09 08:37:14 +01:00
xfs_trans.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_trans.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_types.h xfs: directory names are unsigned 2010-01-20 10:44:58 +11:00
xfs_utils.c xfs: kill xfs_qmops 2009-06-08 15:33:32 +02:00
xfs_utils.h
xfs_vnodeops.c xfs: cleanup up xfs_log_force calling conventions 2010-01-21 13:44:49 -06:00
xfs_vnodeops.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs.h xfs: event tracing support 2009-12-14 23:08:16 -06:00