aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-11-20 23:54:23 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-12-22 20:18:02 -0500
commit7107e0a9b131f46785b853388fb263306721a986 (patch)
treefa3032b14ed9cf2e691e8051708b594939967f3f /fs
parent924b720b589f91311657216c97edbb3337449270 (diff)
f2fs: merge read IOs at ra_nat_pages()
Change log from v1: o add mark_page_accessed() not to reclaim the nat pages. This patch changes the policy of submitting read bios at ra_nat_pages. Previously, f2fs submits small read bios with block plugging. But, with this patch, f2fs itself merges read bios first and then submits a large bio, which can reduce the bio handling overheads. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/node.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index b843a5b3d5ee..b212599b0da4 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -89,13 +89,10 @@ 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;
93 struct page *page; 92 struct page *page;
94 pgoff_t index; 93 pgoff_t index;
95 int i; 94 int i;
96 95
97 blk_start_plug(&plug);
98
99 for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) { 96 for (i = 0; i < FREE_NID_PAGES; i++, nid += NAT_ENTRY_PER_BLOCK) {
100 if (nid >= nm_i->max_nid) 97 if (nid >= nm_i->max_nid)
101 nid = 0; 98 nid = 0;
@@ -105,15 +102,15 @@ static void ra_nat_pages(struct f2fs_sb_info *sbi, int nid)
105 if (!page) 102 if (!page)
106 continue; 103 continue;
107 if (PageUptodate(page)) { 104 if (PageUptodate(page)) {
105 mark_page_accessed(page);
108 f2fs_put_page(page, 1); 106 f2fs_put_page(page, 1);
109 continue; 107 continue;
110 } 108 }
111 if (f2fs_readpage(sbi, page, index, READ)) 109 submit_read_page(sbi, page, index, READ_SYNC);
112 continue; 110 mark_page_accessed(page);
113
114 f2fs_put_page(page, 0); 111 f2fs_put_page(page, 0);
115 } 112 }
116 blk_finish_plug(&plug); 113 f2fs_submit_read_bio(sbi, READ_SYNC);
117} 114}
118 115
119static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n) 116static struct nat_entry *__lookup_nat_cache(struct f2fs_nm_info *nm_i, nid_t n)