cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [fsck.gfs2 PATCH] fsck.gfs2: Speed up function bitmap_type
Date: Thu, 14 Jul 2016 08:32:50 -0400 (EDT)	[thread overview]
Message-ID: <1912114611.11096900.1468499570246.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1974922372.11077971.1468499112017.JavaMail.zimbra@redhat.com>

Hi,

Here's another patch that speeds up the performance of fsck.gfs2.
This one was also posted as part of a larger set on 22 June.

On my 15TB file system which is 80% full, the previous two patches I
posted made pass1 go from 15h52m to 14h23m. This patch makes pass1 go
from 14h23m to 13h35m27s, a savings of 47 minutes: another 6 percent
speedup from the previous set.

Patch description:

This patch speeds up fsck.gfs2 by allowing function bitmap_type to
remember the last rgrp it used for the next lookup.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index d93b65d..0649fec 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -70,8 +70,14 @@ static inline void link1_destroy(struct gfs2_bmap *bmap)
 static inline int bitmap_type(struct gfs2_sbd *sdp, uint64_t bblock)
 {
 	struct rgrp_tree *rgd;
+	static struct rgrp_tree *prevrgd = NULL;
 
-	rgd = gfs2_blk2rgrpd(sdp, bblock);
+	if (prevrgd && rgrp_contains_block(prevrgd, bblock))
+		rgd = prevrgd;
+	else {
+		rgd = gfs2_blk2rgrpd(sdp, bblock);
+		prevrgd = rgd;
+	}
 	return lgfs2_get_bitmap(sdp, bblock, rgd);
 }
 



           reply	other threads:[~2016-07-14 12:32 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1974922372.11077971.1468499112017.JavaMail.zimbra@redhat.com>]

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=1912114611.11096900.1468499570246.JavaMail.zimbra@redhat.com \
    --to=rpeterso@redhat.com \
    /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).