All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: 常凤楠 <changfengnan@vivo.com>, "jaegeuk@kernel.org" <jaegeuk@kernel.org>
Cc: "linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH] f2fs: remove redunant invalidate compress pages
Date: Mon, 27 Dec 2021 16:10:45 +0800	[thread overview]
Message-ID: <40e604de-c59a-b4e8-6266-99bd3adde5ff@kernel.org> (raw)
In-Reply-To: <KL1PR0601MB4003AE5E6A8449368F3290BBBB7C9@KL1PR0601MB4003.apcprd06.prod.outlook.com>

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

  reply	other threads:[~2021-12-27  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found]   ` <ALcAxAD2E83dq*nz4YDAgqre.9.1640592660011.Hmail.changfengnan@vivo.com.@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==>
2021-12-27  8:39     ` 常凤楠

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=40e604de-c59a-b4e8-6266-99bd3adde5ff@kernel.org \
    --to=chao@kernel.org \
    --cc=changfengnan@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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.