linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] f2fs-tools: allocate logs after conventional area for HM zoned devices
@ 2024-01-31 18:33 Daeho Jeong
  2024-02-01 10:12 ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Daeho Jeong @ 2024-01-31 18:33 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

From: Daeho Jeong <daehojeong@google.com>

Make to allocate logs after conventional area for HM zoned devices to
spare them for file pinning support.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
v2: make current segment numbers relative to main start block. check
    zoned block availability before the allocation.
---
 mkfs/f2fs_format.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index f2840c8..57ea9ea 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -558,6 +558,16 @@ static int f2fs_prepare_super_block(void)
 		c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA);
 	} else if (c.zoned_mode) {
 		c.cur_seg[CURSEG_HOT_NODE] = 0;
+		if (c.zoned_model == F2FS_ZONED_HM) {
+			uint32_t conv_zones =
+				c.devices[0].total_segments / c.segs_per_zone
+				- total_meta_zones;
+
+			if (total_zones - conv_zones >= avail_zones)
+				c.cur_seg[CURSEG_HOT_NODE] =
+					(c.devices[1].start_blkaddr -
+					 get_sb(main_blkaddr)) / c.blks_per_seg;
+		}
 		c.cur_seg[CURSEG_WARM_NODE] = next_zone(CURSEG_HOT_NODE);
 		c.cur_seg[CURSEG_COLD_NODE] = next_zone(CURSEG_WARM_NODE);
 		c.cur_seg[CURSEG_HOT_DATA] = next_zone(CURSEG_COLD_NODE);
-- 
2.43.0.429.g432eaa2c6b-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs-tools: allocate logs after conventional area for HM zoned devices
  2024-01-31 18:33 [PATCH v2] f2fs-tools: allocate logs after conventional area for HM zoned devices Daeho Jeong
@ 2024-02-01 10:12 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2024-02-01 10:12 UTC (permalink / raw)
  To: Daeho Jeong, linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

On 2024/2/1 2:33, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> Make to allocate logs after conventional area for HM zoned devices to
> spare them for file pinning support.
> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-01 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 18:33 [PATCH v2] f2fs-tools: allocate logs after conventional area for HM zoned devices Daeho Jeong
2024-02-01 10:12 ` [f2fs-dev] " 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).