linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: linux-kernel@vger.kernel.org, jaxboe@fusionio.com,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Cc: vgoyal@redhat.com, khlebnikov@openvz.org, jmoyer@redhat.com
Subject: [PATCH 2/3] ext4: Explicitly specify fsync dependency on journaling thread
Date: Mon, 27 Jun 2011 16:17:43 -0400	[thread overview]
Message-ID: <1309205864-13124-3-git-send-email-vgoyal@redhat.com> (raw)
In-Reply-To: <1309205864-13124-1-git-send-email-vgoyal@redhat.com>

Set/reset fsync dependency of fsync on journalling thread. This allows
CFQ to dispatch IO from journalling thread in fsync's time slice.
Otherwise, lots of cfq queue idling takes place if fsync is running
in a separate cgroup and journalling thread is running in root group.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 fs/ext4/fsync.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index ce66d2f..8b16a90 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -216,7 +216,10 @@ int ext4_sync_file(struct file *file, int datasync)
 	    !jbd2_trans_will_send_data_barrier(journal, commit_tid))
 		needs_barrier = true;
 	jbd2_log_start_commit(journal, commit_tid);
+	blk_set_depends_on_task(journal->j_dev->bd_disk->queue,
+				journal->j_task);
 	ret = jbd2_log_wait_commit(journal, commit_tid);
+	blk_reset_depends_on_task(journal->j_dev->bd_disk->queue);
 	if (needs_barrier)
 		blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
  out:
-- 
1.7.4.4


  parent reply	other threads:[~2011-06-27 20:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 20:17 [RFC PATCH 0/3] block: Fix fsync slowness with CFQ cgroups Vivek Goyal
2011-06-27 20:17 ` [PATCH 1/3] block: A new interface for specifying IO dependencing among tasks Vivek Goyal
2011-06-27 20:17 ` Vivek Goyal [this message]
2011-06-27 20:17 ` [PATCH 3/3] ext3: Explicitly specify fsync dependency on journaling thread Vivek Goyal
2011-06-28  1:18 ` [RFC PATCH 0/3] block: Fix fsync slowness with CFQ cgroups Shaohua Li
2011-06-28  1:40   ` Vivek Goyal
2011-06-28  2:03     ` Shaohua Li
2011-06-28 13:04       ` Vivek Goyal
2011-06-29  1:04         ` Shaohua Li
2011-06-29  1:29           ` Vivek Goyal
2011-06-30  0:29             ` Shaohua Li
2011-06-28  2:47 ` Dave Chinner
2011-06-28 13:35   ` Vivek Goyal
2011-06-28 11:00 ` Konstantin Khlebnikov
2011-06-28 13:45   ` Vivek Goyal
2011-06-28 14:42     ` Konstantin Khlebnikov
2011-06-28 14:47       ` Vivek Goyal
2011-06-28 21:20         ` Vivek Goyal

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=1309205864-13124-3-git-send-email-vgoyal@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=jaxboe@fusionio.com \
    --cc=jmoyer@redhat.com \
    --cc=khlebnikov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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).