Hi all, Could we move IPU judgement outside cp_rwsem lock like below:
if (set ipu policy) if (ipu success) return lock_op opu unlock_op And at same time when we write new checkpoint, we set ipu policy during whole cp, the process is like this: ....|----OPU----|----IPU(write cp)----|----OPU----|----IPU(write cp)----|.... Thanks. On 2017/4/21 17:56, Hou Pengyang wrote: > If a page is cold, NOT atomit written and need_ipu now, there is > a high probability that IPU should be adapted. For IPU, we try to > check extent tree to get the block index first, instead of reading > the dnode page, where may lead to an useless dnode IO, since no need to > update the dnode index for IPU. > > Signed-off-by: Hou Pengyang <houpengy...@huawei.com> > --- > fs/f2fs/data.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 4ba11a6..3a660f7 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -1355,8 +1355,34 @@ int do_write_data_page(struct f2fs_io_info *fio) > struct page *page = fio->page; > struct inode *inode = page->mapping->host; > struct dnode_of_data dn; > + struct extent_info ei = {0,0,0}; > int err = 0; > > + /* > + * If a page is cold, NOT atomit written and need_ipu now, there is > + * a high probability that IPU should be adapted. For IPU, we try to > + * check extent tree to get the block index first, instead of reading > + * the dnode page, where may lead to an useless dnode IO, since no need > to > + * update the dnode index for IPU. > + */ > + if (unlikely(!is_cold_data(page) && > + !IS_ATOMIC_WRITTEN_PAGE(page) && > + need_inplace_update(inode, fio) && > + f2fs_lookup_extent_cache(inode, page->index, &ei))) { > + > + fio->old_blkaddr = ei.blk + page->index - ei.fofs; > + > + if (fio->old_blkaddr != NEW_ADDR && > + fio->old_blkaddr != NULL_ADDR) { > + err = f2fs_encrypt_page(fio, page); > + if (err) > + return err; > + set_page_writeback(page); > + err = do_rewrite_data_page(fio, page); > + return err; > + } > + } > + > set_new_dnode(&dn, inode, NULL, NULL, 0); > err = get_dnode_of_data(&dn, page->index, LOOKUP_NODE); > if (err) > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel