linux/fs/xfs/linux-2.6
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
..
kmem.c xfs: replace KM_LARGE with explicit vmalloc use 2010-01-21 13:44:56 -06:00
kmem.h xfs: replace KM_LARGE with explicit vmalloc use 2010-01-21 13:44:56 -06:00
mrlock.h [XFS] shrink mrlock_t 2008-04-29 15:54:02 +10:00
sv.h remove dead code from sv_t implementation 2008-12-04 15:39:21 +11:00
time.h
xfs_acl.c xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_aops.c cleanup blockdev_direct_IO locking 2009-12-16 12:16:49 -05:00
xfs_aops.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_buf.c xfs: replace KM_LARGE with explicit vmalloc use 2010-01-21 13:44:56 -06:00
xfs_buf.h xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_cred.h [XFS] Fix merge failures 2008-12-29 16:47:18 +11:00
xfs_dmapi_priv.h [XFS] Remove KERNEL_VERSION macros from xfs_dmapi.h 2006-11-11 18:05:06 +11:00
xfs_export.c [XFS] pass XFS_IGET_BULKSTAT to xfs_iget for handle operations 2009-01-09 15:17:17 +11:00
xfs_export.h xfs: new export ops 2007-10-22 08:13:20 -07:00
xfs_file.c xfs: remove IO_ISAIO 2009-12-11 15:11:21 -06:00
xfs_fs_subr.c xfs: remove duplicate buffer flags 2010-01-21 13:44:36 -06:00
xfs_fs_subr.h [XFS] decontaminate vnode operations from behavior details 2007-10-15 16:54:29 +10:00
xfs_globals.c [XFS] remove restricted chown parameter from xfs linux 2008-10-30 18:30:48 +11:00
xfs_globals.h CRED: Separate task security context from task_struct 2008-11-14 10:39:16 +11:00
xfs_ioctl.c xfs: more reserved blocks fixups 2010-02-08 17:41:48 -06:00
xfs_ioctl.h xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_ioctl32.c xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_ioctl32.h [XFS] fix compile on 32 bit systems 2008-12-04 13:07:29 +11:00
xfs_iops.c xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00
xfs_iops.h [XFS] add a FMODE flag to make XFS invisible I/O less hacky 2008-12-11 13:14:41 +11:00
xfs_linux.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_lrw.c xfs: move more buffer helpers into xfs_buf.c 2010-01-15 15:35:17 -06:00
xfs_lrw.h xfs: move more buffer helpers into xfs_buf.c 2010-01-15 15:35:17 -06:00
xfs_quotaops.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs 2009-10-31 12:12:49 -07:00
xfs_stats.c xfs: switch to seq_file 2009-09-15 12:29:24 -05:00
xfs_stats.h [XFS] add new btree statistics 2008-10-30 16:55:03 +11:00
xfs_super.c xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_super.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_sync.c xfs: Use delayed write for inodes rather than async V2 2010-02-06 12:39:36 +11:00
xfs_sync.h xfs: make several more functions static 2010-01-15 15:31:38 -06:00
xfs_sysctl.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
xfs_sysctl.h [XFS] remove restricted chown parameter from xfs linux 2008-10-30 18:30:48 +11:00
xfs_trace.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_trace.h xfs: Add trace points for per-ag refcount debugging. 2010-01-15 15:34:12 -06:00
xfs_version.h
xfs_vnode.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_xattr.c xfs: convert attr to use unsigned names 2010-01-20 10:47:48 +11:00