lkml.org 
[lkml]   [2023]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] f2fs: do not issue small discard commands during checkpoint
    Date
    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
    \
     
     \ /
      Last update: 2023-06-13 22:42    [W:3.284 / U:0.104 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site