Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5632589rwb; Wed, 21 Sep 2022 10:13:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TLAbvQeb3PZGWF5RXviKKt5wsco3+WWtbRy5jJq5d7lsq41NK2zmWcGgjWvabY52GIzAr X-Received: by 2002:a17:90b:254a:b0:200:53f:891d with SMTP id nw10-20020a17090b254a00b00200053f891dmr10681123pjb.168.1663780417525; Wed, 21 Sep 2022 10:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663780417; cv=none; d=google.com; s=arc-20160816; b=gRJz/5I1cCZy4yXj1VgYiVmMf5SUnnUSrFNmNANWmBoYT3sLCWBM5WwEKpen/Un6pw uMudEiuzHUFakamer34M1euUW2PV1jvRe8EnV2k5S11zCZOTi4euxiAuihfCl8I71Llf 6Q9suKKzcFO+Jf6dOLGYYI4vkBJ2WLugDvrtBjG8whpBjPjaiagWz2X6g3mIZlZz5mGG cZJlU4XSRmiRcy4inQxeo1eMKWAkdQV/j/4Ghdrh+DwJqBiK5RhCSZJcCz6/JRYwzMjk J3f+d6Vq9jEV6fv4HftMhCIf2kfYatkf0XJYuedfmKCUAYNO7lKzRCEncKXJerJqdDgu m7Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lqzqaP5jMRc9ul8czUeQa1CY6lTx+AewIdXg2AMrOqY=; b=ejnW9EnQu3OojEk5DMuxwBTBpo6uaLX43vfzKu1rJo74PBgtSHpw7oqyOG7hjgfIGT X+pQkH649TRbI3Vz9Ds/HEhYc2VhQMuFUV1V5Ihc5QFv9Bq/hqLlBEPdADoUxwpK8S3U puCLkYcBJozr9l2R6FKnKaN7yl4PEXVtBMZX9EytWQEIoZmSi4XTdyEjfoYdCXwqS5lv 75SZOm2HXEQrVRyOJmG/jFMj7lhN4dnu3AU4DdZxUwNkJp+yLQ/F5/aZNViJxwQmR5+Q +N0tF0okFFiX91P9CSD7zGU80OCJwmI0s8l2hKFDuMF5mYwOruZax8n7bW6khKhWG2Sx rIPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V7gFWepi; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170902da8300b00178264b5ab3si3662516plx.480.2022.09.21.10.13.24; Wed, 21 Sep 2022 10:13:37 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V7gFWepi; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbiIUQq0 (ORCPT + 99 others); Wed, 21 Sep 2022 12:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230426AbiIUQp4 (ORCPT ); Wed, 21 Sep 2022 12:45:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B0125E for ; Wed, 21 Sep 2022 09:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663778230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lqzqaP5jMRc9ul8czUeQa1CY6lTx+AewIdXg2AMrOqY=; b=V7gFWepi75N8P/c7AWBElUoIT0Xahn8PI6feZFQu9ewq4GXE6iJdMw7UUncn39tUqXqlQ8 RViKT46AQ4ZNCXuv3t8eb/UPdL82YTdiEK/zC1NZJ4faNlBHwreZmwrde04PzJbQxGoZ4w +Y9C2eXnI3KotIpobqZj5EMfukNavWc= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-168-EBnKDTYTNb-uLtjiPZJVhw-1; Wed, 21 Sep 2022 12:37:08 -0400 X-MC-Unique: EBnKDTYTNb-uLtjiPZJVhw-1 Received: by mail-qt1-f198.google.com with SMTP id g21-20020ac87d15000000b0035bb6f08778so4533253qtb.2 for ; Wed, 21 Sep 2022 09:37:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=lqzqaP5jMRc9ul8czUeQa1CY6lTx+AewIdXg2AMrOqY=; b=708w0JY9AXBmJuQMSvtRgmYGUmjKwvYND+8U7bGYRMAGAcWuthyTKSOLZVQXhsxwKJ hrbBJtAqzjbemjEndEjAzFZZb+lX/lrXNls3hAO3vrWKeMZIKB8wdeFpQP1i5ihEsWAV YRNgT+EficIWWlBneJj6MLytgeC8P65pm1PUQQllc/XgTIQYharkcE5u1CexjY1TOy+M vbskAn2dJ1lmBZzSRQzaNSCJVMbESyuNF5iIaPLZhhC4W97qd8Pv55D2Gn9gheLQxIcb oBUh4kv4YJH3w3FZrWRQyEjqLyGCt61kDvAUgCSGRRCPV6zebHV0N5MKTfDwDWMqQujp 3rTA== X-Gm-Message-State: ACrzQf1g3+Hbnupymn3jSRI7ZawgAhwKmRPNvQ9LeNWLtR062+ho9PND k04Ac/XDxx+dxn7kS5j0Lv+FlN//zy1T858aXUroSjcC5xDCBpowqc6Sz6/8zwQKxj9y96v+UFQ zO1tA3aZLWHF4cOs+t/aEljk= X-Received: by 2002:a05:622a:30e:b0:35c:e8a6:a556 with SMTP id q14-20020a05622a030e00b0035ce8a6a556mr14071827qtw.467.1663778228390; Wed, 21 Sep 2022 09:37:08 -0700 (PDT) X-Received: by 2002:a05:622a:30e:b0:35c:e8a6:a556 with SMTP id q14-20020a05622a030e00b0035ce8a6a556mr14071765qtw.467.1663778227809; Wed, 21 Sep 2022 09:37:07 -0700 (PDT) Received: from localhost ([217.138.198.196]) by smtp.gmail.com with ESMTPSA id g22-20020ac87d16000000b00342f844e30fsm2195205qtb.31.2022.09.21.09.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 09:37:07 -0700 (PDT) Date: Wed, 21 Sep 2022 12:37:05 -0400 From: Mike Snitzer To: Pankaj Raghav Cc: agk@redhat.com, snitzer@kernel.org, axboe@kernel.dk, damien.lemoal@opensource.wdc.com, hch@lst.de, Damien Le Moal , bvanassche@acm.org, pankydev8@gmail.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Johannes Thumshirn , jaegeuk@kernel.org, matias.bjorling@wdc.com Subject: Re: [PATCH v14 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Message-ID: References: <20220920091119.115879-1-p.raghav@samsung.com> <20220920091119.115879-14-p.raghav@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220920091119.115879-14-p.raghav@samsung.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 Tue, Sep 20 2022 at 5:11P -0400, 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. > > 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