* [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks
@ 2026-07-01 9:28 Yangyang Zang
2026-07-01 9:28 ` [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries Yangyang Zang
2026-08-03 4:34 ` [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Chao Yu via Linux-f2fs-devel
0 siblings, 2 replies; 4+ messages in thread
From: Yangyang Zang @ 2026-07-01 9:28 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: Yangyang Zang, linux-f2fs-devel
When the current block is not contiguous with the in-progress readahead
range, f2fs_ra_meta_pages() issues the pending range but keeps the old
start block and length.
As a result, the current block is not included in any readahead range,
and subsequent non-contiguous blocks keep reissuing the stale range
instead of starting a new one.
Reset start_blk and len after issuing the pending range so readahead can
continue from the current block.
Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
---
fsck/mount.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fsck/mount.c b/fsck/mount.c
index 2f4e6c92bf6c..ea171a4c97c5 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -901,6 +901,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
} else {
dev_readahead(start_blk << F2FS_BLKSIZE_BITS,
len << F2FS_BLKSIZE_BITS);
+ start_blk = blkaddr;
+ len = 1;
}
}
out:
--
2.43.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries
2026-07-01 9:28 [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Yangyang Zang
@ 2026-07-01 9:28 ` Yangyang Zang
2026-08-03 4:41 ` Chao Yu via Linux-f2fs-devel
2026-08-03 4:34 ` [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Chao Yu via Linux-f2fs-devel
1 sibling, 1 reply; 4+ messages in thread
From: Yangyang Zang @ 2026-07-01 9:28 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: Yangyang Zang, linux-f2fs-devel
build_sit_entries() calls get_current_sit_page() for every entry while
scanning consecutive sit entries. Since each sit block contains multiple
consecutive sit entries, this causes the same sit block to be read and
copied repeatedly.
Read the sit block only when entering a new sit block, and reuse the
cached block for the remaining sit entries in that block.
Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
---
fsck/mount.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index ea171a4c97c5..4c63c2d185ba 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2676,7 +2676,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
for (; segno < end && segno < MAIN_SEGS(sbi); segno++) {
se = &sit_i->sentries[segno];
- get_current_sit_page(sbi, segno, sit_blk);
+ if (SIT_ENTRY_OFFSET(sit_i, segno) == 0)
+ get_current_sit_page(sbi, segno, sit_blk);
sit = sit_blk->entries[SIT_ENTRY_OFFSET(sit_i, segno)];
check_block_count(sbi, segno, &sit);
--
2.43.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks
2026-07-01 9:28 [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Yangyang Zang
2026-07-01 9:28 ` [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries Yangyang Zang
@ 2026-08-03 4:34 ` Chao Yu via Linux-f2fs-devel
1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-08-03 4:34 UTC (permalink / raw)
To: Yangyang Zang, jaegeuk; +Cc: Yangyang Zang, linux-f2fs-devel
On 7/1/26 17:28, Yangyang Zang wrote:
> When the current block is not contiguous with the in-progress readahead
> range, f2fs_ra_meta_pages() issues the pending range but keeps the old
> start block and length.
>
> As a result, the current block is not included in any readahead range,
> and subsequent non-contiguous blocks keep reissuing the stale range
> instead of starting a new one.
>
> Reset start_blk and len after issuing the pending range so readahead can
> continue from the current block.
>
> Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries
2026-07-01 9:28 ` [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries Yangyang Zang
@ 2026-08-03 4:41 ` Chao Yu via Linux-f2fs-devel
0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-08-03 4:41 UTC (permalink / raw)
To: Yangyang Zang, jaegeuk; +Cc: Yangyang Zang, linux-f2fs-devel
On 7/1/26 17:28, Yangyang Zang wrote:
> build_sit_entries() calls get_current_sit_page() for every entry while
> scanning consecutive sit entries. Since each sit block contains multiple
> consecutive sit entries, this causes the same sit block to be read and
> copied repeatedly.
>
> Read the sit block only when entering a new sit block, and reuse the
> cached block for the remaining sit entries in that block.
>
> Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-03 4:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 9:28 [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Yangyang Zang
2026-07-01 9:28 ` [f2fs-dev] [PATCH 2/2] fsck.f2fs: read each sit block only once in build_sit_entries Yangyang Zang
2026-08-03 4:41 ` Chao Yu via Linux-f2fs-devel
2026-08-03 4:34 ` [f2fs-dev] [PATCH 1/2] fsck.f2fs: fix meta readahead after non-contiguous blocks Chao Yu via Linux-f2fs-devel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox