Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1839459rdb; Wed, 31 Jan 2024 10:33:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFouzlcrpxb+RK5iDm9EVqGtUm+lvJcZD02gOKnb2Yxt8tZnLtu6OwUx5btIu8h0iZajfAV X-Received: by 2002:ac8:5cc7:0:b0:42a:ad8a:1e23 with SMTP id s7-20020ac85cc7000000b0042aad8a1e23mr3407837qta.62.1706726003720; Wed, 31 Jan 2024 10:33:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706726003; cv=pass; d=google.com; s=arc-20160816; b=iLlZjWIaWNuJvaidmbuXfDXM+62aLERQXnI8n2msHnH1rkMsph+vykJBX8OfJiOusB +6nxJjxhuhNxZvlHBVAy4an86iAqa0TmMHAvpTtR4MRNfcE1WFJQD/klhNoYxAoC1tzE 9bmiSpzvAw9p4JJ1+pCz+YrCiAcESvXKMD7EAFJ4bxHqRk273O3Arv6zuitr7aymf+f8 dMdt+GAbrXfSNVgd/0tpI25vK3rPtlf8N3WQkDOg3Az8JosLX585R2qBkdjlbWAV9v8j kW1QH91lXAbnbqesqEakdpB8Xw5fT3VQzttDAKjil3fkJpF2uB8wk7/DslsFz9vwIbys +6nA== 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=i3HqJfEyYAV9x9E8qNujfqhtfVC27wsVyRT1JllQJy4=; fh=CGoaO4P7pfCtZip6Js4VqSd9NEpiA6XNXKNhn3EdhUE=; b=S5BpXC79Qiqdd12IaTdfgDkkt2zXY7upxysLHyNwFaC+nAvs/AQYjPCXiWHrkwC7TE nXnPBCIYdMPdaBSIq28/jTjYnMeQuAYdH2qaSx0p1PBlJRB/hlEikhrwM/krBBKaJrvk 1LXEYq5E2TXCP0I2HRr+Vvp/wvPgFpxnyA2WSvCq0N6i8c006pFSJIkpdvq3PrI/3Z5d hsd+XIIWRCr9Bv5XOwnd5ZOslV9Lay2z/hVQKzXekAPORwCZq2KUmGCD9i7tkFJNGuMg fTWfIHQon3f1iiMiE3xxuZno4M7T2LwlETQdFUXC8IeXoZKwKNgBZ/fsY1qD4rZ4S6J9 M4gQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Nl190URC; 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-46972-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46972-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUbnkbka80EVzhmAzGWnPUFDijlb3Cg0Ymo1aMzfOrzJLVeuKY7H9ViFWLSO9Q02rKY3SNV5N9flnMoGa+toF79SH3pK7W7fBZLLEWCSw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j9-20020a05622a038900b0042a7092c7fesi12746709qtx.477.2024.01.31.10.33.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:33:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46972-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Nl190URC; 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-46972-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46972-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 79B2C1C23011 for ; Wed, 31 Jan 2024 18:33:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB95B14A9E; Wed, 31 Jan 2024 18:33:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nl190URC" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 AB3E520DDA for ; Wed, 31 Jan 2024 18:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706725996; cv=none; b=sAY7YUmmvsKJ1qmS717VKp4KpSJcvMOlqGQ/Yq/7fHLhLtGvujwT/b9JRmjzqQ9svaZpkHVS4riqW5Zsj5cf9XMkZFJTOR0npambtPn5bzsp/pbO6q7ScG6wwqjePHqKUxk5uhpLzr0+q5NFZCVjKxmxWzqIKXrPsrmAOPg+c4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706725996; c=relaxed/simple; bh=MY8JtRhZcNmuRzCHA1QKNmscqeTHXjyq/nYHOBTf8h4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Wry6jHJeWvN/CnOrcQbsAt62qfDzjKDoasoWI8kabaZtbfV0TjnW//mRy1kzKt69ZEb+mAURaTRFjzp1H2fns61afa6w706r0et6usch9HogL0YBrEFPVDB3+4qHP9/bsdksXc61/cn5qY1hdnftsIxAZADUFE2qgYR9Z1tx+G4= 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=Nl190URC; arc=none smtp.client-ip=209.85.210.173 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-pf1-f173.google.com with SMTP id d2e1a72fcca58-6daf694b439so21058b3a.1 for ; Wed, 31 Jan 2024 10:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706725994; x=1707330794; 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=i3HqJfEyYAV9x9E8qNujfqhtfVC27wsVyRT1JllQJy4=; b=Nl190URCinC3Sc+pHbOU9/lYkJYhdsEmut9iqqh7Hj97RMHNMXctHJ7kSHNd/3SSaA T5G6d6usK8bAgqpRXOXZaS/13zSwIXgisPSYyleZuZ796s4eZPyEfpyuUFz9jZO34hQR IbPRYeC6kLTM+prPz1ZwKzT+vvwkFSji+mJSi+M8dTgjYUbjxbOS1TBiHiLr8S3zT2ww X9qDFKnDxh76vz9SPuCIIQ5Fom6NlRVkHnmVaBwSA5whknOoY7U72xVlWFuxxWLw4peu Ms+tuLZFnc6Tqb5UGseIZ582HTdJfSaUPq1I8a3IHV9QSLZ/AU4FLWgwvPoyq+A6X2RK pqGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706725994; x=1707330794; 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=i3HqJfEyYAV9x9E8qNujfqhtfVC27wsVyRT1JllQJy4=; b=cPpGW4LlLNF+K4yGRzry+eaEQCR2SHENvCmYDqIctT5h4fEE42Bogu8OzApOYUxO2x DIszPWi8eo3UZIIacU7y57gFXpPTn7lfNppx7X+DW0sSZbavlKulP0mA5AyKYd8kk41A 13zpt+Tumrm29ykA3CQ87b01C4c2vLd0L1WQebIIRK9RrA3QNBkRtXQt9r3podUUENCt TuM2NCniLjh2qGZML0z8Ovyb3d2unZpo7mhdyUnnCrXoQDtC8tqhHrokQKblCuvIRkTh HT8stxvuq+LY/an0mTrILN3xAcNDP6rBxde5WZe7PbdA3sKkEwzf5Ta3xD20ZpBVMwcm dyjw== X-Gm-Message-State: AOJu0YyfNuuxFAvQQDWq/8K2Ny91LRAUvHtJoNnkBJ47tqUnCPm0HZ3x EESbFIU62fpM1N/afCumloouONsxKGVdBAfKXdyC9dmvqgI9nKlYpPpf7xwn X-Received: by 2002:a05:6a00:99e:b0:6dd:a0a7:ad9a with SMTP id u30-20020a056a00099e00b006dda0a7ad9amr3271685pfg.25.1706725993619; Wed, 31 Jan 2024 10:33:13 -0800 (PST) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:0:1000:8411:436b:ab62:1d08:45ea]) by smtp.gmail.com with ESMTPSA id i21-20020aa787d5000000b006d9c216a9e6sm10300369pfo.56.2024.01.31.10.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:33:13 -0800 (PST) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH v2] f2fs-tools: allocate logs after conventional area for HM zoned devices Date: Wed, 31 Jan 2024 10:33:06 -0800 Message-ID: <20240131183306.536372-1-daeho43@gmail.com> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Daeho Jeong Make to allocate logs after conventional area for HM zoned devices to spare them for file pinning support. Signed-off-by: Daeho Jeong --- 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