Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp484217rwb; Wed, 10 Aug 2022 11:26:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QNf5mscyLSdX4w5l59AMBlMB4qiYv/FuGGhAHkYh6Vn/lf7wnsdbeo5x2Wd+93SbazB4W X-Received: by 2002:a17:907:b590:b0:730:9e4c:3d5f with SMTP id qx16-20020a170907b59000b007309e4c3d5fmr21672893ejc.169.1660155983534; Wed, 10 Aug 2022 11:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660155983; cv=none; d=google.com; s=arc-20160816; b=e4LPQ7kSiqAn0EIhU7s7xz9KQn43VxC10CR3XEmib8UXEHEigP5pX8IEdkT42MJYUp NDNZ7bKET4iNJ60zRO20I4t0yCYa5Sa71eCKb+7ZzSI4YjGZSw9VrxlV6gwinnOSOxmA qhT90ANwVgTZHEzJAe/QrssztfE8m4zUPQ2lgZYv7lTLRv8jAhHuXPJ+Fy5MRb33ei8H 8rY01iMUj/ny6xpN4wKO3RZz7UXt0GwCBOrqMDycJQPgtvSZeMRtWCdKAnORRAyQLPnr ivqDgWNxtoiRU9YCC1AG1w0LSMQyF79nB5GT0OQptN6s3lbMjSPCE4hlMs6prrbvgEMP IceA== 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=GW0Wm/fEeUuSwpHUVwUA2FIWERZtq/JdGiJ5Il9zA8o=; b=rII6Qd4nI2G4bdINwP9J6wNnJduDZZQgwyMGdf2wXeUrahxr/EFjRCz1jswKrqsE+P KjSvuiq8CNzoecOR/XK+EvkfTkDzU+8gUqlQ0TGNqQunjOLMy3CzdHJjE2Fww4GumxVT GV8g0T84NupRXM3Hc5L0b+mTbaH2s8BgKbpGxt+Qlc8Ryi9/NjNBC2OVaQF+MzITUOBt ZiAxpwJuFzn9jfzxxYPrsfP3cwND3DlDyIrytYIzP2c5nxWX/Fhh/ml+2cQ2PbB48q55 1JxgVqRjxjv4zrZ6VCV1g4sggLcy4GLk8Z8h2KfTv2PJxaGq7ZpSFoQqVLGRpWW7PyC6 P7ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="nZhQ/DUC"; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=NkFepG72; 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 y24-20020aa7ccd8000000b0043bb9893d78si335221edt.246.2022.08.10.11.25.55; Wed, 10 Aug 2022 11:26:23 -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="nZhQ/DUC"; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=NkFepG72; 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 S233301AbiHJRb6 (ORCPT + 99 others); Wed, 10 Aug 2022 13:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbiHJRb4 (ORCPT ); Wed, 10 Aug 2022 13:31:56 -0400 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03FA08274E for ; Wed, 10 Aug 2022 10:31:55 -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=1660152714; x=1691688714; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=iSAbLAT1un1DIXlYyiyoixmMeyJZWbkOE9eh4lzWMkk=; b=nZhQ/DUCMHiOQ3xqdGrwsrcKqdrJ1zTGGoNNbwmRkJWWWTAoPOCyb66R HqBVCpprV+ynuw1f0wwezl4JE+H0vU8WZvcE9CfPqDroS87hXYMpkKSnm eFIpzByAq0dgXKtiXtfcGdMLHrr8CB2tJ3BnFhmwqhgeKD9WKn5BzS0kR xt99wu26PJ/wm59kMxbdJFRjLg7Bubu3hNA6DHj4xLRvESjCztMrxFk8O ZsKvySe9DwLZbuOaQNSL2fLRUIPyAPPtUngi9TF8FFRX4mCXLOhV508oc gXo7WvXBFyae2ahprVcTHxiFoDfKZX9yI4T5Yilteyt9NjouvtJXj8od3 g==; X-IronPort-AV: E=Sophos;i="5.93,227,1654531200"; d="scan'208";a="208365884" 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; 11 Aug 2022 01:31:54 +0800 IronPort-SDR: xm9UDKbMGTr9MX4a1+pn7OjpW2sATjtK8Ac+10GoA4UoPEk00AsKu3SW0ulxHNpbIlb2BJCvti +zGX6qJCg1WHtmwjQbe5C3nv38DwnqO2ON4L9t6FeHcdbr9s9YvsfrgQJNW/SuisJm8/xy2qBc HAGg5CxxFXqb0lhhR+GCip1a/SN6gv/zK5XI+6GQnkUSjFTIQ1F1dQz+Ly8HXvroneNqYj0sro kMATq9/1kRqS75ETadJPEbatEh4bDq9aFY3qPWvxWmz2/bRb1pynJET8EqPipC9Pv/sYeUgfho AwLPPEqtbdA6epkyyoYZ9E5/ 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; 10 Aug 2022 09:52:49 -0700 IronPort-SDR: MxOfY5KiS9osqz4Q793yjc6ecSIblZBvl+lJubmRoPzGyopeUPuF27Tykw8I5GDRqMmy97DgT+ d2HC8rOAnIyX+PX+EsGqAo5a/+O1cR2FIOmLUmRi2nHUneaaN07Mkz7BuSENMiEDUtEMxjMHAj fpE1mdPtdeBneO1EVjY+5txTAKYqFJFyN0iCDhTSohgkx9KZ54d0k647FAEPdYGOYb9Hp8uYHV fSPKx/gVxTVelOqAhd7zmJelXeS8QvpFOW8TroMjQqjjjqDutegqRbIU3auCC/xW6HYZOLnrLV noU= 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; 10 Aug 2022 10:31:54 -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 4M2xnk0SWKz1Rws4 for ; Wed, 10 Aug 2022 10:31:53 -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= 1660152710; x=1662744711; bh=iSAbLAT1un1DIXlYyiyoixmMeyJZWbkOE9e h4lzWMkk=; b=NkFepG72oh0Ro6o6I1Sk/28LgFGx9euMASY8zzem+IsK4ScCKzV n7uVJb9v+3OmoN4p21hZka1q4b/xPox7RRLagW5ypFjC6szScO1dKubrEZMMs4/g kNZtWAD7W3WJEyPDSh+d9ANuV3dZhqdEhjqfkc+Qd8+BU5R17MsUZF3vQjRx0RvO PfN5Xc/WYcPJybvgU5u4B1wMY452OisDsf49PVqeBpBUgRDBvS75Sw81ezUY6VrB bI8PmXqBpfQZOA76Ipomg1LOwBgiZroD7aoMIXUUcpqaF9mtc1B/wyadB69MPxYU /4N5u5lmG17oNnVwdD5QwBRPhTF1Gmrn55g== 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 So-N3Lnyf7zo for ; Wed, 10 Aug 2022 10:31:50 -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 4M2xnc6NWnz1RtVk; Wed, 10 Aug 2022 10:31:48 -0700 (PDT) Message-ID: Date: Wed, 10 Aug 2022 10:31:48 -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 v9 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 , Johannes.Thumshirn@wdc.com, snitzer@kernel.org, axboe@kernel.dk, agk@redhat.com, hch@lst.de Cc: dm-devel@redhat.com, matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, pankydev8@gmail.com, jaegeuk@kernel.org, hare@suse.de, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, bvanassche@acm.org, Damien Le Moal References: <20220803094801.177490-1-p.raghav@samsung.com> <20220803094801.177490-14-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220803094801.177490-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/03 2:48, Pankaj Raghav wrote: > Only zoned devices with power-of-2(po2) zone sizes 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