Skip to content

Commit 1fca3a0

Browse files
Hisashi HifumiMark Fasheh
authored andcommitted
ocfs2: Pagecache usage optimization on ocfs2
A page can have multiple buffers and even if a page is not uptodate, some buffers can be uptodate on pagesize != blocksize environment. This aops checks that all buffers which correspond to a part of a file that we want to read are uptodate. If so, we do not have to issue actual read IO to HDD even if a page is not uptodate because the portion we want to read are uptodate. "block_is_partially_uptodate" function is already used by ext2/3/4. With the following patch random read/write mixed workloads or random read after random write workloads can be optimized and we can get performance improvement. Signed-off-by: Hisashi Hifumi <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
1 parent 6ca497a commit 1fca3a0

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

fs/ocfs2/aops.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,15 +1956,16 @@ static int ocfs2_write_end(struct file *file, struct address_space *mapping,
19561956
}
19571957

19581958
const struct address_space_operations ocfs2_aops = {
1959-
.readpage = ocfs2_readpage,
1960-
.readpages = ocfs2_readpages,
1961-
.writepage = ocfs2_writepage,
1962-
.write_begin = ocfs2_write_begin,
1963-
.write_end = ocfs2_write_end,
1964-
.bmap = ocfs2_bmap,
1965-
.sync_page = block_sync_page,
1966-
.direct_IO = ocfs2_direct_IO,
1967-
.invalidatepage = ocfs2_invalidatepage,
1968-
.releasepage = ocfs2_releasepage,
1969-
.migratepage = buffer_migrate_page,
1959+
.readpage = ocfs2_readpage,
1960+
.readpages = ocfs2_readpages,
1961+
.writepage = ocfs2_writepage,
1962+
.write_begin = ocfs2_write_begin,
1963+
.write_end = ocfs2_write_end,
1964+
.bmap = ocfs2_bmap,
1965+
.sync_page = block_sync_page,
1966+
.direct_IO = ocfs2_direct_IO,
1967+
.invalidatepage = ocfs2_invalidatepage,
1968+
.releasepage = ocfs2_releasepage,
1969+
.migratepage = buffer_migrate_page,
1970+
.is_partially_uptodate = block_is_partially_uptodate,
19701971
};

0 commit comments

Comments
 (0)