summaryrefslogtreecommitdiff
path: root/fs/jbd
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-06-07 07:56:50 +0400
committerJan Kara <jack@suse.cz>2011-06-28 02:06:41 +0400
commita212d1a71deea10ba4f6de2aaac0221be34ddb29 (patch)
tree72e29079ed4ff990219b7b98fd8fa89230605962 /fs/jbd
parentbb189247f35688a3353545902c56290fb7d7754a (diff)
downloadlinux-a212d1a71deea10ba4f6de2aaac0221be34ddb29.tar.xz
jbd: Use WRITE_SYNC in journal checkpoint.
In journal checkpoint, we write the buffer and wait for its finish. But in cfq, the async queue has a very low priority, and in our test, if there are too many sync queues and every queue is filled up with requests, and the process will hang waiting for the log space. So this patch tries to use WRITE_SYNC in __flush_batch so that the request will be moved into sync queue and handled by cfq timely. We also use the new plug, sot that all the WRITE_SYNC requests can be given as a whole when we unplug it. Reported-by: Robin Dong <sanbai@taobao.com> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/checkpoint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index 61655a37c731..f94fc48ff3a0 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -22,6 +22,7 @@
#include <linux/jbd.h>
#include <linux/errno.h>
#include <linux/slab.h>
+#include <linux/blkdev.h>
#include <trace/events/jbd.h>
/*
@@ -257,9 +258,12 @@ static void
__flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
{
int i;
+ struct blk_plug plug;
+ blk_start_plug(&plug);
for (i = 0; i < *batch_count; i++)
- write_dirty_buffer(bhs[i], WRITE);
+ write_dirty_buffer(bhs[i], WRITE_SYNC);
+ blk_finish_plug(&plug);
for (i = 0; i < *batch_count; i++) {
struct buffer_head *bh = bhs[i];