Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1935543rwb; Fri, 12 Aug 2022 09:06:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Tpr9U/ERa0Tt0IOw/pGoUbejAEgYNsIkItJmT5iUsUguUFjHaJwwbw1fRIYn0Mqu/n2mp X-Received: by 2002:a05:6402:3805:b0:43e:8335:3a2a with SMTP id es5-20020a056402380500b0043e83353a2amr4332163edb.296.1660320404287; Fri, 12 Aug 2022 09:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660320404; cv=none; d=google.com; s=arc-20160816; b=QIa//riNLD5+p7PoAxlN3N8IHa6YErqU5NRJig1AY9jozn5etRD7jPYpQAGltclIBI wWSxthlBU0PaoulNBXKJNq6Ai/fMGlOxzOsxxbrC959PGrZdUCjbXDJ9A73wdb11bUJj +Z6YPV90RurqYd0Rcas/eX7cxYC2wPedgKrOdKIlqPTGSE3/onuYpO8KNgxoME+zsFrc ULX5NSe7IjAUByZKBxV3UpRlbLpbDKkeaPIRxzdtEa+PzlTvDEM1Gd5SuHFqYnRgSXL4 2KuZwCfcQt8eemYoQ3O7qAw9XnxKUbGfgtPY3+gS/XRR5watnRkQyg3HailGbRRn0w5u 2tGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature :wdcironportexception:ironport-sdr:ironport-sdr:dkim-signature; bh=EIxQsqGneKo2bUyKxEX6enQmKSEOFt7Ow/hZIVrNrkM=; b=gN5V3glR8c67sTcLSw8sTAti5dX4pf3YjX04KAP/MBV/JqCFtr5Dmw3PwBvA695U5f XlPANc/o+hBZdr4xn921zxQNoh1b+4Mqzit4Ca5Mqx6SRMXQ0sZvziEtNxAafaikJySH OTyfAZNhytW8vxfZvw2JNmDu/qxW9/4+a19iJBarTlfwis9WPfRVr1iqCUBdXKXlI6w+ ns/MJZofODRrxGhg7Tm36Mm/RaAc5oI71OhFZ75uNiiQNHrdEJuHmAtxKdY5lgCNKd1a bQ2GN3A7M9pgCCZ0fSlETOn68yutBAJ25tBWgrXAH+rxom8pZtnc7sf1O117EYOTzNdk DTrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=dybwJNfk; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=q+0fOWbP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a05640250cc00b0043dc589b730si2679317edb.72.2022.08.12.09.06.17; Fri, 12 Aug 2022 09:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=dybwJNfk; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=q+0fOWbP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238443AbiHLP5W (ORCPT + 99 others); Fri, 12 Aug 2022 11:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237768AbiHLP5T (ORCPT ); Fri, 12 Aug 2022 11:57:19 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F456ACA34 for ; Fri, 12 Aug 2022 08:57:18 -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=1660319838; x=1691855838; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ivWCmtcKObajXTb64gQw6NqZXTRUIX+bqGfcqguzbqU=; b=dybwJNfk9YOBGriywguyL7c6Htdc/Nad3p3LHYgra8gBwrjuPTZV/353 tiusArpcua+1FlS/sKJcdlz6s6x+Z9jdX1Qq9VHawSoS4xIat274RT9/m uJ6dawQaeECo6yylgGjr6f8P2X6ER15GLKoIYwKe3c8762DCuwMRP05QF ZYBLiMNhtIcsEOP8X7jmP1jna+N+uSWdFsrVBAJ1aTZICz8SHgT7uPiXG Ia+rEPzmpE9PQgLzvhlKjD2j2+tX9fab2glMZNIT9+GGk38T2MZNvYdoK K63DcZNJzbbw5o8tGjkxshNM0sht9Icvn/9Va0oWJPLfTpy3yLVrAqjeU A==; X-IronPort-AV: E=Sophos;i="5.93,233,1654531200"; d="scan'208";a="209100940" 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: q+bAVcab8SsNSahQ1lw2TIglQm16iYQKbCHm2kzZcKQgHyzO+fSdlb+Cxn4ggayPuq4/WXurjj DKUr8ppsF8/vGY7ZV4hXlE/iervgK0rs1bPko9gp7SjdTvAoC6KiFXRhGyTPrbq13alxWZiok/ lrTEG+ex69vk5T67CJiThCofOdpX02woBZQXn+fJZBzOKqYidamhDzcp3kLKWo09COUDd3mjRp 7Fkf6NkShaEx7Zx94Ua1f4e8usEfqWVfo2Lz4FnqDi1MwRKytgaQROV61Q60Fxw+ahs+5lKRsc IwtDjyS+G6DzLrw/nSJzQ6bA 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: EHmI8mGyLW5tVd5A8YtqywRO5v/au8vR0JDIOEYlLioAnNR5wAfWn6ha+CtIsxu+IVWQIX4rAJ jMAvRs8ib4dlsz1Prp5J+IFpBzCObUOJU6Uwyb8aH7Zd0kMLgBfimgtjaH6WldZDua2VW7llRy urEv3LdkfqLM0EEXkFmUBDiqRGJ4oRKseiUK1JnJ5IqNF8xfLwvouNj0tPDoOR9vMlATQhRC9G UwMiDTGf0p+95yEWn2hsLYRyHRhpgCd630+0AE6s7f6zC9qDcJzD2LvmyTCSvR8riyns3DuhWB bTI= 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 4M47bb0dp1z1RwsB 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 jq4Nci6ZzXL6 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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