aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-04-24 00:19:56 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-04-25 21:35:10 -0400
commitc718379b6b0954a04a153d7e5dc8b3136a301ee6 (patch)
treeeca5d2d44291de009acb51ebc934f70de6d0ffa7 /fs/f2fs/data.c
parent6cb968d9b0358c7e807416a85699a526e820083c (diff)
f2fs: give a chance to merge IOs by IO scheduler
Previously, background GC submits many 4KB read requests to load victim blocks and/or its (i)node blocks. ... f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb61, blkaddr = 0x3b964ed f2fs_gc : block_rq_complete: 8,16 R () 499854968 + 8 [0] f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb6f, blkaddr = 0x3b964ee f2fs_gc : block_rq_complete: 8,16 R () 499854976 + 8 [0] f2fs_gc : f2fs_readpage: ino = 1, page_index = 0xb79, blkaddr = 0x3b964ef f2fs_gc : block_rq_complete: 8,16 R () 499854984 + 8 [0] ... However, by the fact that many IOs are sequential, we can give a chance to merge the IOs by IO scheduler. In order to do that, let's use blk_plug. ... f2fs_gc : f2fs_iget: ino = 143 f2fs_gc : f2fs_readpage: ino = 143, page_index = 0x1c6, blkaddr = 0x2e6ee f2fs_gc : f2fs_iget: ino = 143 f2fs_gc : f2fs_readpage: ino = 143, page_index = 0x1c7, blkaddr = 0x2e6ef <idle> : block_rq_complete: 8,16 R () 1519616 + 8 [0] <idle> : block_rq_complete: 8,16 R () 1519848 + 8 [0] <idle> : block_rq_complete: 8,16 R () 1520432 + 96 [0] <idle> : block_rq_complete: 8,16 R () 1520536 + 104 [0] <idle> : block_rq_complete: 8,16 R () 1521008 + 112 [0] <idle> : block_rq_complete: 8,16 R () 1521440 + 152 [0] <idle> : block_rq_complete: 8,16 R () 1521688 + 144 [0] <idle> : block_rq_complete: 8,16 R () 1522128 + 192 [0] <idle> : block_rq_complete: 8,16 R () 1523256 + 328 [0] ... Note that this issue should be addressed in checkpoint, and some readahead flows too. Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 1220b5c2ea21..eba7e84d1ffd 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -172,7 +172,7 @@ end_update:
172 return; 172 return;
173} 173}
174 174
175struct page *find_data_page(struct inode *inode, pgoff_t index) 175struct page *find_data_page(struct inode *inode, pgoff_t index, bool sync)
176{ 176{
177 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); 177 struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
178 struct address_space *mapping = inode->i_mapping; 178 struct address_space *mapping = inode->i_mapping;
@@ -207,11 +207,14 @@ struct page *find_data_page(struct inode *inode, pgoff_t index)
207 return page; 207 return page;
208 } 208 }
209 209
210 err = f2fs_readpage(sbi, page, dn.data_blkaddr, READ_SYNC); 210 err = f2fs_readpage(sbi, page, dn.data_blkaddr,
211 wait_on_page_locked(page); 211 sync ? READ_SYNC : READA);
212 if (!PageUptodate(page)) { 212 if (sync) {
213 f2fs_put_page(page, 0); 213 wait_on_page_locked(page);
214 return ERR_PTR(-EIO); 214 if (!PageUptodate(page)) {
215 f2fs_put_page(page, 0);
216 return ERR_PTR(-EIO);
217 }
215 } 218 }
216 return page; 219 return page;
217} 220}