From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8954C04A68 for ; Thu, 28 Jul 2022 04:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229704AbiG1EdZ (ORCPT ); Thu, 28 Jul 2022 00:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiG1EdY (ORCPT ); Thu, 28 Jul 2022 00:33:24 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E719057239 for ; Wed, 27 Jul 2022 21:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1658982802; x=1690518802; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qYi9CddhMTc16oCfTA5/fPBxT6fjV6ZJpvffXNGyyMo=; b=Nfzy1mz8OMODs4XkKfDdhgL9ZjxDqq95PgZK7h9QIYqSTixxsm1E46xm AZlxPCrhSz1O1W+H8q2PzFI1TKrrQJYtLRd16vANGXeH44m3jweIhM14c 7pXkqLCZJDzeEMlRxaSQ6r7ghgd3jHu4PAb+AWHjRNk3BXDWKwnjlAixo q/u/7j7Jsuj0H/UMS1g15MAR/mdFCAv8otVSSy1h55Oj6Qf5+aSH8RtGp fziYpER6nh0dUUd66MmXTI6/t8GFYNZePzBauhe8Hj8XHaZx/0R44PQQi Yc3xEbFB5vPrXABaOhu/saP+rESYifdWyCm5THADEHigDfO6GvdSP+Nmv g==; X-IronPort-AV: E=Sophos;i="5.93,196,1654531200"; d="scan'208";a="311440699" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jul 2022 12:33:21 +0800 IronPort-SDR: GwkVS3hNHYtcO27SWT/VGjfUNobiGdrkIRlVYJ3dONyOuE9Vsry1WDQ7s6Je4LCi368FhJsJIy kbKTjY0tGu0FDJWwqdmzUzND8YYAYgp9B01X0zWzTLwpehniIiyKGr/VYwz1aQEv/zcj17+4W9 OG4K1Kh1xMP+FtjuFk9zkqwCQLAkB0GTSreE2X5WewbvjArnJPKi0ei5X4UXx2OHmRc2kAc9iD 85d4jjTrU4FvMZwuUhyJ5GSxNcFRHWfcmCPWOnrl23pZVQDJD9uxCIWFgIhCd+op83v6itfwBf acW2gKto9lSaTLPqEsjpmH2l Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Jul 2022 20:54:32 -0700 IronPort-SDR: nidDN29995BcqGo5TqYNA9ZgbOFfeY3lpI78c3BZvNSNc7L2rDwSnVuC8RoER2wechIwv468Eo RvjWynw78e6eiORE9JkWY+HacEasrRnsunRzDwCwFFzW6+A4WPdnGtifH+slvetijsKS2LzL54 DQOkmdecuhNoGATcR7aX20oAl9jsK9Y+R4AkW62n0FT19NSQtVxJ/szsiRgC9ihNy+8iEjgWo0 zkUWERiT3cE6buig1/4evc1PTTfhiX8mH+VFD0+16efWz2dMXHIchLfPzTNr2DtHRiVLaxwcvK sVo= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Jul 2022 21:33:22 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4Ltd7P2VMlz1Rws0 for ; Wed, 27 Jul 2022 21:33:21 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1658982796; x=1661574797; bh=qYi9CddhMTc16oCfTA5/fPBxT6fjV6ZJpvf fXNGyyMo=; b=ku0lwH+u2dvyl1F0eUh8TkuHxT0+3vN8+PhPZHih44gNL5mNiM0 7PX4qNhHcpvp+fFxSVdZjPhsu7GautzKz2VIcLBfxWSrpY2XMhRo2Efx94Qwzy4S Ym7JUvlzMJywF9toKzJeOVepdKAfGwFVhOm7YvkIVzOAAiT30eGzmbfGPLemMHiL KSEZq+QzeC2HZjKF6hFqeNpO52MzeXk+yut7//Vn4TrNlhwFmBZvcxA2r5LgCYSC PbOFJuA/NZ2Rm/thUZq+MegjgmbFACUZgSUV1pBCtq90ytj6ru5V5LBVHG9YyaTT CHES8XUE7MpaoKLxZKObcwvgss2PUwEH9pg== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JSpjfmPgy-TD for ; Wed, 27 Jul 2022 21:33:16 -0700 (PDT) Received: from [10.225.163.14] (unknown [10.225.163.14]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4Ltd7G0cPXz1RtVk; Wed, 27 Jul 2022 21:33:13 -0700 (PDT) Message-ID: <8fc11ae3-ddc4-4509-5374-04722a740bde@opensource.wdc.com> Date: Thu, 28 Jul 2022 13:33:12 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v8 11/11] dm: add power-of-2 zoned target for non-power-of-2 zoned devices Content-Language: en-US To: Pankaj Raghav , hch@lst.de, axboe@kernel.dk, snitzer@kernel.org, Johannes.Thumshirn@wdc.com Cc: matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, linux-block@vger.kernel.org, pankydev8@gmail.com, bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, Damien Le Moal References: <20220727162245.209794-1-p.raghav@samsung.com> <20220727162245.209794-12-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220727162245.209794-12-p.raghav@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 7/28/22 01:22, Pankaj Raghav wrote: > Only power-of-2(po2) zoned devices were supported in linux but now non > power-of-2(npo2) zoned device support has been added to the block layer. Please rephrase this spelling out "zone size" in the text. As mentioned before, "power-of-2(po2) zoned devices" is very unclear to people not familiar with zoned block devices. > > Filesystems such as F2FS and btrfs have support for zoned devices with > po2 zone size assumption. Before adding native support for npo2 zoned > devices, it was suggested to create a dm target for npo2 zoned device to > appear as a po2 target so that file systems can initially work without any > explicit changes by using this target. > > The design of this target is very simple: introduce gaps between the > underlying device's zone size and the nearest po2 device zone size. > Device's actual zone size becomes the zone capacity of the target and > device's nearest po2 zone size becomes the target's zone size. 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 numner 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 > > All IOs will be remapped from target to the actual device location. That is what DM does... Instead of this obvious statement, explain how the remapping is done. > > 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