* [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages @ 2021-12-13 8:58 Fengnan Chang 2021-12-21 3:59 ` 常凤楠 0 siblings, 1 reply; 4+ messages in thread From: Fengnan Chang @ 2021-12-13 8:58 UTC (permalink / raw) To: jaegeuk, chao; +Cc: Fengnan Chang, linux-f2fs-devel Compress page will invalidate in truncate block process too, so remove redunant invalidate compress pages in f2fs_evict_inode. Signed-off-by: Fengnan Chang <changfengnan@vivo.com> --- fs/f2fs/inode.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 935016e56010..595270646d69 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode) trace_f2fs_evict_inode(inode); truncate_inode_pages_final(&inode->i_data); - if (test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode)) - f2fs_invalidate_compress_pages(sbi, inode->i_ino); - if (inode->i_ino == F2FS_NODE_INO(sbi) || inode->i_ino == F2FS_META_INO(sbi) || inode->i_ino == F2FS_COMPRESS_INO(sbi)) -- 2.32.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages 2021-12-13 8:58 [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages Fengnan Chang @ 2021-12-21 3:59 ` 常凤楠 2021-12-27 8:10 ` Chao Yu [not found] ` <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==> 0 siblings, 2 replies; 4+ messages in thread From: 常凤楠 @ 2021-12-21 3:59 UTC (permalink / raw) To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net > -----Original Message----- > From: 常凤楠 > Sent: Monday, December 13, 2021 4:59 PM > To: jaegeuk@kernel.org; chao@kernel.org > Cc: linux-f2fs-devel@lists.sourceforge.net; 常凤楠 <changfengnan@vivo.com> > Subject: [PATCH] f2fs: remove redunant invalidate compress pages > > Compress page will invalidate in truncate block process too, so remove > redunant invalidate compress pages in f2fs_evict_inode. > > Signed-off-by: Fengnan Chang <changfengnan@vivo.com> > --- > fs/f2fs/inode.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 935016e56010..595270646d69 > 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode) > trace_f2fs_evict_inode(inode); > truncate_inode_pages_final(&inode->i_data); > > - if (test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode)) > - f2fs_invalidate_compress_pages(sbi, inode->i_ino); > - Hi Jaegeuk, chao: After https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=662f6acdb0136dfda3d055f00086e2c8ed5c8bfc I think this patch still necessary, it could speed up evict inode. f2fs_invalidate_compress_pages find all pages and compare to decide which pages need invalidate, if there are many compressed file cached, it may need much time. And in later truncate block will invalidate page one by one, this may more effective. > if (inode->i_ino == F2FS_NODE_INO(sbi) || > inode->i_ino == F2FS_META_INO(sbi) || > inode->i_ino == F2FS_COMPRESS_INO(sbi)) > -- > 2.32.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages 2021-12-21 3:59 ` 常凤楠 @ 2021-12-27 8:10 ` Chao Yu [not found] ` <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==> 1 sibling, 0 replies; 4+ messages in thread From: Chao Yu @ 2021-12-27 8:10 UTC (permalink / raw) To: 常凤楠, jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net On 2021/12/21 11:59, 常凤楠 wrote: >> -----Original Message----- >> From: 常凤楠 >> Sent: Monday, December 13, 2021 4:59 PM >> To: jaegeuk@kernel.org; chao@kernel.org >> Cc: linux-f2fs-devel@lists.sourceforge.net; 常凤楠 <changfengnan@vivo.com> >> Subject: [PATCH] f2fs: remove redunant invalidate compress pages >> >> Compress page will invalidate in truncate block process too, so remove >> redunant invalidate compress pages in f2fs_evict_inode. >> >> Signed-off-by: Fengnan Chang <changfengnan@vivo.com> >> --- >> fs/f2fs/inode.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 935016e56010..595270646d69 >> 100644 >> --- a/fs/f2fs/inode.c >> +++ b/fs/f2fs/inode.c >> @@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode) >> trace_f2fs_evict_inode(inode); >> truncate_inode_pages_final(&inode->i_data); >> >> - if (test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode)) >> - f2fs_invalidate_compress_pages(sbi, inode->i_ino); >> - > > Hi Jaegeuk, chao: > After https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=662f6acdb0136dfda3d055f00086e2c8ed5c8bfc > I think this patch still necessary, it could speed up evict inode. f2fs_invalidate_compress_pages find all pages and compare to decide which pages need invalidate, if there are many compressed file cached, it may need much time. And in later truncate block will invalidate page one by one, this may more effective. Well, for the case inode has non-zero nlink value, it needs to invalidate compressed pages after truncate_inode_pages_final(), otherwise related compressed pages may be left in memory after inode was evicted. https://www.ansymbol.com/linux/latest/source/fs/f2fs/inode.c#L754 Thanks, > >> if (inode->i_ino == F2FS_NODE_INO(sbi) || >> inode->i_ino == F2FS_META_INO(sbi) || >> inode->i_ino == F2FS_COMPRESS_INO(sbi)) >> -- >> 2.32.0 > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==>]
* Re: [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages [not found] ` <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==> @ 2021-12-27 8:39 ` 常凤楠 0 siblings, 0 replies; 4+ messages in thread From: 常凤楠 @ 2021-12-27 8:39 UTC (permalink / raw) To: Chao Yu, jaegeuk@kernel.org; +Cc: linux-f2fs-devel@lists.sourceforge.net > -----Original Message----- > From: changfengnan@vivo.com <changfengnan@vivo.com> On Behalf Of Chao > Yu > Sent: Monday, December 27, 2021 4:11 PM > To: 常凤楠 <changfengnan@vivo.com>; jaegeuk@kernel.org > Cc: linux-f2fs-devel@lists.sourceforge.net > Subject: Re: [PATCH] f2fs: remove redunant invalidate compress pages > > On 2021/12/21 11:59, 常凤楠 wrote: > >> -----Original Message----- > >> From: 常凤楠 > >> Sent: Monday, December 13, 2021 4:59 PM > >> To: jaegeuk@kernel.org; chao@kernel.org > >> Cc: linux-f2fs-devel@lists.sourceforge.net; 常凤楠 > >> <changfengnan@vivo.com> > >> Subject: [PATCH] f2fs: remove redunant invalidate compress pages > >> > >> Compress page will invalidate in truncate block process too, so > >> remove redunant invalidate compress pages in f2fs_evict_inode. > >> > >> Signed-off-by: Fengnan Chang <changfengnan@vivo.com> > >> --- > >> fs/f2fs/inode.c | 3 --- > >> 1 file changed, 3 deletions(-) > >> > >> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index > >> 935016e56010..595270646d69 > >> 100644 > >> --- a/fs/f2fs/inode.c > >> +++ b/fs/f2fs/inode.c > >> @@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode) > >> trace_f2fs_evict_inode(inode); > >> truncate_inode_pages_final(&inode->i_data); > >> > >> - if (test_opt(sbi, COMPRESS_CACHE) && f2fs_compressed_file(inode)) > >> - f2fs_invalidate_compress_pages(sbi, inode->i_ino); > >> - > > > > Hi Jaegeuk, chao: > > After > > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commi > > t/?h=dev&id=662f6acdb0136dfda3d055f00086e2c8ed5c8bfc > > I think this patch still necessary, it could speed up evict inode. > f2fs_invalidate_compress_pages find all pages and compare to decide which > pages need invalidate, if there are many compressed file cached, it may need > much time. And in later truncate block will invalidate page one by one, this may > more effective. > > Well, for the case inode has non-zero nlink value, it needs to invalidate > compressed pages after truncate_inode_pages_final(), otherwise related > compressed pages may be left in memory after inode was evicted. Agree, I'll send a new version. > > https://www.ansymbol.com/linux/latest/source/fs/f2fs/inode.c#L754 > > Thanks, > > > > >> if (inode->i_ino == F2FS_NODE_INO(sbi) || > >> inode->i_ino == F2FS_META_INO(sbi) || > >> inode->i_ino == F2FS_COMPRESS_INO(sbi)) > >> -- > >> 2.32.0 > > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-27 8:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-13 8:58 [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages Fengnan Chang
2021-12-21 3:59 ` 常凤楠
2021-12-27 8:10 ` Chao Yu
[not found] ` <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==>
2021-12-27 8:39 ` 常凤楠
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.