All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: "Darrick J . Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs: largely extend aild sleep time if no work has to be done
Date: Wed, 29 Mar 2017 22:42:24 +0200	[thread overview]
Message-ID: <20170329204224.6412-1-dev@lynxeye.de> (raw)

If the AIL has been pushed up to the target LSN, there is no
point in waking up every 50ms to check if there is more work
to do. All functions that move the target LSN forward make sure
to wake aild as appropriate.

Keep the timeout wakeup as a watchdog in case we miss the
wakeup from a target LSN update to guarantee forward progress,
but extend the timeout to 10 seconds.

This keeps the safety net, but also makes laptop users happy
as it gets rid of almost all the wakeups caused by a lightly
loaded FS.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 fs/xfs/xfs_trans_ail.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index d6c9c3e..1eb40dc 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -457,12 +457,21 @@ xfsaild_push(
 	if (xfs_buf_delwri_submit_nowait(&ailp->xa_buf_list))
 		ailp->xa_log_flush++;
 
-	if (!count || XFS_LSN_CMP(lsn, target) >= 0) {
+	if (!count) {
 out_done:
 		/*
-		 * We reached the target or the AIL is empty, so wait a bit
-		 * 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.
+		 * If there was nothing to be pushed we can go to sleep longer,
+		 * as this is purely a watchdog timeout. If the target gets
+		 * moved forward we will get scheduled in before hitting this
+		 * timeout.
+		 */
+		tout = 10000;
+		ailp->xa_last_pushed_lsn = 0;
+	} else if (XFS_LSN_CMP(lsn, target) >= 0) {
+		/*
+		 * We reached the target, so wait a bit 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;
 		ailp->xa_last_pushed_lsn = 0;
-- 
2.9.3


             reply	other threads:[~2017-03-29 20:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 20:42 Lucas Stach [this message]
2017-03-29 23:22 ` [PATCH] xfs: largely extend aild sleep time if no work has to be done Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170329204224.6412-1-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.