aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.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/node.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/node.c')
-rw-r--r--fs/f2fs/node.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 5a825502b0b0..a0aa0446a237 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -89,10 +89,13 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
89{ 89{
90 struct address_space *mapping = sbi->meta_inode->i_mapping; 90 struct address_space *mapping = sbi->meta_inode->i_mapping;
91 struct f2fs_nm_info *nm_i = NM_I(sbi); 91 struct f2fs_nm_info *nm_i = NM_I(sbi);
92 struct blk_plug plug;
92 struct page *page; 93 struct page *page;
93 pgoff_t index; 94 pgoff_t index;
94 int i; 95 int i;
95 96
97 blk_start_plug(&plug);
98
96 for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) { 99 for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) {
97 if (nid >= nm_i->max_nid) 100 if (nid >= nm_i->max_nid)
98 nid = 0; 101 nid = 0;
@@ -110,6 +113,7 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
110 113
111 f2fs_put_page(page, 0); 114 f2fs_put_page(page, 0);
112 } 115 }
116 blk_finish_plug(&plug);
113} 117}
114 118
115static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n) 119static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n)
@@ -942,6 +946,7 @@ struct page *get_node_page_ra(struct page *parent, int start)
942{ 946{
943 struct f2fs_sb_info *sbi = F2FS_SB(parent->mapping->host->i_sb); 947 struct f2fs_sb_info *sbi = F2FS_SB(parent->mapping->host->i_sb);
944 struct address_space *mapping = sbi->node_inode->i_mapping; 948 struct address_space *mapping = sbi->node_inode->i_mapping;
949 struct blk_plug plug;
945 struct page *page; 950 struct page *page;
946 int err, i, end; 951 int err, i, end;
947 nid_t nid; 952 nid_t nid;
@@ -961,6 +966,8 @@ struct page *get_node_page_ra(struct page *parent, int start)
961 else if (err == LOCKED_PAGE) 966 else if (err == LOCKED_PAGE)
962 goto page_hit; 967 goto page_hit;
963 968
969 blk_start_plug(&plug);
970
964 /* Then, try readahead for siblings of the desired node */ 971 /* Then, try readahead for siblings of the desired node */
965 end = start + MAX_RA_NODE; 972 end = start + MAX_RA_NODE;
966 end = min(end, NIDS_PER_BLOCK); 973 end = min(end, NIDS_PER_BLOCK);
@@ -971,6 +978,8 @@ struct page *get_node_page_ra(struct page *parent, int start)
971 ra_node_page(sbi, nid); 978 ra_node_page(sbi, nid);
972 } 979 }
973 980
981 blk_finish_plug(&plug);
982
974 lock_page(page); 983 lock_page(page);
975 984
976page_hit: 985page_hit: