From patchwork Wed Aug 3 09:48:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12935325 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 0032FC19F28 for ; Wed, 3 Aug 2022 09:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659520106; 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=gpZwOSyfqdR/0b5WBYjpgQcY8unJNlXAmwsNEpQCHFg=; b=FDnGFmDQ46lOv8Gxdu4EJbl/ItzjIxd2bO0y7njmgJIW6exT6aYLL3zr5qb9cg+M3UJb/X e2t7LowCzfuABAoCrM4m4tOFgzm+dt01r1vpHYgvxcA2wJkpJSTaOz4DAh6auww5uoCuQl 8gAfi+NlSUwqcPRW+hG7aTTWVLGYEM8= 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-44-AUNB5F4GPN2VYy1CDIyjlA-1; Wed, 03 Aug 2022 05:48:25 -0400 X-MC-Unique: AUNB5F4GPN2VYy1CDIyjlA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B38B1C05EBD; Wed, 3 Aug 2022 09:48:23 +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 46A0790A04; Wed, 3 Aug 2022 09:48:23 +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 274281946A50; Wed, 3 Aug 2022 09:48:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A42731946A4E for ; Wed, 3 Aug 2022 09:48:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8707C400DEF8; Wed, 3 Aug 2022 09:48:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81BA3400EAB2 for ; Wed, 3 Aug 2022 09:48:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 65255811E84 for ; Wed, 3 Aug 2022 09:48:21 +0000 (UTC) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-133-VCh_vjQbO1Cq4RCRMiMFOg-1; Wed, 03 Aug 2022 05:48:19 -0400 X-MC-Unique: VCh_vjQbO1Cq4RCRMiMFOg-1 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220803094818euoutp019428ca1d000aedcdf5916cfc46f112a5~HzLyzuXU00037100371euoutp01D for ; Wed, 3 Aug 2022 09:48:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220803094818euoutp019428ca1d000aedcdf5916cfc46f112a5~HzLyzuXU00037100371euoutp01D Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220803094816eucas1p1b2947b917caf6601922bdaac476f6824~HzLxRR4Ef3109731097eucas1p1g; Wed, 3 Aug 2022 09:48:16 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 4F.06.10067.0644AE26; Wed, 3 Aug 2022 10:48:16 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220803094816eucas1p1890ceb4faebaf4f0cdbc9581d1308672~HzLwzq_rx1902519025eucas1p1R; Wed, 3 Aug 2022 09:48:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220803094816eusmtrp269f6b61586e288f08181b7c336900f37~HzLwy1l8g0972009720eusmtrp2i; Wed, 3 Aug 2022 09:48:16 +0000 (GMT) X-AuditID: cbfec7f4-dc1ff70000002753-6f-62ea446098ad Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 85.EB.09095.0644AE26; Wed, 3 Aug 2022 10:48:16 +0100 (BST) Received: from localhost (unknown [106.210.248.112]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220803094816eusmtip261e6159d7d5bba642bb130f09846acf0~HzLwcNAPi1679316793eusmtip2f; Wed, 3 Aug 2022 09:48:16 +0000 (GMT) From: Pankaj Raghav To: Johannes.Thumshirn@wdc.com, snitzer@kernel.org, axboe@kernel.dk, damien.lemoal@opensource.wdc.com, agk@redhat.com, hch@lst.de Date: Wed, 3 Aug 2022 11:48:01 +0200 Message-Id: <20220803094801.177490-14-p.raghav@samsung.com> In-Reply-To: <20220803094801.177490-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCKsWRmVeSWpSXmKPExsWy7djP87oJLq+SDN5M1LNYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWtw8sJPJYs+iSUwWK1cfZbJ4sn4Ws8XfrntA2VvaFpd3 zWGzmL/sKbvFhLavzBafl7awW6y5+ZTF4sQtaQchj8tXvD12zrrL7nH5bKnHplWdbB6bl9R7 7L7ZwOaxs/U+q8f7fVfZPPq2rGL02Hy62uPzJjmP9gPdTAE8UVw2Kak5mWWpRfp2CVwZh3/u YSw4V1hxveUHewPj5qguRk4OCQETialvuli7GLk4hARWMEo8X7eQESQhJPCFUaLtoCtE4jOj xNem7YwwHYebvzJBJJYzSsy4eo8ZwnnJKHF2WgvQLA4ONgEticZOdpC4iEAzo8Tdvz1gO5gF PjNJrNg3kxlklLBAmsTNvoNgNouAqsTSI5/AbF4Ba4kpD04yQ6yTl5h56Ts7iM0JEv/3D6pG UOLkzCcsIDYzUE3z1tlQ9ds5JZoXhEHYLhIvTi1mgrCFJV4d38IOYctI/N85HypeLfH0xm+w DyQEWhgl+neuZwP5QAJoWd+ZHBCTWUBTYv0ufYhyR4mFp3vZISr4JG68FYS4gE9i0rbpzBBh XomONiGIaiWJnT+fQC2VkLjcNIcFwvaQmPa4l30Co+IsJL/MQvLLLIS9CxiZVzGKp5YW56an FhvlpZbrFSfmFpfmpesl5+duYgQmxNP/jn/Zwbj81Ue9Q4xMHIyHGCU4mJVEeO+4PE8S4k1J rKxKLcqPLyrN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/VR71DjEwcjIcYJTiYlUR4 77g8TxLiTUmsrEotyo8vKs1JLT7EaAp090RmKdHkfGACySuJNzQzMDU0MbM0MLU0M1YS5/Us 6EgUEkhPLEnNTk0tSC2C6WPi4JRqYIqcxXm2SFZr77Nsf8fEWsmXS66y+S3cWPU1Rmpth+mN a4cFRVeq3OLRykhYvN8xtiHikdnR77NDYjoE7/78se0k3+evQRvLJv51vphnd/Ry9Fs7PZ1y JtdytyIZpoN7eFJ4+gTV/fdVHj/91XIRz4HDP0sKP8ssDeet/hlfvFHFy68yrP3UpNaXd8K/ 3/g2/+6pGx/2PuoNijLcv91r5+/Le5ZUqe2a9v1+xH0roRfvdh6XTvcVkJlx8/uN3jO+naXz X+y3Z9q3UrOSd6Fe63kOA8fJ6x5PS2w7q+5o11H9YPeG5qMbZDS3yN2ct2War9L6nZP/nTu8 sHsXi7SkqPsLnVsXDu/p+1Kz9kled1S1EktxRqKhFnNRcSIAsAmZAGgDAAA= X-CMS-MailID: 20220803094816eucas1p1890ceb4faebaf4f0cdbc9581d1308672 X-Msg-Generator: CA X-RootMTR: 20220803094816eucas1p1890ceb4faebaf4f0cdbc9581d1308672 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220803094816eucas1p1890ceb4faebaf4f0cdbc9581d1308672 References: <20220803094801.177490-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 2.84 on 10.11.54.1 Subject: [dm-devel] [PATCH v9 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 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Only zoned devices with power-of-2(po2) zone sizes 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 size zoned target so that file systems can initially work without any explicit changes by using this target. 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 number of sectors. 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