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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEE95C6FA8E for ; Wed, 21 Sep 2022 16:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbiIUQqX (ORCPT ); Wed, 21 Sep 2022 12:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230447AbiIUQp5 (ORCPT ); Wed, 21 Sep 2022 12:45:57 -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 884B02A97F for ; Wed, 21 Sep 2022 09:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663778231; 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=ToHV00PXKo34xVBwRN2ca6mL6rtQLx4p/9prDi7NiVCuz4LRLzC/LRQOkAVXmHkH5N4tNQ n5rh6BIaFY/hsoTl2wsV6u/AdSx7WhAuzHsXyLVeScrW1IsHSZh8acRhzdlWP8gpgO/wBQ jPfttdkUGgGTEHIIHcFEJ/8cUBcor28= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-29-Rg5QpikaNiWnmBFy6Sj0PA-1; Wed, 21 Sep 2022 12:37:08 -0400 X-MC-Unique: Rg5QpikaNiWnmBFy6Sj0PA-1 Received: by mail-qk1-f198.google.com with SMTP id u20-20020a05620a455400b006ce5151968dso4591722qkp.11 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=NCHKvxdjB2WWGm5BfAfZW24cNjAlPO2cIGwTh3HUvsev9ttUiilzrK/i+HACTbeBPM mh4A9ETtfYMMK9r0l5Nppz1ZEcHJgkm3Gu+U6hNSNe5HvEg5BqcCWza+x2/9rlnZn71P S5Yc0r8IwMicGDwc2AqwzzPTFpxk5A3tybLhPrzfIror/pD+YhWno8ob/j34Swfj9ZT7 37OsVEaR6brJ2f12VVEEksXz9QBe3gqKNnkUeUzm2ioDm+WqoRZiNuYhj1XcKrwrxM+5 0MnyBet0rHxtdFhmSiTgGqHJBnVt2RqVPmbxgIBdoPrnxXev7/yWxYpsFGaAv0gA03sU JvDw== X-Gm-Message-State: ACrzQf0pR9q8DcCpOeSz3ZhVewLX1v/rxo37xLHosDSnPhjkplWh7e// BnfK+xJsinw5R8mo4kpFltlEDGwAQ0Joma9IlixH/emeHeoQ2IscPtCOCWZT1wZorTOgPRRNiT6 2l+w12FScq/xagitPxFxR4Q== X-Received: by 2002:a05:622a:30e:b0:35c:e8a6:a556 with SMTP id q14-20020a05622a030e00b0035ce8a6a556mr14071817qtw.467.1663778228384; 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220920091119.115879-14-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@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