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] [GFS2 PATCH 02/12] gfs2: add missing log_blocks trace points in gfs2_write_revokes
Date: Fri, 21 Aug 2020 12:33:27 -0500	[thread overview]
Message-ID: <20200821173337.20377-3-rpeterso@redhat.com> (raw)
In-Reply-To: <20200821173337.20377-1-rpeterso@redhat.com>

Function gfs2_write_revokes was incrementing and decrementing the number
of log blocks free, but there was never a log_blocks trace point for it.
Thus, the free blocks from a log_blocks trace would jump around
mysteriously.

This patch adds the missing trace points so the trace makes more sense.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/log.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index a58333e3980d..01a645652a7d 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -716,16 +716,24 @@ void gfs2_write_revokes(struct gfs2_sbd *sdp)
 		atomic_dec(&sdp->sd_log_blks_free);
 		/* If no blocks have been reserved, we need to also
 		 * reserve a block for the header */
-		if (!sdp->sd_log_blks_reserved)
+		if (!sdp->sd_log_blks_reserved) {
 			atomic_dec(&sdp->sd_log_blks_free);
+			trace_gfs2_log_blocks(sdp, -2);
+		} else {
+			trace_gfs2_log_blocks(sdp, -1);
+		}
 	}
 	gfs2_ail1_empty(sdp, max_revokes);
 	gfs2_log_unlock(sdp);
 
 	if (!sdp->sd_log_num_revoke) {
 		atomic_inc(&sdp->sd_log_blks_free);
-		if (!sdp->sd_log_blks_reserved)
+		if (!sdp->sd_log_blks_reserved) {
 			atomic_inc(&sdp->sd_log_blks_free);
+			trace_gfs2_log_blocks(sdp, 2);
+		} else {
+			trace_gfs2_log_blocks(sdp, 1);
+		}
 	}
 }
 
-- 
2.26.2



  parent reply	other threads:[~2020-08-21 17:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 17:33 [Cluster-devel] [GFS2 PATCH 00/12] gfs2: jdata patch collection revisited Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 01/12] gfs2: rename gfs2_write_full_page to gfs2_write_jdata_page, remove parm Bob Peterson
2020-08-21 17:33 ` Bob Peterson [this message]
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 03/12] gfs2: enhance log_blocks trace point to show log blocks free Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 04/12] gfs2: Wipe jdata and ail1 in gfs2_journal_wipe, formerly gfs2_meta_wipe Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 05/12] gfs2: Calculate number of revokes during evict Bob Peterson
2020-08-27  6:00   ` Andreas Gruenbacher
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 06/12] gfs2: Create transaction for inodes with i_nlink != 0 Bob Peterson
2020-08-27  6:00   ` Andreas Gruenbacher
2020-08-27  7:41     ` Steven Whitehouse
2020-08-27 13:00     ` Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 07/12] gfs2: make gfs2_ail1_empty_one return the count of active items Bob Peterson
2020-08-27  6:00   ` Andreas Gruenbacher
2020-08-27 16:45     ` Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 08/12] gfs2: don't lock sd_ail_lock in gfs2_releasepage Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 09/12] gfs2: Only set PageChecked if we have a transaction Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 10/12] gfs2: simplify gfs2_block_map Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 11/12] gfs2: Ignore journal log writes for jdata holes Bob Peterson
2020-08-21 17:33 ` [Cluster-devel] [GFS2 PATCH 12/12] gfs2: add some much needed cleanup for log flushes that fail Bob Peterson

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=20200821173337.20377-3-rpeterso@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).