Skip to content

Commit a212d1a

Browse files
taoma-tmjankara
authored andcommitted
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 <[email protected]> Signed-off-by: Tao Ma <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent bb18924 commit a212d1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/jbd/checkpoint.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/jbd.h>
2323
#include <linux/errno.h>
2424
#include <linux/slab.h>
25+
#include <linux/blkdev.h>
2526
#include <trace/events/jbd.h>
2627

2728
/*
@@ -257,9 +258,12 @@ static void
257258
__flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
258259
{
259260
int i;
261+
struct blk_plug plug;
260262

263+
blk_start_plug(&plug);
261264
for (i = 0; i < *batch_count; i++)
262-
write_dirty_buffer(bhs[i], WRITE);
265+
write_dirty_buffer(bhs[i], WRITE_SYNC);
266+
blk_finish_plug(&plug);
263267

264268
for (i = 0; i < *batch_count; i++) {
265269
struct buffer_head *bh = bhs[i];

0 commit comments

Comments
 (0)