Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp277055rwb; Fri, 2 Sep 2022 14:04:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UDOGWZe28vQ4yf6um3z+46Deu6qza+SIvpqandJr9R0/yEWbHU7DtRhIp/hCn0UB68UtC X-Received: by 2002:a17:907:9607:b0:741:7926:a64c with SMTP id gb7-20020a170907960700b007417926a64cmr19417784ejc.718.1662152656926; Fri, 02 Sep 2022 14:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662152656; cv=none; d=google.com; s=arc-20160816; b=sslYCvfUa2fRR8vksP8wU7UCusSVs8nZ4xv0iGhG5QkLe4MYQM7+6i+qi6anuZri6C X0l7a9u9S2bP1CiKV5XxOxJIM5QG7+7PF0rUCsf+1/0DvSgiVp0HcmhmT1gqYvkUUc// XKdD3zXY5SeeQ8qX/9odkWyuReETITKVxxYPLyLVpIXiy55vHO0zFO4y+O667sH7qqlq RWvjbW3cCpaIYl1vO3hU/WM1pC6nBxtcXHNcRbAJM1ZGhlnAIYOU8G5PRAV8F897l+6D kYyO/kk/N3Z/5WJyFmSNtfPKN+y73W3dl9Th64b7MPW9p4ZYNG6abKAZnr64deAEZ5Dl 8gng== 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=e/i1xNela7arfufOlEWSIrFxi0oQo+ouwTHhQRBJeIY=; b=vrtUTat2yCYG+XFqFpGQWTExp89u71u8m0/BYpTETsX5T7YbVJ9QcgHVs6ZpO+wygC PTVY4h80w6MTKBFfhGQ+rxFrIUw9tAHEaNssQ4yY7vM/9YQOuf7X53HEMbiH0PHooXC5 16OuFn0ABtbdqOLs3HK65K+fyvDrTuU79Y8Ui/YVX0/lrbkjboUe2nOUkXPX/0uJjWC/ f/vfwZfiPzXVg/1I88kR/qDUDuB/WW+XWogzUxlY3s9R5hcH2c2kiM3PaqOiSKxBH5Bx 1hgnUWjxR+6i46glwbKTrewSdSP/Oxk7a9Ui406rGGxeYf9yXaYH5E7tgy0MURzfHUWz 77Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QmNeXyOh; 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 h5-20020aa7cdc5000000b0043586d19cf9si2216013edw.465.2022.09.02.14.03.36; Fri, 02 Sep 2022 14:04:16 -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=QmNeXyOh; 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 S229806AbiIBUz5 (ORCPT + 99 others); Fri, 2 Sep 2022 16:55:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230423AbiIBUzv (ORCPT ); Fri, 2 Sep 2022 16:55:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 100E053028 for ; Fri, 2 Sep 2022 13:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662152122; 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=e/i1xNela7arfufOlEWSIrFxi0oQo+ouwTHhQRBJeIY=; b=QmNeXyOhkMEj57sXm1+1Xg6S/er5x7DfqkrGw96NAyF+R1dub3ZyQ3R7r0GEWgiBlYhTr0 riJ+WpA+HUGbHlx4G00kOxZq91k2h155bFsMK+a3qmvlnLQt5CTODdhY1D39mUO+hgLR53 Vwvx0nIfO+9kHSPxeT0rvJ7e9q1KjZo= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-5-xfRqN5hZMWSiWRItXumH3A-1; Fri, 02 Sep 2022 16:55:21 -0400 X-MC-Unique: xfRqN5hZMWSiWRItXumH3A-1 Received: by mail-qk1-f199.google.com with SMTP id l15-20020a05620a28cf00b006b46997c070so2872349qkp.20 for ; Fri, 02 Sep 2022 13:55:21 -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=e/i1xNela7arfufOlEWSIrFxi0oQo+ouwTHhQRBJeIY=; b=kqOCs+pPA+T4mAZqOF42IC7BATT+okTiI8XVCqfb6b0PFkb/UyaQOW7u7kN5DVvHUK xP9i4JTxbA276FewHIgQ6FZ0wQ11uUiOfYtVXELcFS6LGIGTGdyR2WkMzt21xAPifMoH ZQpkmW+AhQUg+/vwdnbADd8crfBFOgLcbcIRZ32fnLyxuVa+X0FFf8Xlk5n95ajRkl7R 1aD3KSdD6gemz710Qa2c6OJKtQtWU4tIEeffXh1L0gEW2uXX3ZVu+1g87Ph/isKYhu6g 4rae6DPsmKGNzy2sDRjGoo6wJlL3jHyMtNxbRoBB69bWyU8fiyMr5/B1abOxQXq3FM0x hjfg== X-Gm-Message-State: ACgBeo3+hztNyy29EBpKh0cDaSXWveTIc2GJ0OtjrjpqpTR9nYvaMzTr AOuK/EC/4fDloJv+rHbRFtsQQ3u8chgjSKOGAVuS79a/tPi4rPWlk/77I7u0ih7dNKbeRQz64fK ClEJa7lZPzghaKTGKsBl5oIU= X-Received: by 2002:ac8:574f:0:b0:344:5a94:28fc with SMTP id 15-20020ac8574f000000b003445a9428fcmr30044836qtx.670.1662152120816; Fri, 02 Sep 2022 13:55:20 -0700 (PDT) X-Received: by 2002:ac8:574f:0:b0:344:5a94:28fc with SMTP id 15-20020ac8574f000000b003445a9428fcmr30044821qtx.670.1662152120587; Fri, 02 Sep 2022 13:55:20 -0700 (PDT) Received: from localhost (pool-68-160-173-162.bstnma.fios.verizon.net. [68.160.173.162]) by smtp.gmail.com with ESMTPSA id fw10-20020a05622a4a8a00b0034361fb2f75sm1584123qtb.22.2022.09.02.13.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 13:55:19 -0700 (PDT) Date: Fri, 2 Sep 2022 16:55:18 -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, Johannes Thumshirn , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, gost.dev@samsung.com, jaegeuk@kernel.org, matias.bjorling@wdc.com Subject: Re: [PATCH v12 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Message-ID: References: <20220823121859.163903-1-p.raghav@samsung.com> <20220823121859.163903-14-p.raghav@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220823121859.163903-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,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 Tue, Aug 23 2022 at 8:18P -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 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