All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [RFCv2 9/9] xfs: add extra log count for transactions that defer agfl frees
Date: Wed, 24 Jan 2018 13:44:18 -0500	[thread overview]
Message-ID: <20180124184418.40403-10-bfoster@redhat.com> (raw)
In-Reply-To: <20180124184418.40403-1-bfoster@redhat.com>

Now that AGFL frees are deferred from particular contexts, the
associated transactions may require an increased number of
transaction rolls during deferred operation processing. Update the
log counts to prevent these additional rolls from blocking on
reservation regrant.

XXX: This patch is currently a no-op as XFS_AGFL_LOG_COUNT is set to
zero. Initially it was 1, but testing has shown a couple issues:

- The increase in number of regrants due to deferred AGFL block frees
appears to be minimal on the workloads examined so far.
- Increasing the logcount of certain larger transactions (e.g.,
tr_rename and some of the other directory ops) can increase the max
transaction reservation and have side effects like increasing the
minimum required log size at mkfs time.

Based on the above and the reasoning that deferred AGFL block frees
are a subset of all AGFL fixup operations (only frees), which in
turn are a subset of allocations (typically those that involve btree
shape changes), I think that it's probably overkill to increase
the logcount of any existing transactions at the moment. That
doesn't preclude from doing so in the future, of course.

I'm including this patch for reference and discussion purposes for
the RFC. I'm open to running more/different tests and/or considering
subsets of transactions, though I would prefer any change be backed
by a test that demonstrates the cost of deferring AGFL frees and
benefit of increasing the logcount of the associated transaction(s)
and workload. I've simply not been able to do that with enough
clarity to justify a change so far.

Not-Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/libxfs/xfs_trans_resv.h | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_trans_resv.h b/fs/xfs/libxfs/xfs_trans_resv.h
index b7e5357d060a..05fdcef07216 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.h
+++ b/fs/xfs/libxfs/xfs_trans_resv.h
@@ -82,20 +82,23 @@ struct xfs_trans_resv {
 	 XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)
 
 /*
- * Various log count values.
+ * Various log count values. The AGFL count is a sub-component that covers
+ * additional tx rolls due to AGFL fixups (for transactions that defer AGFL
+ * block frees).
  */
+#define	XFS_AGFL_LOG_COUNT		0 /* for agfl fixups */
 #define	XFS_DEFAULT_LOG_COUNT		1
 #define	XFS_DEFAULT_PERM_LOG_COUNT	2
 #define	XFS_ITRUNCATE_LOG_COUNT		2
 #define	XFS_ITRUNCATE_LOG_COUNT_REFLINK	8
-#define XFS_INACTIVE_LOG_COUNT		2
-#define	XFS_CREATE_LOG_COUNT		2
+#define	XFS_INACTIVE_LOG_COUNT		(2 + XFS_AGFL_LOG_COUNT)
+#define	XFS_CREATE_LOG_COUNT		(2 + XFS_AGFL_LOG_COUNT)
 #define	XFS_CREATE_TMPFILE_LOG_COUNT	2
-#define	XFS_MKDIR_LOG_COUNT		3
-#define	XFS_SYMLINK_LOG_COUNT		3
-#define	XFS_REMOVE_LOG_COUNT		2
-#define	XFS_LINK_LOG_COUNT		2
-#define	XFS_RENAME_LOG_COUNT		2
+#define	XFS_MKDIR_LOG_COUNT		(3 + XFS_AGFL_LOG_COUNT)
+#define	XFS_SYMLINK_LOG_COUNT		(3 + XFS_AGFL_LOG_COUNT)
+#define	XFS_REMOVE_LOG_COUNT		(2 + XFS_AGFL_LOG_COUNT)
+#define	XFS_LINK_LOG_COUNT		(2 + XFS_AGFL_LOG_COUNT)
+#define	XFS_RENAME_LOG_COUNT		(2 + XFS_AGFL_LOG_COUNT)
 #define	XFS_WRITE_LOG_COUNT		2
 #define	XFS_WRITE_LOG_COUNT_REFLINK	8
 #define	XFS_ADDAFORK_LOG_COUNT		2
-- 
2.13.6


      parent reply	other threads:[~2018-01-24 18:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 18:44 [RFCv2 0/9] xfs: defer agfl block frees Brian Foster
2018-01-24 18:44 ` [RFCv2 1/9] xfs: create agfl block free helper function Brian Foster
2018-01-24 18:44 ` [RFCv2 2/9] xfs: allow attach of dfops to transaction Brian Foster
2018-01-24 18:44 ` [RFCv2 3/9] xfs: defer agfl block frees when dfops is available Brian Foster
2018-01-24 18:44 ` [RFCv2 4/9] xfs: defer agfl block frees from deferred ops processing context Brian Foster
2018-01-24 18:44 ` [RFCv2 5/9] xfs: defer agfl frees from inode inactivation Brian Foster
2018-01-24 18:44 ` [RFCv2 6/9] xfs: defer frees from common inode allocation paths Brian Foster
2018-01-24 18:44 ` [RFCv2 7/9] xfs: defer agfl frees from directory op transactions Brian Foster
2018-01-24 18:44 ` [RFCv2 8/9] xfs: add a runtime stat for extra transaction log regrants Brian Foster
2018-01-24 18:44 ` Brian Foster [this message]

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=20180124184418.40403-10-bfoster@redhat.com \
    --to=bfoster@redhat.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.