From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Daejun Park <daejun7.park@samsung.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint
Date: Wed, 14 Jun 2023 09:12:33 -0700 [thread overview]
Message-ID: <ZInm8cxDnqnD9QrU@google.com> (raw)
In-Reply-To: <20230614060757epcms2p4e11a8f8bf2fa44eac99a5bb7f47f8dcd@epcms2p4>
Hi Daejun,
On 06/14, Daejun Park wrote:
> Hi Jaegeuk,
>
> > 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)
>
> If we don't handle the discard entries here, dcc->entry_list will still have them,
> so stale discard entries may be handled by trim, causing incorrect discards to be issued.
> Therefore, I think this patch should also prevent the creation of discard entries
> in add_discard_addrs(), unless it is a checkpoint caused by trim.
> This would further reduce the latency caused by the creation of a discard entry.
I found this causes some objects were not reclaimed when removing the module.
Hence I'm testing v2.
>
> Thanks,
> Daejun
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Daejun Park <daejun7.park@samsung.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint
Date: Wed, 14 Jun 2023 09:12:33 -0700 [thread overview]
Message-ID: <ZInm8cxDnqnD9QrU@google.com> (raw)
In-Reply-To: <20230614060757epcms2p4e11a8f8bf2fa44eac99a5bb7f47f8dcd@epcms2p4>
Hi Daejun,
On 06/14, Daejun Park wrote:
> Hi Jaegeuk,
>
> > 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)
>
> If we don't handle the discard entries here, dcc->entry_list will still have them,
> so stale discard entries may be handled by trim, causing incorrect discards to be issued.
> Therefore, I think this patch should also prevent the creation of discard entries
> in add_discard_addrs(), unless it is a checkpoint caused by trim.
> This would further reduce the latency caused by the creation of a discard entry.
I found this causes some objects were not reclaimed when removing the module.
Hence I'm testing v2.
>
> Thanks,
> Daejun
>
next prev parent reply other threads:[~2023-06-14 16:12 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230613204109epcas2p158ecc100d3fe2db1ab2b7ee8335d01e7@epcms2p4>
2023-06-13 20:39 ` [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint Jaegeuk Kim
2023-06-13 20:39 ` Jaegeuk Kim
2023-06-14 6:07 ` [f2fs-dev] " Daejun Park
2023-06-14 6:07 ` Daejun Park
2023-06-14 16:12 ` Jaegeuk Kim [this message]
2023-06-14 16:12 ` Jaegeuk Kim
2023-06-14 16:10 ` [f2fs-dev] [PATCH v2] " Jaegeuk Kim
2023-06-14 16:10 ` Jaegeuk Kim
2023-07-03 1:27 ` [f2fs-dev] " Chao Yu
2023-07-03 1:27 ` Chao Yu
2023-07-04 10:53 ` Jaegeuk Kim
2023-07-04 10:53 ` Jaegeuk Kim
2023-07-04 14:58 ` Chao Yu
2023-07-04 14:58 ` Chao Yu
2023-07-05 17:30 ` Jaegeuk Kim
2023-07-05 17:30 ` Jaegeuk Kim
2023-07-06 0:46 ` Chao Yu
2023-07-06 0:46 ` Chao Yu
2023-07-11 8:00 ` Chao Yu
2023-07-11 8:00 ` Chao Yu
2023-07-11 16:37 ` Jaegeuk Kim
2023-07-11 16:37 ` Jaegeuk Kim
2023-07-12 1:33 ` Chao Yu
2023-07-12 1:33 ` Chao Yu
2023-07-12 15:55 ` Jaegeuk Kim
2023-07-12 15:55 ` Jaegeuk Kim
2023-07-13 1:31 ` Chao Yu
2023-07-13 1:31 ` Chao Yu
2023-07-18 3:57 ` Chao Yu
2023-07-18 3:57 ` Chao Yu
2023-07-21 20:23 ` Jaegeuk Kim
2023-07-21 20:23 ` Jaegeuk Kim
2023-07-25 13:18 ` Chao Yu
2023-07-25 13:18 ` Chao Yu
2023-08-04 20:52 ` Jaegeuk Kim
2023-08-04 20:52 ` Jaegeuk Kim
2023-08-07 2:21 ` Chao Yu
2023-08-07 2:21 ` Chao Yu
2023-08-07 19:55 ` Jaegeuk Kim
2023-08-07 19:55 ` Jaegeuk Kim
2023-08-08 0:50 ` Chao Yu
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=ZInm8cxDnqnD9QrU@google.com \
--to=jaegeuk@kernel.org \
--cc=daejun7.park@samsung.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.