diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-01 04:49:15 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-08 20:33:29 +0300 |
commit | 237c0790e54020d522b8fd23097e8dcafb4e331d (patch) | |
tree | 57af2ddd9bff9382d6330ca894497d3fb37bfb2e /fs/f2fs/data.c | |
parent | fe76b796fc5194cc3d57265002e3a748566d073f (diff) | |
download | linux-237c0790e54020d522b8fd23097e8dcafb4e331d.tar.xz |
f2fs: call SetPageUptodate if needed
SetPageUptodate() issues memory barrier, resulting in performance degrdation.
Let's avoid that.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 4a2e97dad9e9..b6fd5bd05e41 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -47,7 +47,8 @@ static void f2fs_read_end_io(struct bio *bio) struct page *page = bvec->bv_page; if (!bio->bi_error) { - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); } else { ClearPageUptodate(page); SetPageError(page); @@ -443,7 +444,8 @@ got_it: */ if (dn.data_blkaddr == NEW_ADDR) { zero_user_segment(page, 0, PAGE_SIZE); - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); unlock_page(page); return page; } @@ -554,7 +556,8 @@ struct page *get_new_data_page(struct inode *inode, if (dn.data_blkaddr == NEW_ADDR) { zero_user_segment(page, 0, PAGE_SIZE); - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); } else { f2fs_put_page(page, 1); @@ -1065,7 +1068,8 @@ got_it: } } else { zero_user_segment(page, 0, PAGE_SIZE); - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); unlock_page(page); goto next_page; } @@ -1659,7 +1663,8 @@ repeat: } } out_update: - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); out_clear: clear_cold_data(page); return 0; @@ -1813,7 +1818,8 @@ static int f2fs_set_data_page_dirty(struct page *page) trace_f2fs_set_page_dirty(page, DATA); - SetPageUptodate(page); + if (!PageUptodate(page)) + SetPageUptodate(page); if (f2fs_is_atomic_file(inode)) { if (!IS_ATOMIC_WRITTEN_PAGE(page)) { |