From patchwork Tue Aug 23 12:18:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12952024 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 71A88C32793 for ; Tue, 23 Aug 2022 12:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661257167; 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=aYnIjHsr6pJqUK0eFucCXWJ/QsCaIATfaiNbyVEhh7A=; b=IF5tcL9HJ7EI7/bvAJ2cks1Ds9prbOXCBJ/m+ZbEBa7yRUrJf++pxSos+yHhhn9RstKgyP B82S/xNvJbC2StfwDZOnCMfrLvocqd8MlTPcLtPRUuwNXhNzsc5+4tDEFha04GaRXWA8YH C7DJ0v7S5oJzW95p7Usof3Y3j77i7fg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-eqm6ZIi3MgerNmOjSbxiIw-1; Tue, 23 Aug 2022 08:19:26 -0400 X-MC-Unique: eqm6ZIi3MgerNmOjSbxiIw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D82B1034ADC; Tue, 23 Aug 2022 12:19: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 8901D40315A; Tue, 23 Aug 2022 12:19: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 760531946A47; Tue, 23 Aug 2022 12:19:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 323761946A40 for ; Tue, 23 Aug 2022 12:19:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 235FF40D2831; Tue, 23 Aug 2022 12:19:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F73640D2830 for ; Tue, 23 Aug 2022 12:19:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 04B173C0D85B for ; Tue, 23 Aug 2022 12:19:22 +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-624-gHFXhYBQPheVE4Fnw7mm1Q-1; Tue, 23 Aug 2022 08:19:19 -0400 X-MC-Unique: gHFXhYBQPheVE4Fnw7mm1Q-1 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220823121917euoutp02b3311afcb14ef004a3752006538da0b0~N_JVa1zt42196021960euoutp02c for ; Tue, 23 Aug 2022 12:19:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220823121917euoutp02b3311afcb14ef004a3752006538da0b0~N_JVa1zt42196021960euoutp02c Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220823121915eucas1p231640ad5e7f8ec5252be3cc2c8cd9b7a~N_JTiAgiD2416724167eucas1p2W; Tue, 23 Aug 2022 12:19:15 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 75.81.07817.3C5C4036; Tue, 23 Aug 2022 13:19:15 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de~N_JS8cGJv1882118821eucas1p1c; Tue, 23 Aug 2022 12:19:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220823121915eusmtrp1e7eaddb67677c16e1ef95c0060c64f9e~N_JS7k_NJ1042010420eusmtrp1Q; Tue, 23 Aug 2022 12:19:15 +0000 (GMT) X-AuditID: cbfec7f4-893ff70000011e89-81-6304c5c35beb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 49.81.10862.3C5C4036; Tue, 23 Aug 2022 13:19:15 +0100 (BST) Received: from localhost (unknown [106.210.248.52]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220823121914eusmtip2c71e3c24e4f992e4008983a29b4f3900~N_JShQGib1590015900eusmtip2M; Tue, 23 Aug 2022 12:19:14 +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, 23 Aug 2022 14:18:59 +0200 Message-Id: <20220823121859.163903-14-p.raghav@samsung.com> In-Reply-To: <20220823121859.163903-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djPc7qHj7IkG9xvMrJYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWtw8sJPJYs+iSUwWK1cfZbJ4sn4Ws8XfrntA2VvaFpd3 zWGzmL/sKbvFhLavzBafl7awW6y5+ZTF4sQtaQchj8tXvD12zrrL7nH5bKnHplWdbB6bl9R7 7L7ZwOaxs/U+q8f7fVfZPPq2rGL02Hy62uPzJjmP9gPdTAE8UVw2Kak5mWWpRfp2CVwZbWvv shccKqk43n6GpYHxYkwXIyeHhICJxISj89i7GLk4hARWMErcW7gNyvkC5DSvZYNwPjNKfGnq YoNpWfDjLFRiOaPE5T0LGSGcF4wSrTNvsXYxcnCwCWhJNHaygzSICKRLfP26AayGWWAis8S0 200sIAlhoMSs6+9ZQWwWAVWJ2/smMILYvALWEgt3v2KG2CYvMfPSd7BBnEDxeUtPQdUISpyc +QRsDjNQTfPW2cwgCyQENnNKfH56DOpUF4mjhy9D2cISr45vYYewZSROT+5hgbCrJZ7e+A3V 3MIo0b9zPRvIBxJA2/rO5ICYzAKaEut36UOUO0rsX3CeGaKCT+LGW0GIE/gkJm2bDhXmleho E4KoVpLY+fMJ1FIJictNc6CWeki0n3/JPIFRcRaSZ2YheWYWwt4FjMyrGMVTS4tz01OLjfJS y/WKE3OLS/PS9ZLzczcxAlPi6X/Hv+xgXP7qo94hRiYOxkOMEhzMSiK81RcZkoV4UxIrq1KL 8uOLSnNSiw8xSnOwKInzJmduSBQ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HvUOMTByMhxglOJiVRHir LzIkC/GmJFZWpRblxxeV5qQWH2I0Bbp7IrOUaHI+MHnklcQbmhmYGpqYWRqYWpoZK4nzehZ0 JAoJpCeWpGanphakFsH0MXFwSjUwTY08/vTjqpbkwDl3D+3tNLTQFbx9S9KI5ew2hYnJ89xs rh5lkeN1FpU6p7LAKKv0+zt7H7v0mVZWWnpRQb4/W9ybnW1f28/bupPHiMf23jKF2rnrHjJ8 3TTRKXlyNUdg5crPKgy7/v5juVCXuIox4X36x3s91/d89q1SkbNbseZsXoPhfq7/d4MNmdzv hf/xXmV/dc/+wCVeCyv0E77OS//cx3Vq3uS+S9+a27/KBIblnBb5e/qjCVf4b02ppjtTlE/e K96WfaWuN9uDtzv3tpDQrilb7nUK7nn3umdnSkdwjEzI2mVRUsIlhtseObecOX9za+AkF8lU rc7v8Wb7ZzdauHxQYS7PuH//xoybSizFGYmGWsxFxYkAgbScY2YDAAA= X-CMS-MailID: 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de X-Msg-Generator: CA X-RootMTR: 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de References: <20220823121859.163903-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.2 Subject: [dm-devel] [PATCH v12 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, Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, gost.dev@samsung.com, jaegeuk@kernel.org, matias.bjorling@wdc.com Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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 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 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