From: Abhi Das <adas@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC v2 PATCH 5/5] gfs2: add tracepoint debugging for gfs2_end_log_read
Date: Sun, 12 Aug 2018 23:48:49 -0500 [thread overview]
Message-ID: <1534135729-60721-6-git-send-email-adas@redhat.com> (raw)
In-Reply-To: <1534135729-60721-1-git-send-email-adas@redhat.com>
Use a tracepoint and a counter in gfs2_jdesc to count the number of
outstanding reads (in pages) as we read through a journal to aid
debugging.
Signed-off-by: Abhi Das <adas@redhat.com>
---
fs/gfs2/incore.h | 1 +
fs/gfs2/lops.c | 3 +++
fs/gfs2/ops_fstype.c | 1 +
fs/gfs2/trace_gfs2.h | 25 +++++++++++++++++++++++++
4 files changed, 30 insertions(+)
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 31188c0..bb4446d 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -512,6 +512,7 @@ struct gfs2_jdesc {
struct gfs2_log_header_host jd_jhead;
struct bio *jd_rd_bio; /* bio used for reading this journal */
+ atomic_t jd_rd_pg_ct;
unsigned int jd_found_blocks;
unsigned int jd_found_revokes;
unsigned int jd_replayed_blocks;
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 518b786..a261398 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -250,6 +250,7 @@ static void gfs2_end_log_read(struct bio *bio, int error)
ptr = page_address(page);
error = gfs2_log_header_in(&lh, ptr);
last = page_private(page);
+ atomic_dec(&jd->jd_rd_pg_ct);
if (!test_bit(JDF_JHEAD, &jd->jd_flags)) {
mempool_free(page, gfs2_page_pool);
@@ -273,6 +274,7 @@ static void gfs2_end_log_read(struct bio *bio, int error)
}
bio_put(bio);
+ trace_gfs2_end_log_read(jd);
}
/**
@@ -454,6 +456,7 @@ void gfs2_log_read_extent(struct gfs2_jdesc *jd, u64 dblock,
ret = bio_add_page(bio, page, sb->s_blocksize, 0);
WARN_ON(ret == 0);
}
+ atomic_inc(&jd->jd_rd_pg_ct);
bio->bi_private = jd;
}
}
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 4a17eaf..ac9855a 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -643,6 +643,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
break;
}
jd->jd_rd_bio = NULL;
+ atomic_set(&jd->jd_rd_pg_ct, 0);
spin_lock(&sdp->sd_jindex_spin);
jd->jd_jid = sdp->sd_journals++;
diff --git a/fs/gfs2/trace_gfs2.h b/fs/gfs2/trace_gfs2.h
index d1de2ed..9f0cc8d 100644
--- a/fs/gfs2/trace_gfs2.h
+++ b/fs/gfs2/trace_gfs2.h
@@ -613,6 +613,31 @@ TRACE_EVENT(gfs2_rs,
rs_func_name(__entry->func), (unsigned long)__entry->free)
);
+TRACE_EVENT(gfs2_end_log_read,
+
+ TP_PROTO(const struct gfs2_jdesc *jd),
+
+
+ TP_ARGS(jd),
+
+ TP_STRUCT__entry(
+ __field( dev_t, dev )
+ __field( unsigned int, jid )
+ __field( unsigned int, pages )
+ ),
+
+ TP_fast_assign(
+ __entry->dev = jd->jd_inode->i_sb->s_dev;
+ __entry->jid = jd->jd_jid;
+ __entry->pages = atomic_read(&jd->jd_rd_pg_ct);
+ ),
+
+ TP_printk("%u,%u end_log_read jid:%u outstanding pages:%u",
+ MAJOR(__entry->dev), MINOR(__entry->dev),
+ (unsigned int)__entry->jid,
+ (unsigned int)__entry->pages)
+);
+
#endif /* _TRACE_GFS2_H */
/* This part must be outside protection */
--
2.4.11
prev parent reply other threads:[~2018-08-13 4:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 4:48 [Cluster-devel] [RFC v2 PATCH 0/5] Speed up journal head lookup Abhi Das
2018-08-13 4:48 ` [Cluster-devel] [RFC v2 PATCH 1/5] gfs2: allow map_journal_extents() to take a journal descriptor as argument Abhi Das
2018-08-13 4:48 ` [Cluster-devel] [RFC v2 PATCH 2/5] gfs2: add timing info for various stages of journal recovery Abhi Das
2018-08-13 4:48 ` [Cluster-devel] [RFC v2 PATCH 3/5] gfs2: changes to gfs2_log_XXX_bio Abhi Das
2018-08-13 4:48 ` [Cluster-devel] [RFC v2 PATCH 4/5] gfs2: read journal in large chunks to locate the head Abhi Das
2018-08-13 4:48 ` Abhi Das [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=1534135729-60721-6-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 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).