linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: akpm@osdl.org, sct@redhat.com
Cc: linux-fsdevel@vger.kernel.org
Subject: [JBD] change batching logic to improve O_SYNC performance
Date: Thu, 15 Dec 2005 09:59:51 -0500	[thread overview]
Message-ID: <20051215145951.GB2444@kvack.org> (raw)

Hello folks,

When writing files out using O_SYNC, jbd's 1 jiffy delay results in a 
significant drop in throughput as the disk sits idle.  The patch below 
results in a 4-5x performance improvement (from 6.5MB/s to ~24-30MB/s on 
my IDE test box) when writing out files using O_SYNC.  Instead of always 
delaying for 1 jiffy when trying to batch, merely do a yield() to allow 
other processes to execute and potentially batch requests.  Additionally, 
limit the delay to an absolute max of 1/50th of a second.  

		-ben

Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 429f4b2..9c84ad0 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -1335,10 +1335,12 @@ int journal_stop(handle_t *handle)
 	 * by 30x or more...
 	 */
 	if (handle->h_sync) {
+		long start = jiffies;
 		do {
 			old_handle_count = transaction->t_handle_count;
-			schedule_timeout_uninterruptible(1);
-		} while (old_handle_count != transaction->t_handle_count);
+			yield();
+		} while (old_handle_count != transaction->t_handle_count &&
+			 (jiffies - start < HZ/50));
 	}
 
 	current->journal_info = NULL;
-- 
"You know, I've seen some crystals do some pretty trippy shit, man."
Don't Email: <dont@kvack.org>.

             reply	other threads:[~2005-12-15 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 14:59 Benjamin LaHaise [this message]
2005-12-15 14:22 ` [JBD] change batching logic to improve O_SYNC performance Ric Wheeler
2005-12-15 23:55 ` Andrew Morton
2005-12-15 21:39   ` Ric Wheeler
2005-12-16  0:48   ` Andreas Dilger

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=20051215145951.GB2444@kvack.org \
    --to=bcrl@kvack.org \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sct@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).