On 10/21, Shinichiro Kawasaki wrote: > On Oct 20, 2022 / 16:18, Jaegeuk Kim wrote: > > ... > > > Thanks, I think that fix looks good to me. I applied into the original > > patch. > > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?h=dev&id=281d3e72370f6c39c0d57acaf37a7f0e003ddd28 > > Oh, happy to know that the fix is good. And thank you for adding my SoB tag. > > One more thing, my fix missed care for fsck/resize.c. I suggest to apply one > more hunk below to the commit in same manner as mkfs/f2fs_format.c. > > diff --git a/fsck/resize.c b/fsck/resize.c > index c048b16..79945e1 100644 > --- a/fsck/resize.c > +++ b/fsck/resize.c > @@ -476,8 +476,8 @@ static void rebuild_checkpoint(struct f2fs_sb_info *sbi, > get_cp(rsvd_segment_count)) * > c.new_overprovision / 100); > > - if (get_cp(rsvd_segment_count) > get_cp(overprov_segment_count)) > - ASSERT_MSG("Cannot support wrong overprovision ratio\n"); > + if (get_cp(overprov_segment_count) < get_cp(rsvd_segment_count)) > + set_cp(overprov_segment_count, get_cp(rsvd_segment_count)); > > DBG(0, "Info: Overprovision ratio = %.3lf%%\n", c.new_overprovision); > DBG(0, "Info: Overprovision segments = %u (GC reserved = %u)\n", > > Without this change, the assert message "Cannot support wrong overprovision > ratio" was printed when I ran resize.f2fs -t X command to the f2fs formatted > with mkfs.f2fs -s Y. With the change above, the assert message is not printed.
Thanks, applied. > > > > > > > > > FYI, I tried to fix and created a patch which allows reserved segments > > > larger > > > than overprovisioning segments [1]. It compares those two, and take > > > larger one > > > to subtract from usable segments to get the segments for users. I > > > confirmed it > > > keeps small number of overprovisioning segments for no -s option case, and > > > avoids the mkfs.f2fs failure for the -s option and zoned block device > > > cases. > > > However, it increases runtime of my test script which fills f2fs and do > > > file > > > overwrites to test f2fs GC on zoned block devices. It takes +60% longer > > > runtime. > > > Then GC performance looks worse than before, and this fix does not look > > > good > > > for me. > > > > I think you can try to avoid that by tuning /sys/fs/f2fs/xx/reserved_blocks? > > Thanks, I was able to shorten the runtime using the sysfs attribute. So the > longer GC time was just caused by the smaller reserved segments size. Good. > > -- > Shin'ichiro Kawasaki _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
