[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230613203947.2745943-1-jaegeuk@kernel.org>
Date: Tue, 13 Jun 2023 13:39:47 -0700
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@...nel.org>
Subject: [PATCH] f2fs: do not issue small discard commands during checkpoint
If there're huge # of small discards, this will increase checkpoint latency
insanely. Let's issue small discards only by trim.
Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
---
fs/f2fs/segment.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0c0c033c4bdd..ef46bb085385 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2178,7 +2178,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
}
mutex_unlock(&dirty_i->seglist_lock);
- if (!f2fs_block_unit_discard(sbi))
+ if (!f2fs_block_unit_discard(sbi) || !force)
goto wakeup;
/* send small discards */
@@ -2192,8 +2192,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
sbi->blocks_per_seg, cur_pos);
len = next_pos - cur_pos;
- if (f2fs_sb_has_blkzoned(sbi) ||
- (force && len < cpc->trim_minlen))
+ if (f2fs_sb_has_blkzoned(sbi) || len < cpc->trim_minlen)
goto skip;
f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
--
2.41.0.162.gfafddb0af9-goog
Powered by blists - more mailing lists