f2fs: avoid unnecessary shrink in f2fs_shrink_scan()
Chao Yu
maintainerPATCH 1/1 f2fs: avoid unnecessary shrink in f2fs_shrink_scan()
In f2fs_shrink_scan(), let's check if we have already shrinked enough number of memory before calling f2fs_shrink_read_extent_tree().
Signed-off-by Chao Yu <[email protected]>
--- fs/f2fs/shrinker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/shrinker.c +2 -1
@@ -109,7 +109,8 @@ unsigned long f2fs_shrink_scan(struct shrinker *shrink, freed +=f2fs_shrink_age_extent_tree (sbi, nr >>2 );/* shrink read extent cache entries */ - freed +=f2fs_shrink_read_extent_tree (sbi, nr >>2 ); +if (freed < nr) + freed +=f2fs_shrink_read_extent_tree (sbi, nr >>2 );/* shrink clean nat cache entries */ if (freed < nr)
Signature · 1 line
2.49.0
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 7 lines · On Wed, 5 Aug 2026 12:20:50 +0000 you wrote:
In
f2fs_shrink_scan(), let's check if we have already shrinked enough number of memory before callingf2fs_shrink_read_extent_tree().Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/shrinker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Here is the summary with links:
- [f2fs-dev] f2fs: avoid unnecessary shrink in f2fs_shrink_scan()
https://git.kernel.org/jaegeuk/f2fs/c/7173538c41d6
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html