Re: [f2fs-dev] [PATCH] f2fs: flush plug periodically during GC to maximize readahead effect

From: Chao Yu

Date: Tue Jan 06 2026 - 03:14:53 EST


On 12/31/2025 1:38 AM, Daeho Jeong wrote:
From: Daeho Jeong <daehojeong@xxxxxxxxxx>

During the garbage collection process, F2FS submits readahead I/Os for
valid blocks. However, since the GC loop runs within a single plug scope
without intermediate flushing, these readahead I/Os often accumulate in
the block layer's plug list instead of being dispatched to the device
immediately.

Consequently, when the GC thread attempts to lock the page later, the
I/O might not have completed (or even started), leading to a "read try
and wait" scenario. This negates the benefit of readahead and causes
unnecessary delays in GC latency.

This patch addresses this issue by introducing an intermediate
blk_finish_plug() and blk_start_plug() pair within the GC loop. This
forces the dispatch of pending I/Os, ensuring that readahead pages are
fetched in time, thereby reducing GC latency.

Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,