All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com, bfoster@redhat.com
Subject: [PATCH 4/4] xfs: only relog deferred intent items if free space in the log gets low
Date: Sun, 27 Sep 2020 16:42:24 -0700	[thread overview]
Message-ID: <160125014477.174867.15070395010887462680.stgit@magnolia> (raw)
In-Reply-To: <160125011935.174867.2604597189723452984.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Now that we have the ability to ask the log how far the tail needs to be
pushed to maintain its free space targets, augment the decision to relog
an intent item so that we only do it if the log has hit the 75% full
threshold.  There's no point in relogging an intent into the same
checkpoint, and there's no need to relog if there's plenty of free space
in the log.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_defer.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)


diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index dfa301bddf6f..30627f524b8c 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -356,11 +356,14 @@ xfs_defer_relog(
 	struct xfs_trans		**tpp,
 	struct list_head		*dfops)
 {
+	struct xlog			*log = (*tpp)->t_mountp->m_log;
 	struct xfs_defer_pending	*dfp;
 
 	ASSERT((*tpp)->t_flags & XFS_TRANS_PERM_LOG_RES);
 
 	list_for_each_entry(dfp, dfops, dfp_list) {
+		xfs_lsn_t		threshold_lsn;
+
 		/*
 		 * If the log intent item for this deferred op is not a part of
 		 * the current log checkpoint, relog the intent item to keep
@@ -372,6 +375,15 @@ xfs_defer_relog(
 		    xfs_log_item_in_current_chkpt(dfp->dfp_intent))
 			continue;
 
+		/*
+		 * Figure out where we need the tail to be in order to maintain
+		 * the minimum required free space in the log.
+		 */
+		threshold_lsn = xlog_grant_push_threshold(log, 0);
+		if (threshold_lsn == NULLCOMMITLSN ||
+		    XFS_LSN_CMP(dfp->dfp_intent->li_lsn, threshold_lsn) >= 0)
+			continue;
+
 		trace_xfs_defer_relog_intent((*tpp)->t_mountp, dfp);
 		dfp->dfp_intent = xfs_trans_item_relog(dfp->dfp_intent, *tpp);
 	}


  parent reply	other threads:[~2020-09-27 23:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27 23:41 [PATCH v4 0/4] xfs: fix some log stalling problems in defer ops Darrick J. Wong
2020-09-27 23:42 ` [PATCH 1/4] xfs: change the order in which child and parent defer ops are finished Darrick J. Wong
2020-09-27 23:42 ` [PATCH 2/4] xfs: periodically relog deferred intent items Darrick J. Wong
2020-09-27 23:42 ` [PATCH 3/4] xfs: expose the log push threshold Darrick J. Wong
2020-09-27 23:42 ` Darrick J. Wong [this message]
2020-09-29 17:44 [PATCH v5 0/4] xfs: fix some log stalling problems in defer ops Darrick J. Wong
2020-09-29 17:44 ` [PATCH 4/4] xfs: only relog deferred intent items if free space in the log gets low Darrick J. Wong
2020-10-01 16:02   ` Brian Foster
2020-10-01 17:33     ` Darrick J. Wong
2020-10-05 18:20 [PATCH v5 0/4] xfs: fix some log stalling problems in defer ops Darrick J. Wong
2020-10-05 18:21 ` [PATCH 4/4] xfs: only relog deferred intent items if free space in the log gets low Darrick J. Wong

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=160125014477.174867.15070395010887462680.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.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.