All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: akpm@linux-foundation.org, jens.axboe@oracle.com
Cc: linux-kernel@vger.kernel.org
Subject: PATCH] fix potential latency issues in JBD's journal code
Date: Fri, 4 Jul 2008 19:29:29 -0700	[thread overview]
Message-ID: <20080704192929.2c4dd4ca@infradead.org> (raw)


From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 4 Jul 2008 19:26:16 -0700
Subject: [PATCH] fix potential latency issues in JBD's journal code
CC: akpm@linux-foundation.org
CC: jens.axboe@oracle.com

This is a follow-on to commit 18ce3751ccd488c78d3827e9f6bf54e6322676fb
(Properly notify block layer of sync writes)
which fixed some severe latency issues due to a "submit IO and then wait for it"
pattern, which got fixed by properly informing the block layer that the IOs in
question are going to be waited on immediately after a batch submission.

In the JBD layer, some of the core journal routines have the exact same pattern
of code, and... surprising (or not)... they're also not using the WRITE_SYNC
variant to inform the blocklayer.

This patch modifies two key places that submit IO that then immediately will
get waited on. The JBD code is slightly convoluted, but after some chasing of
abstraction layers, these instances seem to really be of this pattern.
There's one case in checkpoint.c which is another candidate, but I've not
been able to get my head around the code enough to verify that that one
really is of this pattern as well, so for now I'll leave that one as is.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 fs/jbd/commit.c |    4 ++--
 fs/jbd/revoke.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 5a8ca61..0b348de 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -165,7 +165,7 @@ static void journal_do_submit_data(struct buffer_head **wbuf, int bufs)
 	for (i = 0; i < bufs; i++) {
 		wbuf[i]->b_end_io = end_buffer_write_sync;
 		/* We use-up our safety reference in submit_bh() */
-		submit_bh(WRITE, wbuf[i]);
+		submit_bh(WRITE_SYNC, wbuf[i]);
 	}
 }
 
@@ -622,7 +622,7 @@ start_journal_io:
 				clear_buffer_dirty(bh);
 				set_buffer_uptodate(bh);
 				bh->b_end_io = journal_end_buffer_io_sync;
-				submit_bh(WRITE, bh);
+				submit_bh(WRITE_SYNC, bh);
 			}
 			cond_resched();
 
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 1bb43e9..366ee20 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -616,7 +616,7 @@ static void flush_descriptor(journal_t *journal,
 	set_buffer_jwrite(bh);
 	BUFFER_TRACE(bh, "write");
 	set_buffer_dirty(bh);
-	ll_rw_block(SWRITE, 1, &bh);
+	ll_rw_block(SWRITE_SYNC, 1, &bh);
 }
 #endif
 
-- 
1.5.5.1


-- 
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

             reply	other threads:[~2008-07-05  2:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-05  2:29 Arjan van de Ven [this message]
2008-07-05  5:00 ` PATCH] fix potential latency issues in JBD's journal code Arjan van de Ven
2008-07-05 14:13 ` Theodore Tso
2008-07-05 15:18   ` Arjan van de Ven
2008-07-06  4:15 ` Theodore Tso
2008-07-06  5:30   ` Arjan van de Ven
2008-07-06 12:20     ` Theodore Tso

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=20080704192929.2c4dd4ca@infradead.org \
    --to=arjan@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.