[Top] [All Lists]

[RFC PATCH v3 1/2] xfs: re-enable xfsaild idle mode when the ail is empt

To: xfs@xxxxxxxxxxx
Subject: [RFC PATCH v3 1/2] xfs: re-enable xfsaild idle mode when the ail is empty
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 22 May 2012 12:38:33 -0400
Cc: Brian Foster <bfoster@xxxxxxxxxx>
In-reply-to: <1337704714-50235-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1337704714-50235-1-git-send-email-bfoster@xxxxxxxxxx>
Running xfstests 273 in a loop on older kernels with xfsaild idle
mode support reproduces a lockup due to xfsaild entering idle mode
indefinitely. The following high-level sequence of events leads to
the hang:

- xfsaild is running, hits the stuck item threshold and reschedules,
  setting xa_last_pushed_lsn appropriately.
- xa_threshold is updated.
- xfsaild restarts from the previous xa_last_pushed_lsn, hits the
  new target and enters idle mode, even though the previously
  stuck items still populate the ail.

Modify the tout logic to only enter idle mode when the ail is empty.
IOW, if we hit the target but did not perform the current scan from
the start of the ail, reschedule at least one more time.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
 fs/xfs/xfs_trans_ail.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 9c51448..8a122d3 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -488,7 +488,10 @@ out_done:
                 * longer for I/O to complete and remove pushed items from the
                 * AIL before we start the next scan from the start of the AIL.
-               tout = 50;
+               if (!count && !ailp->xa_last_pushed_lsn)
+                       tout = 0;
+               else
+                       tout = 50;
                ailp->xa_last_pushed_lsn = 0;
        } else if (((stuck + flushing) * 100) / count > 90) {

<Prev in Thread] Current Thread [Next in Thread>