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 983EDC00140 for ; Fri, 12 Aug 2022 15:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237169AbiHLP5T (ORCPT ); Fri, 12 Aug 2022 11:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237768AbiHLP5S (ORCPT ); Fri, 12 Aug 2022 11:57:18 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 852659C2E9 for ; Fri, 12 Aug 2022 08:57:16 -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=1660319836; x=1691855836; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ivWCmtcKObajXTb64gQw6NqZXTRUIX+bqGfcqguzbqU=; b=moy44vzc3GcN5mFUtlSFtwbzZ9kgWsIw3h1urKR2cPvss/SlhLjGNnS3 8KCwNPBRvpgYOdjsJVCNBUox0R3mARmzBXmWJaKM/3NS74VP5jhPGsKBL wLSjlNA112h0S5/SYr1UXiyEpU7mON7rsBb5YGeRSCI2t0DAYkJb2Prja rdQSv6+Cgam5LtyS0zKiwCZHumnxbFmf2ydDn7NWZiwnuq9cI6kH3vncZ jp8I5RZs7R7104F7o6Rkj6EvCEPgk/I+EzZKEVSvZNe9VyRs7/hb8Vw4E nNnKIbjIqVhRlUjNcTkcaAahl1gAkiAgpgGV07CW+H+aA9t20A5NNc6p5 A==; X-IronPort-AV: E=Sophos;i="5.93,233,1654531200"; d="scan'208";a="209100939" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 12 Aug 2022 23:57:15 +0800 IronPort-SDR: hIYKGtFP1FOrWG9HAZgvOqtwVb2sNo1MTOwm3FURFYCZfYrEtzMD4BenPeTmcNZGKP8gigVFT8 johbqtx1StP9jGLz5KnzHVmDeJDLQKSTDeKQb927fk5GAJbyU1sDC7dTpfXLCk9X+Eeye3dJA8 /MXmzHRxAXvBbgbryoABqnGmPqbpfBCSeCwi5Mmnft6RXLmN7QC8Qc/NWXXE10wqUpo5/Mdu/o hzH2YnnBIgSD5Eg5HdDPfI+Yh25GiJyEfLTyB5petlTuuc/wZC70+iRR1cM7rRogcaOG93cIyq l7/daaeaKEj/6+aBSj7WJ/CB 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; 12 Aug 2022 08:18:08 -0700 IronPort-SDR: hO3g+LuOzoeWoFFJAVmfZvvZcTiQgXZke5/1aWOj2Q6dDUqSsOary/Zd+7ASdPL1XcXj32G66c ciFkE6tOhubbvKxuhhzdXfBrSm7Fam8c1eY9zXB/z/7V+O0aBZiB/QmglINxZoZ7MrF6mYtJt6 LxV2Hn2cOsYotHDccK0aFp+Nnj6P6+N9F7CR2BPeHyX3u3Df3M61lBl36re0Hlx/JZQ26N9X4g JLtdCIZacHwB9AGdw18Vh1j3hcajJ7Lcoa1xw5sgKoTvNlmkd+n9KCNxhMyfqOFGbkimPgxRsS 5ps= 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; 12 Aug 2022 08:57:16 -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 4M47bb0Xcmz1Rws9 for ; Fri, 12 Aug 2022 08:57:14 -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= 1660319831; x=1662911832; bh=ivWCmtcKObajXTb64gQw6NqZXTRUIX+bqGf cqguzbqU=; b=q+0fOWbP++Sh1sQFTGQyIjTEZLogao15tyIVpt4ulmhqZELxylC 5kva/QUJkTO7sXJ3NlFThrhDe2LZ2HWcn8naumhybO2yndvj2DmQLA8MVrCeZUWV n2BlrT3ZwrNn3s/Y9kGH0QaE4OwWHvufOjyFNlJLDspSZ2eEmwl1GVMWDynvSfNI bLY0QzaCKTBAZQfzfgzln71r1kswBsJ7wrk0/y97nz7WgpBQpCpa3XChkbOwLBJC jKvzp1n1nUiumOOJlBB3sOsEHZij22bwhpXm7oEn9algxVvyI26XPNpK85fvHWKo QgwiG5WlB/rjjzT+maWW/q0r7Pohd5USDeA== 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 AYLRtvBP53ue for ; Fri, 12 Aug 2022 08:57:11 -0700 (PDT) Received: from [10.225.89.57] (cnd1221sqt.ad.shared [10.225.89.57]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4M47bT00yTz1RtVk; Fri, 12 Aug 2022 08:57:08 -0700 (PDT) Message-ID: Date: Fri, 12 Aug 2022 08:57:08 -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 v10 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 , snitzer@kernel.org, axboe@kernel.dk, hch@lst.de, agk@redhat.com Cc: linux-block@vger.kernel.org, Johannes.Thumshirn@wdc.com, bvanassche@acm.org, matias.bjorling@wdc.com, hare@suse.de, gost.dev@samsung.com, linux-nvme@lists.infradead.org, jaegeuk@kernel.org, pankydev8@gmail.com, linux-kernel@vger.kernel.org, dm-devel@redhat.com, Damien Le Moal , Joel Granados References: <20220811143043.126029-1-p.raghav@samsung.com> <20220811143043.126029-14-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220811143043.126029-14-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 2022/08/11 7:30, 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 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