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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCCADC6FA82 for ; Wed, 21 Sep 2022 16:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:In-Reply-To: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lqzqaP5jMRc9ul8czUeQa1CY6lTx+AewIdXg2AMrOqY=; b=1Wwmp2u6kDUTbc/c+U9+RC6bdo abR98+EwkLGRPaNlsyOuf5pwOubzbCl3U+zGTfA+AsrvW/NAgiNKXgAPeWONZ/xNpL9gPel4Rv5Yc pBtqbggxBYKUnRYm8m5pwwc8X/O5BQSa8CZ5xUpVQZ/hIYXf40CFu9Udim0o1T5ZgBiA9fw2OHKut NcOEeLXYYfuaRbx1KeVns+9nY3Ua/MhdMUgiS9phKyxj5bA2saJKUpChRvZ32VyoRM355isah1ckN dHyO9HprqRs4PULtm+0QD1SjjkXeVqgglZZaS97Nr8hQOY+WGBtqgzN+2DjLOHCf4+M3yaLt3gKyG BS/OnYPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob2j3-00C0U0-Ud; Wed, 21 Sep 2022 16:37:29 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob2j0-00C0T9-1d for linux-nvme@lists.infradead.org; Wed, 21 Sep 2022 16:37:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663778242; 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=XfdNdeXgFmg/H3YnCdP7AhLnUVnj5eM/SOJmFNkY48JTA7kEasuEb1H9PmdrryBtlYBFMx MEeQPbzOkVqj6xS8w59lJPkxdM0//tadq+9CP1F+9OHgi8GjPlPNDU380LAUG9JIPLJsv2 tZLcfDW0zBawyEmTRNf3JbqV/++dZAQ= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-178-FBk9jfusNNaS6_5eSP435A-1; Wed, 21 Sep 2022 12:37:09 -0400 X-MC-Unique: FBk9jfusNNaS6_5eSP435A-1 Received: by mail-qv1-f72.google.com with SMTP id ok32-20020a0562143ca000b004a10b5f97e6so4640037qvb.12 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=VVXIhquKaRnS3ETXQTQZ7rEz7ogUIfwMdhmxP3PeY+hA7MXZVUAxJHR1hMVJwmltpe QmjJX104f4n9+URgFEyJfxfz1Sd5aNoxgo94qBSoThHnCyOAgTW0JvhyOGnhkjtX2fMf ECiUI7CP0s0rU4bGY9Lx5I8ixDpkoZQd1O2CUG/vxGyZ7C7GaZgZh8lGgoiOgWWTIya5 vuRaE1gP+FDFyZkpVIVuCppaXAmBfUk+jDe0EiJsYhcbODnxldcbynUgVtZO2A2rwBNf igT3vv9fx2h9ETqDlPg2FFe3aMGat6Ns0cxJEJ1FBDCKpQ5rvKJ+EwiGdE/Oe073ZfDX mudQ== X-Gm-Message-State: ACrzQf2AL6UgL9zdfibrG93xuwwiA1nDtevLK0McYk3W+RtiG7nGOBTg K6S48CEOHNwvtDqZ+LbMFgbKqBvTHABcOfDPkqDrF6fXqgQHpXVgfPti8FDCw0xTZHXrZF+7FTu eNY6pTGF75v9eokwfabmAxV/jbQ== X-Received: by 2002:a05:622a:30e:b0:35c:e8a6:a556 with SMTP id q14-20020a05622a030e00b0035ce8a6a556mr14071832qtw.467.1663778228402; Wed, 21 Sep 2022 09:37:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73ar8vwn+/9ZPLcWA6EkpKeKs46ioSv3qzivY5dXWi+h/4WTEEx97j1Ng5CPvwi80ruOPMAw== 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 In-Reply-To: <20220920091119.115879-14-p.raghav@samsung.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_093726_254268_3DC714FC X-CRM114-Status: GOOD ( 48.24 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.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