summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_sync.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-11-29 12:06:14 -0600
committerBen Myers <bpm@sgi.com>2011-11-29 12:06:14 -0600
commit4dd2cb4a28b7ab1f37163a4eba280926a13a8749 (patch)
treef48cbb282ad4d52649b594657f00c1c8be753a47 /fs/xfs/xfs_sync.c
parentfa8b18edd752a8b4e9d1ee2cd615b82c93cf8bba (diff)
downloadop-kernel-dev-4dd2cb4a28b7ab1f37163a4eba280926a13a8749.zip
op-kernel-dev-4dd2cb4a28b7ab1f37163a4eba280926a13a8749.tar.gz
xfs: force buffer writeback before blocking on the ilock in inode reclaim
If we are doing synchronous inode reclaim we block the VM from making progress in memory reclaim. So if we encouter a flush locked inode promote it in the delwri list and wake up xfsbufd to write it out now. Without this we can get hangs of up to 30 seconds during workloads hitting synchronous inode reclaim. The scheme is copied from what we do for dquot reclaims. Reported-by: Simon Kirby <sim@hostway.ca> Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Simon Kirby <sim@hostway.ca> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_sync.c')
-rw-r--r--fs/xfs/xfs_sync.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c
index aa3dc1a..be5c51d 100644
--- a/fs/xfs/xfs_sync.c
+++ b/fs/xfs/xfs_sync.c
@@ -770,6 +770,17 @@ restart:
if (!xfs_iflock_nowait(ip)) {
if (!(sync_mode & SYNC_WAIT))
goto out;
+
+ /*
+ * If we only have a single dirty inode in a cluster there is
+ * a fair chance that the AIL push may have pushed it into
+ * the buffer, but xfsbufd won't touch it until 30 seconds
+ * from now, and thus we will lock up here.
+ *
+ * Promote the inode buffer to the front of the delwri list
+ * and wake up xfsbufd now.
+ */
+ xfs_promote_inode(ip);
xfs_iflock(ip);
}
OpenPOWER on IntegriCloud