[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230614060757epcms2p4e11a8f8bf2fa44eac99a5bb7f47f8dcd@epcms2p4>
Date: Wed, 14 Jun 2023 15:07:57 +0900
From: Daejun Park <daejun7.park@...sung.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>
CC: Daejun Park <daejun7.park@...sung.com>
Subject: RE: [f2fs-dev] [PATCH] f2fs: do not issue small discard commands
during checkpoint
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@...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)
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.
Thanks,
Daejun
Powered by blists - more mailing lists