Skip to content

Commit 98583b3

Browse files
Abhi DasAndreas Gruenbacher
authored andcommitted
gfs2: add more timing info to journal recovery process
Tells you how many milliseconds map_journal_extents and find_jhead take. Signed-off-by: Abhi Das <adas@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 0ebbe4f commit 98583b3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

fs/gfs2/bmap.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/gfs2_ondisk.h>
1515
#include <linux/crc32.h>
1616
#include <linux/iomap.h>
17+
#include <linux/ktime.h>
1718

1819
#include "gfs2.h"
1920
#include "incore.h"
@@ -2248,7 +2249,9 @@ int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd)
22482249
unsigned int shift = sdp->sd_sb.sb_bsize_shift;
22492250
u64 size;
22502251
int rc;
2252+
ktime_t start, end;
22512253

2254+
start = ktime_get();
22522255
lblock_stop = i_size_read(jd->jd_inode) >> shift;
22532256
size = (lblock_stop - lblock) << shift;
22542257
jd->nr_extents = 0;
@@ -2268,8 +2271,9 @@ int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd)
22682271
lblock += (bh.b_size >> ip->i_inode.i_blkbits);
22692272
} while(size > 0);
22702273

2271-
fs_info(sdp, "journal %d mapped with %u extents\n", jd->jd_jid,
2272-
jd->nr_extents);
2274+
end = ktime_get();
2275+
fs_info(sdp, "journal %d mapped with %u extents in %lldms\n", jd->jd_jid,
2276+
jd->nr_extents, ktime_ms_delta(end, start));
22732277
return 0;
22742278

22752279
fail:

fs/gfs2/recovery.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ void gfs2_recover_func(struct work_struct *work)
460460
if (error)
461461
goto fail_gunlock_ji;
462462
t_jhd = ktime_get();
463+
fs_info(sdp, "jid=%u: Journal head lookup took %lldms\n", jd->jd_jid,
464+
ktime_ms_delta(t_jhd, t_jlck));
463465

464466
if (!(head.lh_flags & GFS2_LOG_HEAD_UNMOUNT)) {
465467
fs_info(sdp, "jid=%u: Acquiring the transaction lock...\n",

0 commit comments

Comments
 (0)