xfs
[Top] [All Lists]

[RFC PATCH v2 2/3] xfs: fix xfsaild hang due to premature idle

To: xfs@xxxxxxxxxxx
Subject: [RFC PATCH v2 2/3] xfs: fix xfsaild hang due to premature idle
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Mon, 21 May 2012 14:49:28 -0400
Cc: Brian Foster <bfoster@xxxxxxxxxx>
In-reply-to: <1337626169-21730-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1337626169-21730-1-git-send-email-bfoster@xxxxxxxxxx>
Running xfstests 273 in a loop reproduces an XFS lockup due to
xfsaild entering idle mode indefinitely. The following
high-level sequence of events lead 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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index ae620eb..8bc8aa2 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -503,7 +503,7 @@ xfsaild_push(
 
        /* assume we have more work to do in a short while */
 out_done:
-       if (!count) {
+       if (!count && !ailp->xa_last_pushed_lsn) {
                /* We're past our target or empty, so idle */
                ailp->xa_last_pushed_lsn = 0;
                ailp->xa_log_flush = 0;
-- 
1.7.7.6

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