cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] GFS2: Use filemap_fdatawrite() to write back the AIL
Date: Wed, 30 Mar 2011 16:49:14 +0100	[thread overview]
Message-ID: <1301500154.2522.49.camel@dolmen> (raw)


In order to ensure that the mapping stats (and thus the bdi) are correctly
updated, this patch changes the AIL writeback to use the filemap_datawrite
function. This helps prevent stalls in balance_dirty_pages() due to
large amounts of dirty metadata when there is little or no dirty data
around.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>


diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index e7ed31f..6a0ab77 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -91,6 +91,7 @@ static void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
 __releases(&sdp->sd_ail_lock)
 __acquires(&sdp->sd_ail_lock)
 {
+	struct gfs2_glock *gl = NULL;
 	struct gfs2_bufdata *bd, *s;
 	struct buffer_head *bh;
 	int retry;
@@ -113,19 +114,13 @@ __acquires(&sdp->sd_ail_lock)
 
 			if (!buffer_dirty(bh))
 				continue;
-
+			if (gl == bd->bd_gl)
+				continue;
+			gl = bd->bd_gl;
 			list_move(&bd->bd_ail_st_list, &ai->ai_ail1_list);
 
-			get_bh(bh);
 			spin_unlock(&sdp->sd_ail_lock);
-			lock_buffer(bh);
-			if (test_clear_buffer_dirty(bh)) {
-				bh->b_end_io = end_buffer_write_sync;
-				submit_bh(WRITE_SYNC_PLUG, bh);
-			} else {
-				unlock_buffer(bh);
-				brelse(bh);
-			}
+			filemap_fdatawrite(gfs2_glock2aspace(gl));
 			spin_lock(&sdp->sd_ail_lock);
 
 			retry = 1;




                 reply	other threads:[~2011-03-30 15:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1301500154.2522.49.camel@dolmen \
    --to=swhiteho@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).