linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint
Date: Tue, 13 Jun 2023 13:39:47 -0700	[thread overview]
Message-ID: <20230613203947.2745943-1-jaegeuk@kernel.org> (raw)

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

             reply	other threads:[~2023-06-13 20:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 20:39 Jaegeuk Kim [this message]
     [not found] ` <CGME20230613204109epcas2p158ecc100d3fe2db1ab2b7ee8335d01e7@epcms2p4>
2023-06-14  6:07   ` [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint 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

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=20230613203947.2745943-1-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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 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).