Message ID | 20240117230032.2312067-1-daeho43@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2224dyb; Wed, 17 Jan 2024 15:00:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtJJwijCo8H/0JYFe8W5b4OuVVMzYXSE1WlmltNPBMUQhA46J48vGnasiDgh7NHdBIWnHU X-Received: by 2002:a05:6871:202:b0:210:9b06:5030 with SMTP id t2-20020a056871020200b002109b065030mr2094698oad.5.1705532454654; Wed, 17 Jan 2024 15:00:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705532454; cv=pass; d=google.com; s=arc-20160816; b=KamL5QqXpqDwitNoOOIDDKbpRGhRx+B9p4Ks678iqHrU+g5OGuF7Me/AHiG6Ln4ZXg 0TEVoFfQVJGvDV3V4Vn0m1Q6MnH8rGpN5Pts0ce2p/gESJYznVKjaIECE+TP9cbRuB48 o/hFH6uNbbMELX3DdcKj3ZTT9zg+Ld1lxeDTDwO+H87KqO0gCskV25A94E7rxz/2yy/r U80v8oyJjWXYk/pGVo8t+UF8EpIu5vP+N6WBGkLNsUor1eBtUNsU+OdFavm52ZaVJKTo xrTZ/iepIk+A1VL9ohbY6/4VNDr0HKDgfQxHgrJkZ0/tCwRfRnYNWTKAKOHTywJVAaeX MTZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=7m0N7t1XW7ex4DXEj0WY/wok48BDAnOfTPeDrj1R5vg=; fh=IvJDhn2XbJ55zxf0p/e9A+SWoPpre/ymwh9Q/MPTdCg=; b=Uz46E8WLhZc+CEDJmdjB3hSgRiKZdcE3c4FVSwKlnpJUoaBZadc9AxLKvj8jKZWKGW RLC6tt0tLUxhRYV5HouNckM23d015Q+TTSLglaMj5pnOq/zLVA3nrldZB3hNqH4F5bvF b2OiwK/ValdIP7Me/i+TnwGlTk/EuUkDXXVBdVU5/pyU1QR3gHymjkYFv9o5LzCTSbDb 4ZnAd6eqmQJsvSXPKf32nRIea9KZDJroANkHb9ubwc16/lC8bLTQkr5e1oQEIFGbagWs OirDGXebNq0CIkjQuAQgLi9X+JAFq5nclKGTi6dGLJaJQd8LxRGsDOHRQdR6QzADpHxk 2cLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YCCjNYVK; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z7-20020a656107000000b005cdbeb8228dsi337418pgu.433.2024.01.17.15.00.54 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 15:00:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YCCjNYVK; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29526-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BEEE92858A3 for <ouuuleilei@gmail.com>; Wed, 17 Jan 2024 23:00:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDCF02563F; Wed, 17 Jan 2024 23:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YCCjNYVK" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15A2A1E889 for <linux-kernel@vger.kernel.org>; Wed, 17 Jan 2024 23:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705532439; cv=none; b=kubmNXuvGLCYiyOCbknjUCW6cIczuRm6+5IY00/Cqb5f6u/eVmvlHYe+zel4GTxbGVbk+95ItOJeZKfCkFFdqmehPQgKZmyo6kmtOci7cfhV15I+E55LBbBEAmBOSuR7H4WvhOXLd8Au69ftNwy/A3I68yq4JqxUc5PAmkyci24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705532439; c=relaxed/simple; bh=PmFsxi6d9e+Zlb3E4C1SRmLXOx2XOWKkOd3qfavXo9c=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; b=AN9wViwdhjI80gfV/EaWja+yTvyWFiwRYV6praSD6dt93RYs4Rcrb8DMWvu3N3d1I/+3xTBxcN2meuq05mkfpfKhyguLR+TvZJdOowqCuI0y1iyjhK75oHf8ZwALUEpm+UsYGkRCqQCTQ44YXIsVCqtzw5pKDp3dKn+64BzBAa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YCCjNYVK; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1d5dfda4319so19608515ad.0 for <linux-kernel@vger.kernel.org>; Wed, 17 Jan 2024 15:00:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705532437; x=1706137237; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7m0N7t1XW7ex4DXEj0WY/wok48BDAnOfTPeDrj1R5vg=; b=YCCjNYVKgMYt3kdgnP9VN9x82JBV/w+2HgkHZR5H1e0KsXjTPQw1qxK0842X+++fXW LiwGvnybk+txfOlHgGihyg8aRxo7kfp38AtID73SJGxiEypKxP+JV3Nz8X48NFgR5JtT PC45RTOF+K96BbIEeZV7cLRPv5aMw4o41f4c24u9XHNg5QfmM5pgAEJvbbSFzXZbpQdD mAZiZsjwg2EozAEHaGIxb/YBLUPeAJyssrwtFwHY6vbn5D0txYCPkFOf0NZna1JFt5he Q36r5ugppUNWzCYubrjdnbrjngHnVVdO9G/3WSOubZ+e2mB2asHgeOBBRKVW5Wzu1DKm P+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705532437; x=1706137237; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7m0N7t1XW7ex4DXEj0WY/wok48BDAnOfTPeDrj1R5vg=; b=slc4g1mvAIbQUIzRWhNKrR0A7zdCqz32pfI+GrB+3uuXmk6M24XZIz2+GC3qOKdT2o oGaki+ZpRrzagRFdMdq1KNLAqPJjWobJBukV60bxosiqNWmj5ukca9CVHDZkhOoZuT1K EYsOPL7NZtixmjCbI9eglnh5CPFMcCjmsd65OkdmBII8JOh2GF9XFfPhL73DuN0Dwk/C ElAc/lByiTyKxeauR0tXJje27zXkBu2w+UQx8jtIjR6CAJOIZtPdZyZ/itNkUa5bIyYb DNkX7O2Gy7LsQdG/q6fffMfRVZfa/B03gGU0eH+uHeLBe7h5PH7fmyJDWk9kYYX4zTlY n2ag== X-Gm-Message-State: AOJu0YyKm9HBVagjR5X5fFtaso3WJbtlDHyqqGr+njSGb3xshvL0BkWZ NWhTbSWYPO8EOkQEeOwgPsBChGgo3oxHs8i2dopygs4X4FnRscOfNl2nPoad X-Received: by 2002:a17:902:db06:b0:1d0:a9fa:5939 with SMTP id m6-20020a170902db0600b001d0a9fa5939mr1446plx.111.1705532436888; Wed, 17 Jan 2024 15:00:36 -0800 (PST) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:0:1000:8411:9c1b:9344:efbd:adc1]) by smtp.gmail.com with ESMTPSA id e2-20020a170902744200b001d5f5887ae8sm167964plt.10.2024.01.17.15.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 15:00:36 -0800 (PST) From: Daeho Jeong <daeho43@gmail.com> To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong <daehojeong@google.com> Subject: [PATCH] f2fs-tools: allocate logs after conventional area for HM zoned devices Date: Wed, 17 Jan 2024 15:00:32 -0800 Message-ID: <20240117230032.2312067-1-daeho43@gmail.com> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788380399223515494 X-GMAIL-MSGID: 1788380399223515494 |
Series |
f2fs-tools: allocate logs after conventional area for HM zoned devices
|
|
Commit Message
Daeho Jeong
Jan. 17, 2024, 11 p.m. UTC
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> --- mkfs/f2fs_format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 2024/1/18 7:00, 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,
+Cc Yongpeng Yang Daeho, Yongpeng reports a potential issue: if c.devices[0].total_segments is larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed end boundary of mainarea. Could you please check that? though it's a corner case. On 2024/1/18 7:00, 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> > --- > mkfs/f2fs_format.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > index f2840c8..91a7f4b 100644 > --- a/mkfs/f2fs_format.c > +++ b/mkfs/f2fs_format.c > @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) > c.cur_seg[CURSEG_COLD_DATA] = 0; > c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); > } else if (c.zoned_mode) { > - c.cur_seg[CURSEG_HOT_NODE] = 0; > + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > + c.devices[0].total_segments : 0; > 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);
On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: > > +Cc Yongpeng Yang > > Daeho, > > Yongpeng reports a potential issue: if c.devices[0].total_segments is > larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed > end boundary of mainarea. Could you please check that? though it's a corner > case. Can you elaborate more? In the case of F2FS_ZONED_HM, we have the devices[1]. Do you mean the case we format the filesystem intentionally smaller than what devices have? > > On 2024/1/18 7:00, 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> > > --- > > mkfs/f2fs_format.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > > index f2840c8..91a7f4b 100644 > > --- a/mkfs/f2fs_format.c > > +++ b/mkfs/f2fs_format.c > > @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) > > c.cur_seg[CURSEG_COLD_DATA] = 0; > > c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); > > } else if (c.zoned_mode) { > > - c.cur_seg[CURSEG_HOT_NODE] = 0; > > + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > > + c.devices[0].total_segments : 0; > > 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);
On 2024/1/26 0:25, Daeho Jeong wrote: > On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: >> >> +Cc Yongpeng Yang >> >> Daeho, >> >> Yongpeng reports a potential issue: if c.devices[0].total_segments is >> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed >> end boundary of mainarea. Could you please check that? though it's a corner >> case. > > Can you elaborate more? Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, and c.devices[0].total_segments is larger than segments of mainare, c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? c.devices[0].total_segments : 0; > In the case of F2FS_ZONED_HM, we have the devices[1]. > Do you mean the case we format the filesystem intentionally smaller > than what devices have? I mean blew case: device[0]: conventional device size = 10240 MB device[1]: zone device size = 2 MB Thanks, > >> >> On 2024/1/18 7:00, 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> >>> --- >>> mkfs/f2fs_format.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >>> index f2840c8..91a7f4b 100644 >>> --- a/mkfs/f2fs_format.c >>> +++ b/mkfs/f2fs_format.c >>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) >>> c.cur_seg[CURSEG_COLD_DATA] = 0; >>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); >>> } else if (c.zoned_mode) { >>> - c.cur_seg[CURSEG_HOT_NODE] = 0; >>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>> + c.devices[0].total_segments : 0; >>> 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);
On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: > > On 2024/1/26 0:25, Daeho Jeong wrote: > > On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: > >> > >> +Cc Yongpeng Yang > >> > >> Daeho, > >> > >> Yongpeng reports a potential issue: if c.devices[0].total_segments is > >> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed > >> end boundary of mainarea. Could you please check that? though it's a corner > >> case. > > > > Can you elaborate more? > > Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. Oh, Got it. Then, how about this? c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? (c.devices[1].start_blkaddr - get_sb(main_blkaddr)) / c.blks_per_seg : 0; > If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, > and c.devices[0].total_segments is larger than segments of mainare, > c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. > > c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > c.devices[0].total_segments : 0; > > > In the case of F2FS_ZONED_HM, we have the devices[1]. > > Do you mean the case we format the filesystem intentionally smaller > > than what devices have? > > I mean blew case: > device[0]: conventional device size = 10240 MB > device[1]: zone device size = 2 MB > > Thanks, > > > > >> > >> On 2024/1/18 7:00, 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> > >>> --- > >>> mkfs/f2fs_format.c | 3 ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > >>> index f2840c8..91a7f4b 100644 > >>> --- a/mkfs/f2fs_format.c > >>> +++ b/mkfs/f2fs_format.c > >>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) > >>> c.cur_seg[CURSEG_COLD_DATA] = 0; > >>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); > >>> } else if (c.zoned_mode) { > >>> - c.cur_seg[CURSEG_HOT_NODE] = 0; > >>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > >>> + c.devices[0].total_segments : 0; > >>> 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);
On 2024/1/27 2:17, Daeho Jeong wrote: > On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >> >> On 2024/1/26 0:25, Daeho Jeong wrote: >>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: >>>> >>>> +Cc Yongpeng Yang >>>> >>>> Daeho, >>>> >>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is >>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed >>>> end boundary of mainarea. Could you please check that? though it's a corner >>>> case. >>> >>> Can you elaborate more? >> >> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. > > Oh, Got it. > Then, how about this? > > c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > (c.devices[1].start_blkaddr - > get_sb(main_blkaddr)) / c.blks_per_seg : 0; Better, but log header should align to start blkaddr of zone? Thanks, > >> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, >> and c.devices[0].total_segments is larger than segments of mainare, >> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. >> >> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >> c.devices[0].total_segments : 0; >> >>> In the case of F2FS_ZONED_HM, we have the devices[1]. >>> Do you mean the case we format the filesystem intentionally smaller >>> than what devices have? >> >> I mean blew case: >> device[0]: conventional device size = 10240 MB >> device[1]: zone device size = 2 MB >> >> Thanks, >> >>> >>>> >>>> On 2024/1/18 7:00, 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> >>>>> --- >>>>> mkfs/f2fs_format.c | 3 ++- >>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >>>>> index f2840c8..91a7f4b 100644 >>>>> --- a/mkfs/f2fs_format.c >>>>> +++ b/mkfs/f2fs_format.c >>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) >>>>> c.cur_seg[CURSEG_COLD_DATA] = 0; >>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); >>>>> } else if (c.zoned_mode) { >>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0; >>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>> + c.devices[0].total_segments : 0; >>>>> 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);
On Sun, Jan 28, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: > > On 2024/1/27 2:17, Daeho Jeong wrote: > > On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: > >> > >> On 2024/1/26 0:25, Daeho Jeong wrote: > >>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: > >>>> > >>>> +Cc Yongpeng Yang > >>>> > >>>> Daeho, > >>>> > >>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is > >>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed > >>>> end boundary of mainarea. Could you please check that? though it's a corner > >>>> case. > >>> > >>> Can you elaborate more? > >> > >> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. > > > > Oh, Got it. > > Then, how about this? > > > > c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > > (c.devices[1].start_blkaddr - > > get_sb(main_blkaddr)) / c.blks_per_seg : 0; > > Better, but log header should align to start blkaddr of zone? It's already aligned here. if (c.zoned_mode && c.ndevs > 1) zone_align_start_offset += (c.devices[0].total_sectors * c.sector_size) % zone_size_bytes; .. for (i = 0; i < c.ndevs; i++) { if (i == 0) { c.devices[i].total_segments = (c.devices[i].total_sectors * c.sector_size - zone_align_start_offset) / segment_size_bytes; c.devices[i].start_blkaddr = 0; c.devices[i].end_blkaddr = c.devices[i].total_segments * c.blks_per_seg - 1 + sb->segment0_blkaddr; } else { c.devices[i].total_segments = c.devices[i].total_sectors / (c.sectors_per_blk * c.blks_per_seg); c.devices[i].start_blkaddr = c.devices[i - 1].end_blkaddr + 1; .. total_meta_zones = ZONE_ALIGN(total_meta_segments * c.blks_per_seg); set_sb(main_blkaddr, get_sb(segment0_blkaddr) + total_meta_zones * c.segs_per_zone * c.blks_per_seg); > > Thanks, > > > > >> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, > >> and c.devices[0].total_segments is larger than segments of mainare, > >> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. > >> > >> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > >> c.devices[0].total_segments : 0; > >> > >>> In the case of F2FS_ZONED_HM, we have the devices[1]. > >>> Do you mean the case we format the filesystem intentionally smaller > >>> than what devices have? > >> > >> I mean blew case: > >> device[0]: conventional device size = 10240 MB > >> device[1]: zone device size = 2 MB > >> > >> Thanks, > >> > >>> > >>>> > >>>> On 2024/1/18 7:00, 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> > >>>>> --- > >>>>> mkfs/f2fs_format.c | 3 ++- > >>>>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>>>> > >>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c > >>>>> index f2840c8..91a7f4b 100644 > >>>>> --- a/mkfs/f2fs_format.c > >>>>> +++ b/mkfs/f2fs_format.c > >>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) > >>>>> c.cur_seg[CURSEG_COLD_DATA] = 0; > >>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); > >>>>> } else if (c.zoned_mode) { > >>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0; > >>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? > >>>>> + c.devices[0].total_segments : 0; > >>>>> 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);
cur_seg[CURSEG_COLD_DATA] will exceed end boundary of main area when: device[1]: zone device size = [2 MB ~ 10MB] So, if there are not enough seq zones for six cursegs, we should still assign 0 to c.cur_seg[CURSEG_HOT_NODE] or reserve several conv zones for cursegs. On 1/29/2024 11:47 PM, Daeho Jeong wrote: > On Sun, Jan 28, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >> >> On 2024/1/27 2:17, Daeho Jeong wrote: >>> On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >>>> >>>> On 2024/1/26 0:25, Daeho Jeong wrote: >>>>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: >>>>>> >>>>>> +Cc Yongpeng Yang >>>>>> >>>>>> Daeho, >>>>>> >>>>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is >>>>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed >>>>>> end boundary of mainarea. Could you please check that? though it's a corner >>>>>> case. >>>>> >>>>> Can you elaborate more? >>>> >>>> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. >>> >>> Oh, Got it. >>> Then, how about this? >>> >>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>> (c.devices[1].start_blkaddr - >>> get_sb(main_blkaddr)) / c.blks_per_seg : 0; >> >> Better, but log header should align to start blkaddr of zone? > > It's already aligned here. > > if (c.zoned_mode && c.ndevs > 1) > zone_align_start_offset += > (c.devices[0].total_sectors * c.sector_size) % > zone_size_bytes; > > ... > > for (i = 0; i < c.ndevs; i++) { > if (i == 0) { > c.devices[i].total_segments = > (c.devices[i].total_sectors * > c.sector_size - zone_align_start_offset) / > segment_size_bytes; > c.devices[i].start_blkaddr = 0; > c.devices[i].end_blkaddr = c.devices[i].total_segments * > c.blks_per_seg - 1 + > sb->segment0_blkaddr; > } else { > c.devices[i].total_segments = > c.devices[i].total_sectors / > (c.sectors_per_blk * c.blks_per_seg); > c.devices[i].start_blkaddr = > c.devices[i - 1].end_blkaddr + 1; > > ... > > total_meta_zones = ZONE_ALIGN(total_meta_segments * > c.blks_per_seg); > > set_sb(main_blkaddr, get_sb(segment0_blkaddr) + total_meta_zones * > c.segs_per_zone * c.blks_per_seg); > >> >> Thanks, >> >>> >>>> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, >>>> and c.devices[0].total_segments is larger than segments of mainare, >>>> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. >>>> >>>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>> c.devices[0].total_segments : 0; >>>> >>>>> In the case of F2FS_ZONED_HM, we have the devices[1]. >>>>> Do you mean the case we format the filesystem intentionally smaller >>>>> than what devices have? >>>> >>>> I mean blew case: >>>> device[0]: conventional device size = 10240 MB >>>> device[1]: zone device size = 2 MB >>>> >>>> Thanks, >>>> >>>>> >>>>>> >>>>>> On 2024/1/18 7:00, 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> >>>>>>> --- >>>>>>> mkfs/f2fs_format.c | 3 ++- >>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >>>>>>> index f2840c8..91a7f4b 100644 >>>>>>> --- a/mkfs/f2fs_format.c >>>>>>> +++ b/mkfs/f2fs_format.c >>>>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) >>>>>>> c.cur_seg[CURSEG_COLD_DATA] = 0; >>>>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); >>>>>>> } else if (c.zoned_mode) { >>>>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0; >>>>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>>>> + c.devices[0].total_segments : 0; >>>>>>> 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);
On 2024/1/29 23:47, Daeho Jeong wrote: > On Sun, Jan 28, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >> >> On 2024/1/27 2:17, Daeho Jeong wrote: >>> On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >>>> >>>> On 2024/1/26 0:25, Daeho Jeong wrote: >>>>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: >>>>>> >>>>>> +Cc Yongpeng Yang >>>>>> >>>>>> Daeho, >>>>>> >>>>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is >>>>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed >>>>>> end boundary of mainarea. Could you please check that? though it's a corner >>>>>> case. >>>>> >>>>> Can you elaborate more? >>>> >>>> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. >>> >>> Oh, Got it. >>> Then, how about this? >>> >>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>> (c.devices[1].start_blkaddr - >>> get_sb(main_blkaddr)) / c.blks_per_seg : 0; >> >> Better, but log header should align to start blkaddr of zone? > > It's already aligned here. Ah, thanks for the explanation. :) Thanks, > > if (c.zoned_mode && c.ndevs > 1) > zone_align_start_offset += > (c.devices[0].total_sectors * c.sector_size) % > zone_size_bytes; > > ... > > for (i = 0; i < c.ndevs; i++) { > if (i == 0) { > c.devices[i].total_segments = > (c.devices[i].total_sectors * > c.sector_size - zone_align_start_offset) / > segment_size_bytes; > c.devices[i].start_blkaddr = 0; > c.devices[i].end_blkaddr = c.devices[i].total_segments * > c.blks_per_seg - 1 + > sb->segment0_blkaddr; > } else { > c.devices[i].total_segments = > c.devices[i].total_sectors / > (c.sectors_per_blk * c.blks_per_seg); > c.devices[i].start_blkaddr = > c.devices[i - 1].end_blkaddr + 1; > > ... > > total_meta_zones = ZONE_ALIGN(total_meta_segments * > c.blks_per_seg); > > set_sb(main_blkaddr, get_sb(segment0_blkaddr) + total_meta_zones * > c.segs_per_zone * c.blks_per_seg); > >> >> Thanks, >> >>> >>>> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, >>>> and c.devices[0].total_segments is larger than segments of mainare, >>>> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. >>>> >>>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>> c.devices[0].total_segments : 0; >>>> >>>>> In the case of F2FS_ZONED_HM, we have the devices[1]. >>>>> Do you mean the case we format the filesystem intentionally smaller >>>>> than what devices have? >>>> >>>> I mean blew case: >>>> device[0]: conventional device size = 10240 MB >>>> device[1]: zone device size = 2 MB >>>> >>>> Thanks, >>>> >>>>> >>>>>> >>>>>> On 2024/1/18 7:00, 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> >>>>>>> --- >>>>>>> mkfs/f2fs_format.c | 3 ++- >>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >>>>>>> index f2840c8..91a7f4b 100644 >>>>>>> --- a/mkfs/f2fs_format.c >>>>>>> +++ b/mkfs/f2fs_format.c >>>>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) >>>>>>> c.cur_seg[CURSEG_COLD_DATA] = 0; >>>>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); >>>>>>> } else if (c.zoned_mode) { >>>>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0; >>>>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>>>> + c.devices[0].total_segments : 0; >>>>>>> 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);
On 1/31/2024 2:00 AM, Daeho Jeong wrote: > On Mon, Jan 29, 2024 at 6:17 PM Yongpeng Yang <yangyongpeng1@oppo.com> wrote: >> >> cur_seg[CURSEG_COLD_DATA] will exceed end boundary of main area when: >> device[1]: zone device size = [2 MB ~ 10MB] >> >> So, if there are not enough seq zones for six cursegs, we should still >> assign 0 to c.cur_seg[CURSEG_HOT_NODE] or reserve several conv zones for >> cursegs. > > To tackle that case, how about this? > > } 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; > } > It seems fine, thanks. >> >> On 1/29/2024 11:47 PM, Daeho Jeong wrote: >>> On Sun, Jan 28, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >>>> >>>> On 2024/1/27 2:17, Daeho Jeong wrote: >>>>> On Thu, Jan 25, 2024 at 5:27 PM Chao Yu <chao@kernel.org> wrote: >>>>>> >>>>>> On 2024/1/26 0:25, Daeho Jeong wrote: >>>>>>> On Wed, Jan 24, 2024 at 7:34 PM Chao Yu <chao@kernel.org> wrote: >>>>>>>> >>>>>>>> +Cc Yongpeng Yang >>>>>>>> >>>>>>>> Daeho, >>>>>>>> >>>>>>>> Yongpeng reports a potential issue: if c.devices[0].total_segments is >>>>>>>> larger than segments of mainarea, c.cur_seg[CURSEG_HOT_NODE] will exceed >>>>>>>> end boundary of mainarea. Could you please check that? though it's a corner >>>>>>>> case. >>>>>>> >>>>>>> Can you elaborate more? >>>>>> >>>>>> Since c.cur_seg[CURSEG_HOT_NODE] is an offset started from main_blkaddr. >>>>> >>>>> Oh, Got it. >>>>> Then, how about this? >>>>> >>>>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>> (c.devices[1].start_blkaddr - >>>>> get_sb(main_blkaddr)) / c.blks_per_seg : 0; >>>> >>>> Better, but log header should align to start blkaddr of zone? >>> >>> It's already aligned here. >>> >>> if (c.zoned_mode && c.ndevs > 1) >>> zone_align_start_offset += >>> (c.devices[0].total_sectors * c.sector_size) % >>> zone_size_bytes; >>> >>> ... >>> >>> for (i = 0; i < c.ndevs; i++) { >>> if (i == 0) { >>> c.devices[i].total_segments = >>> (c.devices[i].total_sectors * >>> c.sector_size - zone_align_start_offset) / >>> segment_size_bytes; >>> c.devices[i].start_blkaddr = 0; >>> c.devices[i].end_blkaddr = c.devices[i].total_segments * >>> c.blks_per_seg - 1 + >>> sb->segment0_blkaddr; >>> } else { >>> c.devices[i].total_segments = >>> c.devices[i].total_sectors / >>> (c.sectors_per_blk * c.blks_per_seg); >>> c.devices[i].start_blkaddr = >>> c.devices[i - 1].end_blkaddr + 1; >>> >>> ... >>> >>> total_meta_zones = ZONE_ALIGN(total_meta_segments * >>> c.blks_per_seg); >>> >>> set_sb(main_blkaddr, get_sb(segment0_blkaddr) + total_meta_zones * >>> c.segs_per_zone * c.blks_per_seg); >>> >>>> >>>> Thanks, >>>> >>>>> >>>>>> If c.cur_seg[CURSEG_HOT_NODE] was assigned w/ c.devices[0].total_segments, >>>>>> and c.devices[0].total_segments is larger than segments of mainare, >>>>>> c.cur_seg[CURSEG_HOT_NODE] will exceed the end boundary of mainarea. >>>>>> >>>>>> c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>>> c.devices[0].total_segments : 0; >>>>>> >>>>>>> In the case of F2FS_ZONED_HM, we have the devices[1]. >>>>>>> Do you mean the case we format the filesystem intentionally smaller >>>>>>> than what devices have? >>>>>> >>>>>> I mean blew case: >>>>>> device[0]: conventional device size = 10240 MB >>>>>> device[1]: zone device size = 2 MB >>>>>> >>>>>> Thanks, >>>>>> >>>>>>> >>>>>>>> >>>>>>>> On 2024/1/18 7:00, 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> >>>>>>>>> --- >>>>>>>>> mkfs/f2fs_format.c | 3 ++- >>>>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>>>> >>>>>>>>> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c >>>>>>>>> index f2840c8..91a7f4b 100644 >>>>>>>>> --- a/mkfs/f2fs_format.c >>>>>>>>> +++ b/mkfs/f2fs_format.c >>>>>>>>> @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) >>>>>>>>> c.cur_seg[CURSEG_COLD_DATA] = 0; >>>>>>>>> c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); >>>>>>>>> } else if (c.zoned_mode) { >>>>>>>>> - c.cur_seg[CURSEG_HOT_NODE] = 0; >>>>>>>>> + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? >>>>>>>>> + c.devices[0].total_segments : 0; >>>>>>>>> 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);
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index f2840c8..91a7f4b 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -557,7 +557,8 @@ static int f2fs_prepare_super_block(void) c.cur_seg[CURSEG_COLD_DATA] = 0; c.cur_seg[CURSEG_WARM_DATA] = next_zone(CURSEG_COLD_DATA); } else if (c.zoned_mode) { - c.cur_seg[CURSEG_HOT_NODE] = 0; + c.cur_seg[CURSEG_HOT_NODE] = c.zoned_model == F2FS_ZONED_HM ? + c.devices[0].total_segments : 0; 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);