kernel_optimize_test/fs/xfs/linux-2.6
Dave Chinner 1bfd8d0419 xfs: introduce inode cluster buffer trylocks for xfs_iflush
There is an ABBA deadlock between synchronous inode flushing in
xfs_reclaim_inode and xfs_icluster_free. xfs_icluster_free locks the
buffer, then takes inode ilocks, whilst synchronous reclaim takes
the ilock followed by the buffer lock in xfs_iflush().

To avoid this deadlock, separate the inode cluster buffer locking
semantics from the synchronous inode flush semantics, allowing
callers to attempt to lock the buffer but still issue synchronous IO
if it can get the buffer. This requires xfs_iflush() calls that
currently use non-blocking semantics to pass SYNC_TRYLOCK rather
than 0 as the flags parameter.

This allows xfs_reclaim_inode to avoid the deadlock on the buffer
lock and detect the failure so that it can drop the inode ilock and
restart the reclaim attempt on the inode. This allows
xfs_ifree_cluster to obtain the inode lock, mark the inode stale and
release it and hence defuse the deadlock situation. It also has the
pleasant side effect of avoiding IO in xfs_reclaim_inode when it
tries to next reclaim the inode as it is now marked stale.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
2011-03-26 09:13:55 +11:00
..
kmem.c xfs: Convert linux-2.6/ files to new logging interface 2011-03-07 10:00:35 +11:00
kmem.h
mrlock.h
time.h
xfs_acl.c xfs: provide simple rcu-walk ACL implementation 2011-01-07 17:50:30 +11:00
xfs_aops.c xfs: Convert linux-2.6/ files to new logging interface 2011-03-07 10:00:35 +11:00
xfs_aops.h xfs: kill xfs_iomap 2010-12-16 16:05:51 -06:00
xfs_buf.c vmap: flush vmap aliases when mapping fails 2011-03-26 09:13:42 +11:00
xfs_buf.h xfs: fix error handling for synchronous writes 2011-01-11 20:28:42 -06:00
xfs_discard.c xfs: check if device support discard in xfs_ioc_trim() 2011-02-21 20:39:00 -06:00
xfs_discard.h xfs: add FITRIM support 2011-01-11 20:28:29 -06:00
xfs_export.c xfs: fix exporting with left over 64-bit inodes 2010-12-16 16:04:55 -06:00
xfs_export.h
xfs_file.c xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00
xfs_fs_subr.c
xfs_globals.c
xfs_ioctl.c xfs: preallocation transactions do not need to be synchronous 2011-03-26 09:13:08 +11:00
xfs_ioctl.h
xfs_ioctl32.c
xfs_ioctl32.h
xfs_iops.c fallocate should be a file operation 2011-01-17 02:25:31 -05:00
xfs_iops.h
xfs_linux.h xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
xfs_message.c xfs: don't name variables "panic" 2011-03-11 16:34:51 -06:00
xfs_message.h xfs: kill support/debug.[ch] 2011-03-07 10:09:35 +11:00
xfs_quotaops.c
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: introduce inode cluster buffer trylocks for xfs_iflush 2011-03-26 09:13:55 +11:00
xfs_super.h
xfs_sync.c xfs: introduce inode cluster buffer trylocks for xfs_iflush 2011-03-26 09:13:55 +11:00
xfs_sync.h
xfs_sysctl.c xfs: Convert linux-2.6/ files to new logging interface 2011-03-07 10:00:35 +11:00
xfs_sysctl.h
xfs_trace.c
xfs_trace.h xfs: add FITRIM support 2011-01-11 20:28:29 -06:00
xfs_vnode.h
xfs_xattr.c