* [f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times
@ 2024-08-01 9:18 zhangxirui via Linux-f2fs-devel
2024-08-13 3:55 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: zhangxirui via Linux-f2fs-devel @ 2024-08-01 9:18 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: zhangxirui, linux-f2fs-devel
If overprov_segment_count < rsvd_segment_count will
set_cp(overprov_segment_count) twice, reduce it.
Signed-off-by: zhangxirui <xirui.zhang@vivo.com>
---
mkfs/f2fs_format.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index e26a513..794ced5 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -764,10 +764,6 @@ static int f2fs_write_check_point_pack(void)
get_cp(rsvd_segment_count)) *
c.overprovision / 100);
- if (!(c.conf_reserved_sections) &&
- get_cp(overprov_segment_count) < get_cp(rsvd_segment_count))
- set_cp(overprov_segment_count, get_cp(rsvd_segment_count));
-
/*
* If conf_reserved_sections has a non zero value, overprov_segment_count
* is set to overprov_segment_count + rsvd_segment_count.
@@ -787,8 +783,11 @@ static int f2fs_write_check_point_pack(void)
set_cp(overprov_segment_count, get_cp(overprov_segment_count) +
get_cp(rsvd_segment_count));
} else {
- set_cp(overprov_segment_count, get_cp(overprov_segment_count) +
- overprovision_segment_buffer(sb));
+ /*
+ * overprov_segment_count must bigger than rsvd_segment_count.
+ */
+ set_cp(overprov_segment_count, max(get_cp(rsvd_segment_count),
+ get_cp(overprov_segment_count)) + overprovision_segment_buffer(sb));
}
if (f2fs_get_usable_segments(sb) <= get_cp(overprov_segment_count)) {
--
2.25.1
_______________________________________________
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] 2+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times
2024-08-01 9:18 [f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times zhangxirui via Linux-f2fs-devel
@ 2024-08-13 3:55 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2024-08-13 3:55 UTC (permalink / raw)
To: zhangxirui, jaegeuk; +Cc: linux-f2fs-devel
On 2024/8/1 17:18, zhangxirui wrote:
> If overprov_segment_count < rsvd_segment_count will
> set_cp(overprov_segment_count) twice, reduce it.
>
> Signed-off-by: zhangxirui <xirui.zhang@vivo.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] 2+ messages in thread
end of thread, other threads:[~2024-08-13 3:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 9:18 [f2fs-dev] [PATCH] f2fs-tools: reduce overprov_segment_count set times zhangxirui via Linux-f2fs-devel
2024-08-13 3:55 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).