aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorHisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>2009-03-05 03:22:21 -0500
committerMark Fasheh <mfasheh@suse.com>2009-04-03 14:39:26 -0400
commit1fca3a05ef2823830925dfb66711d6d920265a8d (patch)
tree95717db99015caf84c8c90ab94af093b3d75d731 /fs
parent6ca497a83e592d64e050c4d04b6dedb8c915f39a (diff)
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 <hifumi.hisashi@oss.ntt.co.jp> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/aops.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 8e1709a679b..b2c52b3a148 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1956,15 +1956,16 @@ static int ocfs2_write_end(struct file *file, struct address_space *mapping,
1956} 1956}
1957 1957
1958const struct address_space_operations ocfs2_aops = { 1958const struct address_space_operations ocfs2_aops = {
1959 .readpage = ocfs2_readpage, 1959 .readpage = ocfs2_readpage,
1960 .readpages = ocfs2_readpages, 1960 .readpages = ocfs2_readpages,
1961 .writepage = ocfs2_writepage, 1961 .writepage = ocfs2_writepage,
1962 .write_begin = ocfs2_write_begin, 1962 .write_begin = ocfs2_write_begin,
1963 .write_end = ocfs2_write_end, 1963 .write_end = ocfs2_write_end,
1964 .bmap = ocfs2_bmap, 1964 .bmap = ocfs2_bmap,
1965 .sync_page = block_sync_page, 1965 .sync_page = block_sync_page,
1966 .direct_IO = ocfs2_direct_IO, 1966 .direct_IO = ocfs2_direct_IO,
1967 .invalidatepage = ocfs2_invalidatepage, 1967 .invalidatepage = ocfs2_invalidatepage,
1968 .releasepage = ocfs2_releasepage, 1968 .releasepage = ocfs2_releasepage,
1969 .migratepage = buffer_migrate_page, 1969 .migratepage = buffer_migrate_page,
1970 .is_partially_uptodate = block_is_partially_uptodate,
1970}; 1971};