From: Changman Lee <cm224.lee@samsung.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/3] f2fs: call flush_dcache_page when the page was updated
Date: Thu, 20 Nov 2014 15:04:10 +0900 [thread overview]
Message-ID: <20141120060410.GB3117@lcm> (raw)
In-Reply-To: <1416436510-6251-1-git-send-email-jaegeuk@kernel.org>
Hi Jaegeuk,
We should call flush_dcache_page before kunmap because the purpose of the cache flush is to address aliasing problem related to virtual address.
On Wed, Nov 19, 2014 at 02:35:08PM -0800, Jaegeuk Kim wrote:
> Whenever f2fs updates mapped pages, it needs to call flush_dcache_page.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/dir.c | 7 ++++++-
> fs/f2fs/inline.c | 4 +++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
> index 5a49995..312fbfc 100644
> --- a/fs/f2fs/dir.c
> +++ b/fs/f2fs/dir.c
> @@ -287,8 +287,10 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
> f2fs_wait_on_page_writeback(page, type);
> de->ino = cpu_to_le32(inode->i_ino);
> set_de_type(de, inode);
> - if (!f2fs_has_inline_dentry(dir))
> + if (!f2fs_has_inline_dentry(dir)) {
> kunmap(page);
> + flush_dcache_page(page);
> + }
> set_page_dirty(page);
> dir->i_mtime = dir->i_ctime = CURRENT_TIME;
> mark_inode_dirty(dir);
> @@ -366,6 +368,7 @@ static int make_empty_dir(struct inode *inode,
> do_make_empty_dir(inode, parent, &d);
>
> kunmap_atomic(dentry_blk);
> + flush_dcache_page(dentry_page);
>
> set_page_dirty(dentry_page);
> f2fs_put_page(dentry_page, 1);
> @@ -579,6 +582,7 @@ fail:
> clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR);
> }
> kunmap(dentry_page);
> + flush_dcache_page(dentry_page);
> f2fs_put_page(dentry_page, 1);
> return err;
> }
> @@ -661,6 +665,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
> NR_DENTRY_IN_BLOCK,
> 0);
> kunmap(page); /* kunmap - pair of f2fs_find_entry */
> + flush_dcache_page(page);
> set_page_dirty(page);
>
> dir->i_ctime = dir->i_mtime = CURRENT_TIME;
> diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
> index f26fb87..8b7cc51 100644
> --- a/fs/f2fs/inline.c
> +++ b/fs/f2fs/inline.c
> @@ -45,8 +45,8 @@ void read_inline_data(struct page *page, struct page *ipage)
> src_addr = inline_data_addr(ipage);
> dst_addr = kmap_atomic(page);
> memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
> - flush_dcache_page(page);
> kunmap_atomic(dst_addr);
> + flush_dcache_page(page);
> SetPageUptodate(page);
> }
>
> @@ -107,6 +107,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
> dst_addr = kmap_atomic(page);
> memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
> kunmap_atomic(dst_addr);
> + flush_dcache_page(page);
> SetPageUptodate(page);
> no_update:
> /* write data page to try to make data consistent */
> @@ -358,6 +359,7 @@ static int f2fs_convert_inline_dir(struct inode *dir, struct page *ipage,
> NR_INLINE_DENTRY * F2FS_SLOT_LEN);
>
> kunmap_atomic(dentry_blk);
> + flush_dcache_page(page);
> SetPageUptodate(page);
> set_page_dirty(page);
>
> --
> 2.1.1
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
next prev parent reply other threads:[~2014-11-20 6:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 22:35 [PATCH 1/3] f2fs: call flush_dcache_page when the page was updated Jaegeuk Kim
2014-11-19 22:35 ` [PATCH 2/3] f2fs: submit bio for node blocks in the reclaim path Jaegeuk Kim
2014-11-19 22:35 ` [PATCH 3/3] f2fs: write SSA pages under memory pressure Jaegeuk Kim
2014-11-20 6:04 ` Changman Lee [this message]
2014-11-20 6:45 ` [f2fs-dev] [PATCH 1/3] f2fs: call flush_dcache_page when the page was updated Jaegeuk Kim
2014-11-20 8:47 ` Changman Lee
2014-11-23 10:08 ` Simon Baatz
2014-11-24 2:46 ` Changman Lee
2014-11-24 6:04 ` [f2fs-dev] " Jaegeuk Kim
2014-11-25 19:05 ` Simon Baatz
2014-11-25 22:35 ` [f2fs-dev] " Changman Lee
2014-11-24 6:01 ` Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141120060410.GB3117@lcm \
--to=cm224.lee@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).