linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint
@ 2023-06-13 20:39 Jaegeuk Kim
       [not found] ` <CGME20230613204109epcas2p158ecc100d3fe2db1ab2b7ee8335d01e7@epcms2p4>
  2023-06-14 16:10 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
  0 siblings, 2 replies; 21+ messages in thread
From: Jaegeuk Kim @ 2023-06-13 20:39 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

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@kernel.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



_______________________________________________
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] 21+ messages in thread

end of thread, other threads:[~2023-08-08  0:50 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 20:39 [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint Jaegeuk Kim
     [not found] ` <CGME20230613204109epcas2p158ecc100d3fe2db1ab2b7ee8335d01e7@epcms2p4>
2023-06-14  6:07   ` Daejun Park
2023-06-14 16:12     ` Jaegeuk Kim
2023-06-14 16:10 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2023-07-03  1:27   ` Chao Yu
2023-07-04 10:53     ` Jaegeuk Kim
2023-07-04 14:58       ` Chao Yu
2023-07-05 17:30         ` Jaegeuk Kim
2023-07-06  0:46           ` Chao Yu
2023-07-11  8:00             ` Chao Yu
2023-07-11 16:37             ` Jaegeuk Kim
2023-07-12  1:33               ` Chao Yu
2023-07-12 15:55                 ` Jaegeuk Kim
2023-07-13  1:31                   ` Chao Yu
2023-07-18  3:57                     ` Chao Yu
2023-07-21 20:23                     ` Jaegeuk Kim
2023-07-25 13:18                       ` Chao Yu
2023-08-04 20:52                         ` Jaegeuk Kim
2023-08-07  2:21                           ` Chao Yu
2023-08-07 19:55                             ` Jaegeuk Kim
2023-08-08  0:50                               ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).