From patchwork Tue Sep 20 09:11:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12981723 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFEE8C6FA92 for ; Tue, 20 Sep 2022 09:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663665107; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2BeTcXZyG911h0Az+5AdoinHgSVo2TQI5iHzUm6bRMY=; b=YAS/oX0vCyPCNGPuRVsiCbZs42cTaO9abUpBQDgvpW9kofpmw6b4HWK5x//RaYqvNsfRAa dC//ZPHytWUl0JPz8E06G6shaJdp7ERHUc/VZ5w+95+mgdXeXOOrsRpLsiWdfutEauXKs5 YgamAxbvycmaFFS60MFxjKGjlQX52fs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-BIxDa0edOkqXkSfwpEP__g-1; Tue, 20 Sep 2022 05:11:43 -0400 X-MC-Unique: BIxDa0edOkqXkSfwpEP__g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E657382578B; Tue, 20 Sep 2022 09:11:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44B1F49BB61; Tue, 20 Sep 2022 09:11:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3829419465B1; Tue, 20 Sep 2022 09:11:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CDB3719465A0 for ; Tue, 20 Sep 2022 09:11:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B0F56140EBF6; Tue, 20 Sep 2022 09:11:39 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A82A3140EBF5 for ; Tue, 20 Sep 2022 09:11:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88CFF858F17 for ; Tue, 20 Sep 2022 09:11:39 +0000 (UTC) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-423-etiSD-nGMiWPsa4f_RqIaA-1; Tue, 20 Sep 2022 05:11:37 -0400 X-MC-Unique: etiSD-nGMiWPsa4f_RqIaA-1 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220920091136euoutp02fbe820cdd950c3202bc73b0608c5dba2~Whpc7jXJy2701927019euoutp02X for ; Tue, 20 Sep 2022 09:11:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220920091136euoutp02fbe820cdd950c3202bc73b0608c5dba2~Whpc7jXJy2701927019euoutp02X Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220920091134eucas1p22889d52d26e777aa61ebbb2e5ad9af26~WhpbYJLHR0517305173eucas1p2s; Tue, 20 Sep 2022 09:11:34 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 30.A8.19378.6C389236; Tue, 20 Sep 2022 10:11:34 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220920091134eucas1p275585b70fab48ba1f19eb5d2cc515b6d~Whpa12S-q3248232482eucas1p2J; Tue, 20 Sep 2022 09:11:34 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220920091134eusmtrp15d0f5cecabf3dcf273ccc8731df62cd8~Whpa09uTe0212802128eusmtrp1A; Tue, 20 Sep 2022 09:11:34 +0000 (GMT) X-AuditID: cbfec7f5-a35ff70000014bb2-d8-632983c62ae3 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DE.53.10862.6C389236; Tue, 20 Sep 2022 10:11:34 +0100 (BST) Received: from localhost (unknown [106.210.248.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220920091133eusmtip2591d1a82333699ba03c6a5b5a251224e~Whpah9jrW2175621756eusmtip2h; Tue, 20 Sep 2022 09:11:33 +0000 (GMT) From: Pankaj Raghav To: agk@redhat.com, snitzer@kernel.org, axboe@kernel.dk, damien.lemoal@opensource.wdc.com, hch@lst.de Date: Tue, 20 Sep 2022 11:11:19 +0200 Message-Id: <20220920091119.115879-14-p.raghav@samsung.com> In-Reply-To: <20220920091119.115879-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87rHmjWTDVaeV7NYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWtw8sJPJYs+iSUwWK1cfZbJ4sn4Ws8XfrntA2VvaFpd3 zWGzmL/sKbvFhLavzBafl7awW6y5+ZTF4sQtaQchj8tXvD12zrrL7nH5bKnHplWdbB6bl9R7 7L7ZwOaxs/U+q8f7fVfZPPq2rGL02Hy62uPzJjmP9gPdTAE8UVw2Kak5mWWpRfp2CVwZ3ddb 2Aum1Vec+nuBvYHxZ0oXIyeHhICJxM6/DUxdjFwcQgIrGCUutU5mgXC+MEp8m72GFcL5zCjR 824tG0zLr1n3GCESyxklWh+tYIdwXjJK/JnzAqifg4NNQEuisZMdpEFEIF3i69cNYA3MApOZ JV68msQCkhAGSqz+eQXMZhFQlWhcNIkRxOYVsJb49WQGI8Q2eYmZl76DDeIEis/Z3cIGUSMo cXLmE7BeZqCa5q2zmUEWSAhs5pS4+GkNO0Szi0T7nqtQtrDEq+NboGwZidOTe1gg7GqJpzd+ QzW3MEr071zPBvKBBNC2vjM5ICazgKbE+l36EOWOEueubmKHqOCTuPFWEOIEPolJ26YzQ4R5 JTrahCCqlSR2/nwCtVRC4nLTHKilHhI93ecZJzAqzkLyzCwkz8xC2LuAkXkVo3hqaXFuemqx cV5quV5xYm5xaV66XnJ+7iZGYEo8/e/41x2MK1591DvEyMTBeIhRgoNZSYS3xV8zWYg3JbGy KrUoP76oNCe1+BCjNAeLkjhvcuaGRCG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KDWUmEt8Vf M1mINyWxsiq1KD++qDQntfgQoynQ3ROZpUST84HJI68k3tDMwNTQxMzSwNTSzFhJnNezoCNR SCA9sSQ1OzW1ILUIpo+Jg1OqgamcxX7f5YkTm6eVKHtmcfOul7m+8/qk8k/T7dWrpjQvXCn6 d9pVHsuvW1WfBxTZrYtVrF0yV+DushnKJ8SzZs5dfJs74W6wNl+TuMSPHTe6LfwEHv9KS673 2dgfEch4Uq9o+Yr1DW4OR943GS4ofxtofmDGkzcRcyZMydjw1aTobkdPSK30zyvpYp2fCibu 3q0m+VCxfifvjzs6ym5pVvmbWl+9vfo44YRQkZ202Etv9de6Ma+fSnU7rI7Zt0ZHbfvfQ/NX qN/jENzxv/Foz6KbKnlP99ULX9tatuSxsZfOuQ8eD5ziZrhOv1DbaHPx7vwrqnzmDx+tyTdZ xn3306y++1xRfNwKp9TYF5ziXTNfiaU4I9FQi7moOBEAE8XxdmYDAAA= X-CMS-MailID: 20220920091134eucas1p275585b70fab48ba1f19eb5d2cc515b6d X-Msg-Generator: CA X-RootMTR: 20220920091134eucas1p275585b70fab48ba1f19eb5d2cc515b6d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220920091134eucas1p275585b70fab48ba1f19eb5d2cc515b6d References: <20220920091119.115879-1-p.raghav@samsung.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: [dm-devel] [PATCH v14 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pankaj Raghav , Damien Le Moal , bvanassche@acm.org, pankydev8@gmail.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Johannes Thumshirn , jaegeuk@kernel.org, matias.bjorling@wdc.com Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Only zoned devices with power-of-2(po2) number of sectors per zone(zone size) were supported in linux but now non power-of-2(npo2) zone sizes support has been added to the block layer. Filesystems such as F2FS and btrfs have support for zoned devices with po2 zone size assumption. Before adding native support for npo2 zone sizes, it was suggested to create a dm target for npo2 zone size device to appear as a po2 zone size target so that file systems can initially work without any explicit changes. The design of this target is very simple: remap the device zone size to the zone capacity and change the zone size to be the nearest power of 2 value. For e.g., a device with a zone size/capacity of 3M will have an equivalent target layout as follows: Device layout :- zone capacity = 3M zone size = 3M |--------------|-------------| 0 3M 6M Target layout :- zone capacity=3M zone size = 4M |--------------|---|--------------|---| 0 3M 4M 7M 8M The area between target's zone capacity and zone size will be emulated in the target. The read IOs that fall in the emulated gap area will return 0 filled bio and all the other IOs in that area will result in an error. If a read IO span across the emulated area boundary, then the IOs are split across them. All other IO operations that span across the emulated area boundary will result in an error. The target can be easily created as follows: dmsetup create