Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp802243rwb; Thu, 11 Aug 2022 10:07:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5iuyAN8xbshT+eWpHY8YQc1jQe2P/8JFR82EtZPrp781EhbQOXWszVkMhXivqAcXTr+ybQ X-Received: by 2002:a17:907:7fa7:b0:731:51b4:5020 with SMTP id qk39-20020a1709077fa700b0073151b45020mr30073ejc.352.1660237660806; Thu, 11 Aug 2022 10:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660237660; cv=none; d=google.com; s=arc-20160816; b=S3HXm2lhHm8h5VuQwxJ2hjJgg/8r+oSLFTezz7v2UxlZW2boBKUib4GxPMitXUUvoN HdkcAGY/LEhrLBOCG+PGeIE39KBTsyHNsx75vs2N4z/3EbptzCRME01aANOq374D3kjd WkC2nIwvA+H3e8jma29iHNaZvJbCyvSQ7k6my+mZaYkmbSorpcAnl0WjVjO4i/QM/6Au IOf4SY/S/qM4tK2hJzIsYp9R3enDmiFdWp9d6x1b33U8SCuIH+cKTVgPuZFNMOaknKBD O9Mj+WDwApGZB3+98SRGnK7Cg32ddmv8YCoDiwmEvxXJ4YKquRYq+0scuaiMiNEwjHIM 30zw== 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=u2IFiIZeFRF7y18uktlaoS/1CpBcMEPiMtH/Xsdww2o=; b=SP7Nd2PnPvsgR+twvbcL8X3zxG++jKQLbhuN8t4z28m67NoJIXwowmHyN9SG3PpGNg Ntf49KoiyXJ3SkgANSL5VzxZAN2HBBMmG0UilLWag8z+zwTsAsbYFkLDfmi+5Cxn9tGZ /9Yf6uM6UEvMVe67tdKrPQSzw/gme8M58KbFvyJgujhgzVBdca1/tx+0CFbYJFGyMqgk tx3pbHph72tletuWJk9liKROnCXX9HhVz6LczL1dg5yIHo64IRy85ClzMHu6qC+GSc/a s3EjgxafkYrziRmq8YBOY+tOU0q96VtxB1Eyrz68aGTgjinn/WBMovo9J+RWnyQG/uHU Hbvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=TGCWWJP4; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=I64NQpe8; 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 hc16-20020a170907169000b0073105b39580si3276416ejc.191.2022.08.11.10.07.08; Thu, 11 Aug 2022 10:07:40 -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=TGCWWJP4; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=I64NQpe8; 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 S236657AbiHKQn1 (ORCPT + 99 others); Thu, 11 Aug 2022 12:43:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236097AbiHKQnF (ORCPT ); Thu, 11 Aug 2022 12:43:05 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D5945F5E for ; Thu, 11 Aug 2022 09:15: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=1660234519; x=1691770519; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FGQZRl2CWl3CIWMy8wlUQ2KpRGUAW/JJBfetn8XTZIc=; b=TGCWWJP4dTdvvC+cXkdJWwLG9fe01maV/8ChO6nRRT8UNj2oxIb7Q51f iS16FohjQGAfTKWb1HnPq/UQ6iyA8ZqXNp+CmPwRL8KZRhzvyBafx9uGY kAm0k7p17NF7m7YrOIp+LTnjTNG2o+vlS4rPO8CnuQbJDrINsLlB+DFbU uEbnSq0ac6Y6kW4o4ahFSMhEq7oP3WmfNcbOVWRuyCf5Leqagbmhvzacz dP9lSIYQoUSpyA8i97uEqFioT8iKqpD7Kb4B2NPHmXKpMXRNfT7XJs5p8 paZPYfnQni3VxYd6dOeza/+MlnlDgCL+tbO7pfLuwPhTmXOTLrFhsADeD Q==; X-IronPort-AV: E=Sophos;i="5.93,230,1654531200"; d="scan'208";a="312747138" 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; 12 Aug 2022 00:15:18 +0800 IronPort-SDR: QJU+41jSw61qxYk1PLftx9hCpWm9KAapE0Q13xIJWqiJ7fhv8FSGQrrOa5QzV9qDc7LYW7KHk8 d+egt0/QWYu1jMg+Bf4IY/783e47+6I/ahK5MQWW5npZnDy+TNCD5pey9bwXkRo0n1EXbF2QuP PXZpXYopiIf1Nu6z/bstYVL979Z3eCc9gb9sQvLh9NkedXfUCBm/XIlqBPqERKFYbZ10+qUYR7 CB71HxqTZL4yydxV38i+6Rf1To0yyQAauDWX626nEbXCcmAmh/gnkTXdf+1EwN4AdCU3ep29Yd jPM0p0C+ydv4ujH5q2r616i/ Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Aug 2022 08:30:52 -0700 IronPort-SDR: 3s9hPyFSm/tacF9zd6gGjpoiDyOI4KdGZmzDAbPObCzc+Sh5Cea4Y5F7lAOlEFffWwE3Q2WEvJ /+4L9GVRQLQ4UzVhzt/dNcXSh1ggZ8SXWA9aJPph/y3bv5sunVLkpdiqiRpx3WY9Wtmfr+xiYN +CUjDZJiSEnrhB1QKF8XX5zQYb6lp0nO1dk96cLHZwsvKj3GXkOqbi9Dm1LNNYWeEhENgnTdfw Z5PI5TO0EYzZ87cCRJaK7+5stLEEbngYuWW8kgWErctNczg3vGF8Aid6RE+gGRbHomdU575Pq6 raE= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Aug 2022 09:15:18 -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 4M3X2s5SHXz1Rwqy for ; Thu, 11 Aug 2022 09:15:17 -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= 1660234514; x=1662826515; bh=FGQZRl2CWl3CIWMy8wlUQ2KpRGUAW/JJBfe tn8XTZIc=; b=I64NQpe8sOfbHs6fqVeUAkzbkjBaXr53klMoC+DrIUZh/Qqp3DI AY+TFj9/9iXcW5Pbr8NKCiS6GyZFRsCvRLSG+r8q+OiT3IEC2P/x0Yxm6Bnp/wu5 y5/IpmsXj1/ljqsAQCXgCwQMg00SeQyLoIh1MsPH+DpOCTlAeRF9zCFiAzGgiB7I yCrxZYUfrQelVEEl+LuOy8NDwWhE6JHmU9sapVFuHM51QEDefxdg04zkXlTjBE8h NQp2c3DvxAjY+GtwL2wD3Rhhy5VUXK+iTYk9jI/AvPloz+tVqLTiAOAMbDggPZXj m6Tv/LBZxy04PKmuZB1DhNO2V0Mgte9oStA== 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 HV-kt3b_WO51 for ; Thu, 11 Aug 2022 09:15:14 -0700 (PDT) Received: from [10.111.68.99] (c02drav6md6t.sdcorp.global.sandisk.com [10.111.68.99]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4M3X2m3BXJz1RtVk; Thu, 11 Aug 2022 09:15:12 -0700 (PDT) Message-ID: <9cc04d5e-dfa5-6d48-b9e1-60d319ab2299@opensource.wdc.com> Date: Thu, 11 Aug 2022 09:15:12 -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=ham 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