提交 1bce63d1 编写于 作者: S Shaohua Li 提交者: Theodore Ts'o

ext4: add block plug for .writepages

Add block plug for ext4 .writepages. Though ext4 .writepages
already handles request merge very well, block plug is still
helpful to reduce block lock contention.
Signed-off-by: NShaohua Li <shaohua.li@intel.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 f6f96fdb
...@@ -2160,6 +2160,7 @@ static int ext4_da_writepages(struct address_space *mapping, ...@@ -2160,6 +2160,7 @@ static int ext4_da_writepages(struct address_space *mapping,
struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
pgoff_t done_index = 0; pgoff_t done_index = 0;
pgoff_t end; pgoff_t end;
struct blk_plug plug;
trace_ext4_da_writepages(inode, wbc); trace_ext4_da_writepages(inode, wbc);
...@@ -2238,6 +2239,7 @@ static int ext4_da_writepages(struct address_space *mapping, ...@@ -2238,6 +2239,7 @@ static int ext4_da_writepages(struct address_space *mapping,
if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
tag_pages_for_writeback(mapping, index, end); tag_pages_for_writeback(mapping, index, end);
blk_start_plug(&plug);
while (!ret && wbc->nr_to_write > 0) { while (!ret && wbc->nr_to_write > 0) {
/* /*
...@@ -2302,6 +2304,7 @@ static int ext4_da_writepages(struct address_space *mapping, ...@@ -2302,6 +2304,7 @@ static int ext4_da_writepages(struct address_space *mapping,
*/ */
break; break;
} }
blk_finish_plug(&plug);
if (!io_done && !cycled) { if (!io_done && !cycled) {
cycled = 1; cycled = 1;
index = 0; index = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册