Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3824716rwb; Tue, 16 Aug 2022 09:19:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7W02TLIrENhPXoUVkWZwgzuL34X2ZVLqPSor1E78+xBrr85uIi1YtNivknVi/2fy00fwHp X-Received: by 2002:a17:907:75d6:b0:730:7000:6061 with SMTP id jl22-20020a17090775d600b0073070006061mr14047180ejc.234.1660666746207; Tue, 16 Aug 2022 09:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660666746; cv=none; d=google.com; s=arc-20160816; b=gehwE+3ytDjF350cczL34LX/N9VvxWs0X5aVHUoAlCsOE7RAmMc6vY/JzjHOPbJovZ v4HL3ycXaL2/b4KvADOY6G9PAMGNMnFSOKvBqElw9TI8fsd06N6L7u5aqsCu9ObJ66eY wiEzJQX5hVK7a+VskxL01mYZ/F2awCGdTLmpHRK0mnL5aF8JzoD1UL6l+ClVnZmTaYxm mxZSxECHOsQ1izcb9G/rABfKWKu66/00wR2gSRC4xVU/48puqLY1M74rv3mpd+xSOb+L Ty3GyOGpW7+S1p2uB2nkcwNI5YTxHHTha5+66c3d75oJ7aYTBX3VpCBgDtOgK49Q0NYZ kaMw== 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=GJzzvoyxKNUjxB38+K6jdm+Reg27FUY7XXdxLs8eB0k=; b=aUQsVINWLwncYMEy7z14R6Pg0to4jqdQ3XZtXdaeekvnbkM5MGGnuDkxe49p03Yj8q 9CWyJpI7BDK7GMgRHn75QGg8IWMjE6cghwx9T+meEgf3sMNu5tZKGarSl2evlnSOs5pV 7MHAZlWlK9q7YBEI6E8O384XA8CTKjVN90U19EpbUmgqrk+Ye7eO/RyzCCTv1HdUvIyQ re8s8j8/HqpUPc+gFQUGH962AUMYHqhy++vB5fWZUA4qybbeRDZwhF/GKWrncRmmE0Cz AmgJxYSDpQO7CEO9hbf4WxN1m1gr5z+HP487/Va9UuYFKpJX8RaOC+dDYj5khmJ0b3/W uvXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=BveCu8pQ; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=exEEHzgp; 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 dm20-20020a05640222d400b0043d727cea7fsi9097787edb.341.2022.08.16.09.18.39; Tue, 16 Aug 2022 09:19:06 -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=BveCu8pQ; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=exEEHzgp; 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 S236026AbiHPQE6 (ORCPT + 99 others); Tue, 16 Aug 2022 12:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236048AbiHPQEU (ORCPT ); Tue, 16 Aug 2022 12:04:20 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B9EE0D1 for ; Tue, 16 Aug 2022 09:01:50 -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=1660665710; x=1692201710; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gWta6mCRYZPmokqNjTVpFMpU8jnQuQs/z6XjFskr4pM=; b=BveCu8pQRVSEs4S14lZm8qD7uhco9kYmSY42d65Jyc+5YaLdseQmaYS2 s3Klha4pEffjKd4Fg2PIw6lHzNTCyv1PnD/8HnRiO6S/bQwsyVI/oFkcr W2imvDC+CQ3myaD0gI9avguZd5MT3ngW2qYkeFQSiMxWcomT1OoeMlNYt dLerzaQo4HI1Di2b2LUmRUHt0iUERTbBMHMktacptsQo9v9LKZU+4/PIq jrHsWH2CmLzq08KZ89w3UX4S27c2/tUuX1QUJafnYP2OLgZJVLBGu2cYO B2RDHikbAA865l9SgEZYVmSBwSnZmQMwYHPlFS3Op8kYdDp0xXiEjadpY A==; X-IronPort-AV: E=Sophos;i="5.93,241,1654531200"; d="scan'208";a="209382958" 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; 17 Aug 2022 00:01:48 +0800 IronPort-SDR: LFSMiSzw/iiVpRuNbYEXYTrrNIX+7pnMSRyvf3JwbAhmak9WsJo6quQ1PmvK4GZolFiAXm0ufJ HspVBKuLtWxNiygkmkDlusGVCtsddPEci6gLeQyb4cgQKmHEfrpnqSIHiCOPk4tgQmE80Juko/ Nu3kW2WHCRscl5bzwMyPiAiEwvLq6T1GMAkFVdcpxi05Rgj8RQrKW9T3JvnbC7ODUzQWUYlyor r1xvV0RjXVYzAuk9Fbwuc1NBhjapC0KzYm04qb95JMay4xtsk2QaaFlANxwnoEubJiVi8EB6vx NSv87emeBcrsmtlaEtEXESiN Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 16 Aug 2022 08:17:17 -0700 IronPort-SDR: k1AMKaqaEN9p48mNkK+X+6otVN3DoeZfsCAG/Q6BHsFFXR4R3ke1AZ2Wogw5Oe1cyRXeiDcJTw WImP1dnHfSXGyTzb0uvCPvNOHggFHf2Y+ZvQG9jzqdQIvi8lAD7xPPtEEylaGlNgAEduf9lEhc J9wFryXdixknsnf4I0sf/19Zx7KDhfMLEHzzwoyQ/1FWMOACLfSilHpw3dHf/gUt+tZmmOCJGC OaxZYS5f9Kjix7w9YIiqPXtKr9CMqkzZR4DL3eHd7np+P+9JQNpLsRw/x/sEWAy9ln6oCjNgWo +T8= 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; 16 Aug 2022 09:01:49 -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 4M6bW00zGcz1RwqM for ; Tue, 16 Aug 2022 09:01:48 -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= 1660665703; x=1663257704; bh=gWta6mCRYZPmokqNjTVpFMpU8jnQuQs/z6X jFskr4pM=; b=exEEHzgpNFMiVy2vV4lAQuumkRtFf+HnydqaMIRKQR/NXVR+uUi YafT2O1en39P/REwIa3hw7ZyEhgNnfbjKNC5RoCIAmug1XNAo9iV6AEtsYNNJuke 5i1/N/GTvLMOKFPe2puUJqdKdwvpyxpDVYhetFYtHdDNbM0l07IxEhr6mAw7Wxts PQJmiJJQD1OlHsRsVHjpCWbEDkPaZfPEL34Z5oKy3IJZSy0MpgRjrHVs9uJ7s4W5 /PU3cgvDbwcPkt+OV3ZiHRQEC2VIx/gyu8fUsOEDzEga+xnXaqVoCdH1ztTAdnpm UbScc3Q3atp1TdcaiQMkvDfvGj2AgMrOdew== 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 zAmcqMfljBhU for ; Tue, 16 Aug 2022 09:01:43 -0700 (PDT) Received: from [10.111.64.29] (c02drav6md6t.sdcorp.global.sandisk.com [10.111.64.29]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4M6bVt6B61z1RtVk; Tue, 16 Aug 2022 09:01:42 -0700 (PDT) Message-ID: <30790cae-5440-2447-a8b8-52a57fa16fa5@opensource.wdc.com> Date: Tue, 16 Aug 2022 09:01:42 -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 v11 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 , axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, agk@redhat.com Cc: pankydev8@gmail.com, gost.dev@samsung.com, matias.bjorling@wdc.com, hare@suse.de, bvanassche@acm.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, jaegeuk@kernel.org, Johannes.Thumshirn@wdc.com, linux-block@vger.kernel.org, Damien Le Moal References: <20220816131536.189406-1-p.raghav@samsung.com> <20220816131536.189406-14-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220816131536.189406-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/16 6:15, 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 zone size 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 > value. > > 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