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] GFS2: Reduce number of log flushes
Date: Wed, 8 Aug 2012 16:10:19 -0400 (EDT)	[thread overview]
Message-ID: <1354979953.4033641.1344456619278.JavaMail.root@redhat.com> (raw)

Hi,

This patch reduces the number of log flushes.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
---
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 4bdcf37..7d795e7 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -118,7 +118,13 @@ void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)
 		return;
 	__gfs2_ail_flush(gl, fsync);
 	gfs2_trans_end(sdp);
-	gfs2_log_flush(sdp, NULL);
+	/* if fsync is true, we were called from gfs2_fsync, which means
+	   we just called sync_inode_metadata, which calls sync_inode,
+	   which calls writeback_single_inode, which calls write_inode,
+	   which calls write_inode which calls gfs2_log_flush. So the call
+	   is redundant. */
+	if (!fsync)
+		gfs2_log_flush(sdp, NULL);
 }
 
 /**
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 3cbac68..5904ce0 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1542,7 +1542,11 @@ static void gfs2_evict_inode(struct inode *inode)
 	goto out_unlock;
 
 out_truncate:
-	gfs2_log_flush(sdp, ip->i_gl);
+	/* write_inode_now calls writeback_single_inode, which calls
+	   gfs2_write_inode. gfs2_write_inode calls gfs2_log_flush if
+	   (wbc->sync_mode == WB_SYNC_ALL), which it is since we pass 1.
+	   therefore, this call to gfs2_log_flush is redundant:
+	   gfs2_log_flush(sdp, ip->i_gl); */
 	write_inode_now(inode, 1);
 	gfs2_ail_flush(ip->i_gl, 0);
 



             reply	other threads:[~2012-08-08 20:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 20:10 Bob Peterson [this message]
2012-08-09  9:04 ` [Cluster-devel] [GFS2 PATCH] GFS2: Reduce number of log flushes Steven Whitehouse
2012-08-09 15:12   ` [Cluster-devel] [GFS2 PATCH][TRY #2] GFS2: eliminate redundant log flush Bob Peterson
2012-09-14 14:42     ` Bob Peterson
2012-09-14 14:45       ` 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=1354979953.4033641.1344456619278.JavaMail.root@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).