···261261 xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE);262262 }263263264264- /*265265- * We reached the target so wait a bit longer for I/O to complete and266266- * remove pushed items from the AIL before we start the next scan from267267- * the start of the AIL.268268- */269269- if ((XFS_LSN_CMP(lsn, target) >= 0)) {264264+ if (!count) {265265+ /* We're past our target or empty, so idle */266266+ tout = 1000;267267+ } else if (XFS_LSN_CMP(lsn, target) >= 0) {268268+ /*269269+ * We reached the target so wait a bit longer for I/O to270270+ * complete and remove pushed items from the AIL before we271271+ * start the next scan from the start of the AIL.272272+ */270273 tout += 20;271274 last_pushed_lsn = 0;272275 } else if ((restarts > XFS_TRANS_PUSH_AIL_RESTARTS) ||273273- (count && ((stuck * 100) / count > 90))) {276276+ ((stuck * 100) / count > 90)) {274277 /*275278 * Either there is a lot of contention on the AIL or we276279 * are stuck due to operations in progress. "Stuck" in this