Skip to contentSkip to conversation

f2fs: remove redunant invalidate compress pages

PATCH Superseded Fengnan Chang 2 participants 4 messages Dec 13, 2021 – Dec 27, 2021 1 message not in the archive F2FS file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/f2fs/inode.c | 3 ---
 1 file changed, 3 deletions(-)
fs/f2fs/inode.c +0 -3
index 935016e56010..595270646d69 100644
@@ -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))
Signature · 8 lines
2.32.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
author
#1 lore raw
Quoted 20 lines

-----Original Message-----
From: 常凤楠
Sent: Monday, December 13, 2021 4:59 PM
To: [email protected]; [email protected]
Cc: [email protected]; 常凤楠 <[email protected]>
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.

---
 fs/f2fs/inode.c | 3 ---
 1 file changed, 3 deletions(-)
fs/f2fs/inode.c index 935016e56010..595270646d69 renamed from fs/f2fs/inode.c +0 -0

100644

fs/f2fs/inode.c void f2fs_evict_inode(struct inode *inode) · line 756

Quoted 6 lines
fs/f2fs/inode.c +0 -3
@@ -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.

Quoted 5 lines
fs/f2fs/inode.c +0 -1
 	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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer
#2 lore raw
Quoted 23 lines · 常凤楠
Quoted 23 lines

-----Original Message-----
From: 常凤楠
Sent: Monday, December 13, 2021 4:59 PM
To: [email protected]; [email protected]
Cc: [email protected]; 常凤楠 <[email protected]>
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.

---
  fs/f2fs/inode.c | 3 ---
  1 file changed, 3 deletions(-)
fs/f2fs/inode.c index 935016e56010..595270646d69 renamed from fs/f2fs/inode.c +0 -0

100644

fs/f2fs/inode.c +0 -0
@@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode)
  	trace_f2fs_evict_inode(inode);
  	truncate_inode_pages_final(&inode->i_data);
 
Quoted 7 lines

fs/f2fs/inode.c void f2fs_evict_inode(struct inode *inode) · line 756

Quoted 3 lines
fs/f2fs/inode.c +0 -3
-	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,

Quoted 7 lines
Quoted 6 lines
fs/f2fs/inode.c +0 -1
  	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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

A message that is not in the archive (sent off-list or not yet received): ALcAxAD2E83dq*[email protected].@PDQwZTYwNGRlLWM1OWEtYjRlOC02MjY2LTk5YmQzYWRkZTVmZkBrZXJuZWwub3JnPg==

author
#4 lore raw
Quoted 45 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Chao Yu
Sent: Monday, December 27, 2021 4:11 PM
To: 常凤楠 <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH] f2fs: remove redunant invalidate compress pages

Quoted 25 lines · 常凤楠
Quoted 25 lines

-----Original Message-----
From: 常凤楠
Sent: Monday, December 13, 2021 4:59 PM
To: [email protected]; [email protected]
Cc: [email protected]; 常凤楠 <[email protected]>
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.

---
  fs/f2fs/inode.c | 3 ---
  1 file changed, 3 deletions(-)
fs/f2fs/inode.c index renamed from fs/f2fs/inode.c +0 -0

935016e56010..595270646d69
100644

fs/f2fs/inode.c +0 -0
@@ -751,9 +751,6 @@ void f2fs_evict_inode(struct inode *inode)
  	trace_f2fs_evict_inode(inode);
  	truncate_inode_pages_final(&inode->i_data);
 
Quoted 9 lines

fs/f2fs/inode.c void f2fs_evict_inode(struct inode *inode) · line 756

Quoted 3 lines
fs/f2fs/inode.c +0 -3
-	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.

Quoted 8 lines

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.

Quoted 12 lines

https://www.ansymbol.com/linux/latest/source/fs/f2fs/inode.c#L754

Thanks,

Quoted 7 lines
Quoted 6 lines
fs/f2fs/inode.c +0 -1
  	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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel