All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhi Das <adas@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH 1/4] gfs2: add timing info to map_journal_extents
Date: Thu,  6 Sep 2018 12:02:34 -0500	[thread overview]
Message-ID: <1536253357-8967-2-git-send-email-adas@redhat.com> (raw)
In-Reply-To: <1536253357-8967-1-git-send-email-adas@redhat.com>

Tells you how many milliseconds map_journal_extents takes.

Signed-off-by: Abhi Das <adas@redhat.com>
---
 fs/gfs2/bmap.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 03128ed..dddb5a4 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -14,6 +14,7 @@
 #include <linux/gfs2_ondisk.h>
 #include <linux/crc32.h>
 #include <linux/iomap.h>
+#include <linux/ktime.h>
 
 #include "gfs2.h"
 #include "incore.h"
@@ -2248,7 +2249,9 @@ int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd)
 	unsigned int shift = sdp->sd_sb.sb_bsize_shift;
 	u64 size;
 	int rc;
+	ktime_t start, end;
 
+	start = ktime_get();
 	lblock_stop = i_size_read(jd->jd_inode) >> shift;
 	size = (lblock_stop - lblock) << shift;
 	jd->nr_extents = 0;
@@ -2268,8 +2271,9 @@ int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd)
 		lblock += (bh.b_size >> ip->i_inode.i_blkbits);
 	} while(size > 0);
 
-	fs_info(sdp, "journal %d mapped with %u extents\n", jd->jd_jid,
-		jd->nr_extents);
+	end = ktime_get();
+	fs_info(sdp, "journal %d mapped with %u extents in %lldms\n", jd->jd_jid,
+		jd->nr_extents, ktime_ms_delta(end, start));
 	return 0;
 
 fail:
-- 
2.4.11



  reply	other threads:[~2018-09-06 17:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 17:02 [Cluster-devel] [GFS2 PATCH 0/4] Speed up journal head lookup Abhi Das
2018-09-06 17:02 ` Abhi Das [this message]
2018-09-06 17:02 ` [Cluster-devel] [GFS2 PATCH 2/4] gfs2: changes to gfs2_log_XXX_bio Abhi Das
2018-09-06 17:02 ` [Cluster-devel] [GFS2 PATCH 3/4] gfs2: add a helper function to get_log_header that can be used elsewhere Abhi Das
2018-09-06 17:02 ` [Cluster-devel] [GFS2 PATCH 4/4] gfs2: read journal in large chunks to locate the head Abhi Das
2018-09-07 12:14   ` Andreas Gruenbacher
2018-09-07 12:51     ` Abhijith Das
2018-09-07 12:46   ` Bob Peterson
2018-09-07  8:53 ` [Cluster-devel] [GFS2 PATCH 0/4] Speed up journal head lookup Steven Whitehouse

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=1536253357-8967-2-git-send-email-adas@redhat.com \
    --to=adas@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 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.