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 59937C28B2B for ; Tue, 16 Aug 2022 16:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236178AbiHPQFA (ORCPT ); Tue, 16 Aug 2022 12:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236048AbiHPQEU (ORCPT ); Tue, 16 Aug 2022 12:04:20 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B9EE0D1 for ; Tue, 16 Aug 2022 09:01:50 -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=1660665710; x=1692201710; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gWta6mCRYZPmokqNjTVpFMpU8jnQuQs/z6XjFskr4pM=; b=BveCu8pQRVSEs4S14lZm8qD7uhco9kYmSY42d65Jyc+5YaLdseQmaYS2 s3Klha4pEffjKd4Fg2PIw6lHzNTCyv1PnD/8HnRiO6S/bQwsyVI/oFkcr W2imvDC+CQ3myaD0gI9avguZd5MT3ngW2qYkeFQSiMxWcomT1OoeMlNYt dLerzaQo4HI1Di2b2LUmRUHt0iUERTbBMHMktacptsQo9v9LKZU+4/PIq jrHsWH2CmLzq08KZ89w3UX4S27c2/tUuX1QUJafnYP2OLgZJVLBGu2cYO B2RDHikbAA865l9SgEZYVmSBwSnZmQMwYHPlFS3Op8kYdDp0xXiEjadpY A==; X-IronPort-AV: E=Sophos;i="5.93,241,1654531200"; d="scan'208";a="209382958" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 17 Aug 2022 00:01:48 +0800 IronPort-SDR: LFSMiSzw/iiVpRuNbYEXYTrrNIX+7pnMSRyvf3JwbAhmak9WsJo6quQ1PmvK4GZolFiAXm0ufJ HspVBKuLtWxNiygkmkDlusGVCtsddPEci6gLeQyb4cgQKmHEfrpnqSIHiCOPk4tgQmE80Juko/ Nu3kW2WHCRscl5bzwMyPiAiEwvLq6T1GMAkFVdcpxi05Rgj8RQrKW9T3JvnbC7ODUzQWUYlyor r1xvV0RjXVYzAuk9Fbwuc1NBhjapC0KzYm04qb95JMay4xtsk2QaaFlANxwnoEubJiVi8EB6vx NSv87emeBcrsmtlaEtEXESiN Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Aug 2022 08:17:17 -0700 IronPort-SDR: k1AMKaqaEN9p48mNkK+X+6otVN3DoeZfsCAG/Q6BHsFFXR4R3ke1AZ2Wogw5Oe1cyRXeiDcJTw WImP1dnHfSXGyTzb0uvCPvNOHggFHf2Y+ZvQG9jzqdQIvi8lAD7xPPtEEylaGlNgAEduf9lEhc J9wFryXdixknsnf4I0sf/19Zx7KDhfMLEHzzwoyQ/1FWMOACLfSilHpw3dHf/gUt+tZmmOCJGC OaxZYS5f9Kjix7w9YIiqPXtKr9CMqkzZR4DL3eHd7np+P+9JQNpLsRw/x/sEWAy9ln6oCjNgWo +T8= 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; 16 Aug 2022 09:01:49 -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 4M6bW00zGcz1RwqM for ; Tue, 16 Aug 2022 09:01:48 -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= 1660665703; x=1663257704; bh=gWta6mCRYZPmokqNjTVpFMpU8jnQuQs/z6X jFskr4pM=; b=exEEHzgpNFMiVy2vV4lAQuumkRtFf+HnydqaMIRKQR/NXVR+uUi YafT2O1en39P/REwIa3hw7ZyEhgNnfbjKNC5RoCIAmug1XNAo9iV6AEtsYNNJuke 5i1/N/GTvLMOKFPe2puUJqdKdwvpyxpDVYhetFYtHdDNbM0l07IxEhr6mAw7Wxts PQJmiJJQD1OlHsRsVHjpCWbEDkPaZfPEL34Z5oKy3IJZSy0MpgRjrHVs9uJ7s4W5 /PU3cgvDbwcPkt+OV3ZiHRQEC2VIx/gyu8fUsOEDzEga+xnXaqVoCdH1ztTAdnpm UbScc3Q3atp1TdcaiQMkvDfvGj2AgMrOdew== 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 zAmcqMfljBhU for ; Tue, 16 Aug 2022 09:01:43 -0700 (PDT) Received: from [10.111.64.29] (c02drav6md6t.sdcorp.global.sandisk.com [10.111.64.29]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4M6bVt6B61z1RtVk; Tue, 16 Aug 2022 09:01:42 -0700 (PDT) Message-ID: <30790cae-5440-2447-a8b8-52a57fa16fa5@opensource.wdc.com> Date: Tue, 16 Aug 2022 09:01:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v11 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Content-Language: en-US To: Pankaj Raghav , axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, agk@redhat.com Cc: pankydev8@gmail.com, gost.dev@samsung.com, matias.bjorling@wdc.com, hare@suse.de, bvanassche@acm.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, jaegeuk@kernel.org, Johannes.Thumshirn@wdc.com, linux-block@vger.kernel.org, Damien Le Moal References: <20220816131536.189406-1-p.raghav@samsung.com> <20220816131536.189406-14-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220816131536.189406-14-p.raghav@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/08/16 6:15, Pankaj Raghav wrote: > 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