From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: don't drop compressed page cache in .{invalidate, release}page
Date: Thu, 16 Dec 2021 11:36:46 -0800 [thread overview]
Message-ID: <YbuVTuA5ivCjra40@google.com> (raw)
In-Reply-To: <20211216091356.6643-1-chao@kernel.org>
On 12/16, Chao Yu wrote:
> For compressed inode, in .{invalidate,release}page, we will call
> f2fs_invalidate_compress_pages() to drop all compressed page cache of
> current inode.
>
> But we don't need to drop compressed page cache synchronously in
> .invalidatepage, because, all trancation paths of compressed physical
> block has been covered with f2fs_invalidate_compress_page().
>
> And also we don't need to drop compressed page cache synchronously
> in .releasepage, because, if there is out-of-memory, we can count
> on page cache reclaim on sbi->compress_inode.
>
> BTW, this patch may fix the issue reported below:
>
> https://lore.kernel.org/linux-f2fs-devel/20211202092812.197647-1-changfengnan@vivo.com/T/#u
I think this patch makes more sense to me.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - fix compile error.
> fs/f2fs/data.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 2737fcc0dbcf..0fc6e0245732 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -3528,12 +3528,9 @@ void f2fs_invalidate_page(struct page *page, unsigned int offset,
>
> clear_page_private_gcing(page);
>
> - if (test_opt(sbi, COMPRESS_CACHE)) {
> - if (f2fs_compressed_file(inode))
> - f2fs_invalidate_compress_pages(sbi, inode->i_ino);
> - if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
> - clear_page_private_data(page);
> - }
> + if (test_opt(sbi, COMPRESS_CACHE) &&
> + inode->i_ino == F2FS_COMPRESS_INO(sbi))
> + clear_page_private_data(page);
>
> if (page_private_atomic(page))
> return f2fs_drop_inmem_page(inode, page);
> @@ -3553,12 +3550,9 @@ int f2fs_release_page(struct page *page, gfp_t wait)
> return 0;
>
> if (test_opt(F2FS_P_SB(page), COMPRESS_CACHE)) {
> - struct f2fs_sb_info *sbi = F2FS_P_SB(page);
> struct inode *inode = page->mapping->host;
>
> - if (f2fs_compressed_file(inode))
> - f2fs_invalidate_compress_pages(sbi, inode->i_ino);
> - if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
> + if (inode->i_ino == F2FS_COMPRESS_INO(F2FS_I_SB(inode)))
> clear_page_private_data(page);
> }
>
> --
> 2.32.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] f2fs: don't drop compressed page cache in .{invalidate,release}page
Date: Thu, 16 Dec 2021 11:36:46 -0800 [thread overview]
Message-ID: <YbuVTuA5ivCjra40@google.com> (raw)
In-Reply-To: <20211216091356.6643-1-chao@kernel.org>
On 12/16, Chao Yu wrote:
> For compressed inode, in .{invalidate,release}page, we will call
> f2fs_invalidate_compress_pages() to drop all compressed page cache of
> current inode.
>
> But we don't need to drop compressed page cache synchronously in
> .invalidatepage, because, all trancation paths of compressed physical
> block has been covered with f2fs_invalidate_compress_page().
>
> And also we don't need to drop compressed page cache synchronously
> in .releasepage, because, if there is out-of-memory, we can count
> on page cache reclaim on sbi->compress_inode.
>
> BTW, this patch may fix the issue reported below:
>
> https://lore.kernel.org/linux-f2fs-devel/20211202092812.197647-1-changfengnan@vivo.com/T/#u
I think this patch makes more sense to me.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - fix compile error.
> fs/f2fs/data.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 2737fcc0dbcf..0fc6e0245732 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -3528,12 +3528,9 @@ void f2fs_invalidate_page(struct page *page, unsigned int offset,
>
> clear_page_private_gcing(page);
>
> - if (test_opt(sbi, COMPRESS_CACHE)) {
> - if (f2fs_compressed_file(inode))
> - f2fs_invalidate_compress_pages(sbi, inode->i_ino);
> - if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
> - clear_page_private_data(page);
> - }
> + if (test_opt(sbi, COMPRESS_CACHE) &&
> + inode->i_ino == F2FS_COMPRESS_INO(sbi))
> + clear_page_private_data(page);
>
> if (page_private_atomic(page))
> return f2fs_drop_inmem_page(inode, page);
> @@ -3553,12 +3550,9 @@ int f2fs_release_page(struct page *page, gfp_t wait)
> return 0;
>
> if (test_opt(F2FS_P_SB(page), COMPRESS_CACHE)) {
> - struct f2fs_sb_info *sbi = F2FS_P_SB(page);
> struct inode *inode = page->mapping->host;
>
> - if (f2fs_compressed_file(inode))
> - f2fs_invalidate_compress_pages(sbi, inode->i_ino);
> - if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
> + if (inode->i_ino == F2FS_COMPRESS_INO(F2FS_I_SB(inode)))
> clear_page_private_data(page);
> }
>
> --
> 2.32.0
next prev parent reply other threads:[~2021-12-16 19:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 9:13 [f2fs-dev] [PATCH v2] f2fs: don't drop compressed page cache in .{invalidate, release}page Chao Yu
2021-12-16 9:13 ` [PATCH v2] f2fs: don't drop compressed page cache in .{invalidate,release}page Chao Yu
2021-12-16 19:36 ` Jaegeuk Kim [this message]
2021-12-16 19:36 ` 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=YbuVTuA5ivCjra40@google.com \
--to=jaegeuk@kernel.org \
--cc=chao@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.