linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 4/4] xfs_scrub: batch inumbers calls during fscounters calculation
Date: Mon, 26 Aug 2019 14:28:15 -0700	[thread overview]
Message-ID: <156685489550.2841421.9905052854315806096.stgit@magnolia> (raw)
In-Reply-To: <156685486843.2841421.7117771040713668517.stgit@magnolia>

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

Improve the efficiency of the phase 7 inode counts by batching requests,
now that we have per-AG inumbers wrappers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scrub/fscounters.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/scrub/fscounters.c b/scrub/fscounters.c
index 91487ebc..c90143c0 100644
--- a/scrub/fscounters.c
+++ b/scrub/fscounters.c
@@ -43,9 +43,10 @@ xfs_count_inodes_ag(
 {
 	struct xfs_inumbers_req	*ireq;
 	uint64_t		nr = 0;
+	unsigned int		i;
 	int			error;
 
-	ireq = xfrog_inumbers_alloc_req(1, 0);
+	ireq = xfrog_inumbers_alloc_req(64, 0);
 	if (!ireq) {
 		str_info(ctx, descr, _("Insufficient memory; giving up."));
 		return false;
@@ -55,7 +56,8 @@ xfs_count_inodes_ag(
 	while (!(error = xfrog_inumbers(&ctx->mnt, ireq))) {
 		if (ireq->hdr.ocount == 0)
 			break;
-		nr += ireq->inumbers[0].xi_alloccount;
+		for (i = 0; i < ireq->hdr.ocount; i++)
+			nr += ireq->inumbers[i].xi_alloccount;
 	}
 
 	free(ireq);


  parent reply	other threads:[~2019-08-26 21:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 21:27 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-08-26 21:27 ` [PATCH 1/4] xfs_io: add a bulkstat command Darrick J. Wong
2019-08-26 21:28 ` [PATCH 2/4] xfs_spaceman: remove open-coded per-ag bulkstat Darrick J. Wong
2019-08-26 21:28 ` [PATCH 3/4] xfs_scrub: convert to per-ag inode bulkstat operations Darrick J. Wong
2019-08-26 21:28 ` Darrick J. Wong [this message]
2019-09-06  3:35 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-09-06  3:36 ` [PATCH 4/4] xfs_scrub: batch inumbers calls during fscounters calculation Darrick J. Wong
2019-09-12 23:56   ` Dave Chinner
2019-09-25 21:32 [PATCH 0/4] xfsprogs: bulkstat v5 Darrick J. Wong
2019-09-25 21:33 ` [PATCH 4/4] xfs_scrub: batch inumbers calls during fscounters calculation 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=156685489550.2841421.9905052854315806096.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).