Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp242587imn; Wed, 27 Jul 2022 22:05:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u0bTdO+XEWttGjsECSmDAxeOSDh1ud2uzPeaagYYSc3IoWGOx1UEezlniX6YsMeEJXu+bR X-Received: by 2002:a05:6402:378f:b0:43a:d3f5:79f2 with SMTP id et15-20020a056402378f00b0043ad3f579f2mr26083409edb.338.1658984735585; Wed, 27 Jul 2022 22:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658984735; cv=none; d=google.com; s=arc-20160816; b=SKfQ+5DMlSILYKSvrfpNlRmWdrYl+Htsq8l+zuFCF8HOZfe85uDbqEqk72Y6M5v4FN LoePs7lGOfKxmGWwSj+LxVqVbbeilta41vu1zJCx1ikpf9qTRn2rIfvOUGmaslBhwGQQ HZkN5yMZG+ah0fIRxpdvfteQkZauRmAtfMWxDUM9+67DjvIcmsKDaM+HsfRufZOvBHin 62CrB9cXrspId1mWvbS9e0rJer/8k8cZdaCbrnNa+/dumTeZsOpG0fuxhizuflJePsMe vxegSxuHVgxuTsqHq1m8r3GdW+EAzlY4Tdfp7wYEqrfqdS2hgF/rYB3N2b1gRqDA85mA u83Q== 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=VKCwYr0PhshZ2QsipBK8PRQAFGHtT8GvG/JH4rg+hp8=; b=lSBsphbitOrf3ZXNWzAGtLGd/XISXHC9bLN1iNbceYtZJGdfIDA0OC22Xe4oONf/Xs STjuJ3OEpgit37cNt5M0X1DAotm6QE7JloyGLMG1DaP4Y1VXdU131naDFR0sfW1ofHFI 2b+/TVYjHMjsPPJVKXdJryALh94b9oF6ql3FqWlZLgg7t+/ML0q8+7cc4iz1oFWi4FlC N5f1GrhHQ1NQinqeW7qN8cjEJePZEabboXOcm98P4nVcSQKBqGISfLtbvVo0eewjE34m 61vD+c+Jz1fR5ghyqmyBCS9tCDoiewQTM1KE+M2kB7uYQTMKW2xDV49Q4jH/nnL/oi8u pj0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="lli/wwzt"; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b="ZLy6tv/5"; 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 e5-20020a17090658c500b0072b2e31d066si23076369ejs.642.2022.07.27.22.05.07; Wed, 27 Jul 2022 22:05:35 -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="lli/wwzt"; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b="ZLy6tv/5"; 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 S230151AbiG1Ed1 (ORCPT + 99 others); Thu, 28 Jul 2022 00:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiG1Ed0 (ORCPT ); Thu, 28 Jul 2022 00:33:26 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A83E05723B for ; Wed, 27 Jul 2022 21:33:24 -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=1658982804; x=1690518804; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=qYi9CddhMTc16oCfTA5/fPBxT6fjV6ZJpvffXNGyyMo=; b=lli/wwzt61gSDsmSQusrCtJl3oTDXTEzT24LpTYRp/qmVbAxuVzHecE4 QP5skiUrZnaNeyhzvv21mUDZitreFM7RuKOzVGvn/RqlxpPt1cPZE5l+r i1rb9Kqzwvncfzzmb4ZqCyeh65XHfmvBiePr5Guh8rfJuQrp6lj6xv2IV XH3ozlD3Jzu2WJQAU32eFjA59laq5emoL+gh9E8pL7IufyOIN/Q1INtgk 2204Z5jOgd6K8RNcibJp8kucV0KCnUa7B6dGWQ8gtLEPPpMGs7tDz5VU6 MOyXVbERH2/QCY1muoisD75OmeAeD2ADeBAl9DXSaLlwTvMVX9jOh0EdW g==; X-IronPort-AV: E=Sophos;i="5.93,196,1654531200"; d="scan'208";a="311440701" 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:22 +0800 IronPort-SDR: zp+zunsbU5CCCM7i/rOFYm/NLPeR7QO99cGmYxhLwWf7Zp8R2tWsgWlpnmZjLFm92dWe8e/2VY +Nh0vwDCjqUAO8qFMkDX66/2UxBZZRYybLkg6fnbRqbkeC/EcG00yIvVO6B0OT2MFIYZGHDYvf zO0HUryzAwYtsx0XVsCjUwHWx/hBBtqxNJe3kV2ZXtsw+XAFfQbDNEK8DPdkX4dZLI4UPZY914 eA7BbNWMFSvkPBS1cXAw8cJSnpCrk7L66j+EjlblPkmGmv0M8L3ooWSBqg79JeBjM1c5WFVoPG V4+86iEQ08IyT+E430HSbY0z 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:33 -0700 IronPort-SDR: mzSVhxGFdAvwSQZt/c1+37Z10eP6QJ75XEyr7Z1MvPJs3WzieTWgSSDU55iHWA6RnqUJoi+CYx enXFcy+RcHfdaMUp7uABHSo6A8znk4pv4FK8LFieDOrn1Yt3wPW1unvZEQx37/xfdoV548rPrr be7uVVf0GDNMrTs7X3OlgWeWZCSUD3ouDFAlSsHt/lELTZFDFWqmnR3aA15+wbvfY32zSk/xwj KomnCl/vUBVidu+V55Bn6OR/grWg9rDL2Lp3mY9nnXLSnCuP24dJ5j0harKhEatDtd0Ewe9Edr WBA= 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 4Ltd7P3jvLz1Rws9 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= 1658982797; x=1661574798; bh=qYi9CddhMTc16oCfTA5/fPBxT6fjV6ZJpvf fXNGyyMo=; b=ZLy6tv/5oGA/xQuL+JX5C/WZ34tyjtCsaj4kwX5723bke1wNeTJ ObnvOIjpLfPl6W51lrPkOljv6IX0O1PpIDMuHIhKhXOGMGRJFFYlHB00IJA0us9K M/GaoN8Sy0Y65fSmJwM4rAYjMXLbwdhEjVrVNdxih+H5WA7jyzzZaS1DjnMT6qE6 nCw8gR76sAt5l3jDqzHJfYQ+Jpy393YGqGf9cIAA8UcPJT68UOU1gJEvZL/U7aDr L0ybFXy7+eqgqzNNiPG19NBwSJRSdOPrj+sAziX5r3bJ9NvxHA8gYzny5jGXG6Us VeZr1sbr1kEy71rBR1Xj47EVdZKncRvDgqg== 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 ijUypCNvxv1t for ; Wed, 27 Jul 2022 21:33:17 -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 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 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 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