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 20605C19F2A for ; Thu, 11 Aug 2022 16:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236525AbiHKQn2 (ORCPT ); Thu, 11 Aug 2022 12:43:28 -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 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